os-tutorial
os-tutorial copied to clipboard
macOS install gcc cross compiler error
follow configure step is right for me
./configure --prefix=$PREFIX \
--target=$TARGET \
--disable-nls \
--enable-languages=c,c++ --without-headers \
--enable-interwork --enable-multilib \
--with-gmp=/usr/local/Cellar --with-mpc=/usr/local/Cellar --with-mpfr=/usr/local/Cellar
the gmp mpc mpfr must target to /usr/local/Cellar.because they are install with brew
I used these flags in configure
that works for gcc 5.2:
./configure --prefix=$PREFIX --target=$TARGET --disable-nls \
--enable-languages=c --without-headers --disable-multilib --with-sysroot --disable-werror
--disable-nls
I used homebrew package manager. It worked for me.
brew tap nativeos/i386-elf-toolchain
brew install i386-elf-binutils i386-elf-gcc
The following worked for me
../gcc-8.2.0/configure --target=$TARGET --prefix=$PREFIX --disable-nls --disable-libssp --enable-languages=c,c++ --without-headers --enable-interwork --enable-multilib --with-gmp=/usr/local/Cellar/gmp/6.1.2_2 --with-mpfr=/usr/local/Cellar/mpfr/4.0.1 --with-mpc=/usr/local/Cellar/libmpc/1.1.0