cfenollosa / os-tutorial

How to create an OS from scratch
BSD 3-Clause "New" or "Revised" License
27.07k stars 3.28k forks source link

macOS install gcc cross compiler error #45

Open backsapce opened 6 years ago

backsapce commented 6 years ago

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

TravorLZH commented 6 years ago

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
KazumaTakata commented 5 years ago

I used homebrew package manager. It worked for me.

brew tap nativeos/i386-elf-toolchain 
brew install i386-elf-binutils i386-elf-gcc
bbbbx commented 5 years ago

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