I'm installing gcc 4.6.1
on OS X for MIT xv6:
tar xjf gcc-core-4.6.1.tar.bz2
cd gcc-4.6.1
mkdir build
cd build
../configure --prefix=/usr/local \
--target=i386-jos-elf --disable-werror \
--disable-libssp --disable-libmudflap --with-newlib \
--without-headers --enable-languages=c
Things are good until make all-gcc
:
gtype-desc.c:8838:18: error: subscripted value is not an array,
pointer, or vector
sizeof (x_rtl[0]),
~~~~~^~
gtype-desc.c:8957:36: error: subscripted value is not an array,
pointer, or vector
sizeof (default_target_libfuncs[0]),
~~~~~~~~~~~~~~~~~~~~~~~^~
gtype-desc.c:9041:31: error: subscripted value is not an array,
pointer, or vector
sizeof (default_target_rtl[0]),
~~~~~~~~~~~~~~~~~~^~
gtype-desc.c:9062:31: error: subscripted value is not an array,
pointer, or vector
sizeof (default_target_rtl[0]),
~~~~~~~~~~~~~~~~~~^~
gtype-desc.c:9069:31: error: subscripted value is not an array,
pointer, or vector
sizeof (default_target_rtl[0]),
~~~~~~~~~~~~~~~~~~^~
gtype-desc.c:9076:31: error: subscripted value is not an array,
pointer, or vector
sizeof (default_target_rtl[0]),
~~~~~~~~~~~~~~~~~~^~
68 warnings and 6 errors generated.
make[1]: *** [gtype-desc.o] Error 1
make: *** [all-gcc] Error 2
There are also errors in make install-gcc
, make all-target-libgcc
and make install-target-libgcc
and i386-jos-elf-gcc -v
show command not found
.
What should I do to fix this? Is there an alternative to use command i386-jos-elf-gcc
?
gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin15.3.0
Thread model: posix
>
>
which gcc
/usr/bin/gcc
It seems that I do have a gcc compiler, but which has been redirected to clang?
configure
, basically just--prefix=/usr/local/gcc
(since that's where I'm installing it). I don't think you need those other options, unless you're trying to build a cross-compiler. (Are you trying to build a cross-compiler?) – Steve Summitcd gcc-4.6.1
step from your recipe, and changing../configure
to../gcc-4.6.1/configure
. – Steve Summit--target=i386-jos-elf
. I'm working towardi386-jos-elf-gcc
. – RahnThe most difficult part of this process was figuring out how to compile gcc into an ELF cross compiler
. But, I don't know why I have to do all of this... – Rahn