Just a tip: you can build the compiler much faster if you use --disable-bootstrap
(here it reduces the compile time from 111 minutes down to 12 minutes).
After it's ok, then you can build w/o it to also test the bootstrapping.
And: you can control which compiler gets used also via CC, GCC, CXX etc.;
of course the name(s) of the new compiler(s) should IMO be different than
that of the system compiler(s), and must be in PATH.
(I found this method more reliable).
Ie. I'm using "-latest" as the suffix for the latest svn version.
That means all binaries get "-latest" appended to their names, like
gcc-latest, g++-latest etc.
After building I'm calling "make install", so the next time
the latest installed compiler gets used for the new build.
my_prefix="/usr/local/...
my_CC="gcc-latest"
my_GCC="gcc-latest"
my_CXX="g++-latest"
my_CFLAGS="-Ofast" # I'm using some more options for speed
my_LDFLAGS=""
...
../gcc_trunk/configure -v \
--prefix="$my_prefix" \
--program-suffix=-latest \
...
\
CC="$my_CC" \
GCC="$my_GCC" \
CXX="$my_CXX" \
\
CC_FOR_BUILD="$my_CC" \
GCC_FOR_BUILD="$my_GCC" \
CXX_FOR_BUILD="$my_CXX" \
\
CC_FOR_TARGET="$my_CC" \
GCC_FOR_TARGET="$my_GCC" \
CXX_FOR_TARGET="$my_CXX" \
\
CFLAGS="$my_CFLAGS" \
CPPFLAGS="$my_CFLAGS" \
CXXFLAGS="$my_CFLAGS" \
CFLAGS_FOR_BUILD="$my_CFLAGS" \
CXXFLAGS_FOR_BUILD="$my_CFLAGS" \
CFLAGS_FOR_TARGET="$my_CFLAGS" \
CXXFLAGS_FOR_TARGET="$my_CFLAGS" \
LDFLAGS="$my_LDFLAGS" \
\
...
Jan Nieuwenhuizen wrote on 07/10/2018 09:51 PM:
Jan Nieuwenhuizen writes:
Gábor Boskovits writes:
It seems that the errors you were getting are related to 128 bit
floating point support. It also seems that 128 bit floating point
support is enabled on 64 bits. I'm not sure about the 32 bit case
though, do you get the same error there?
Ah! That makes me even more supicious... I was wondering about this
command
i386-unknown-linux-gcc ... -DIN_GCC -o _muldi3.o -c ../.././libgcc/libgcc2.c
this i386-unknown-linux-gcc compiler is the bootstrap compiler,
gcc-4.1.0 (or we may be able to use 2.95.3); is that OK? Shouldn't the
new `xgcc' compiler be used to compile libgcc2?
Some great progress! I found the
build-i686-pc-linux-gnu
host-i386-unknown-linux
build directories very suspicous. I found that in my bootstrap I used
the older `i386-unknown-linux' only because I started with a very early
binutils that didn't know about i686-*linux-gnu yet.
So I have changed the entire bootstrap to use i686-unknown-linux-gnu and
configure gcc-4.7.4 using
../build/configure
--build=i686-unknown-linux-gnu
--host=i686-unknown-linux-gnu
--disable-decimal-float
--disable-libatomic
--disable-libcilkrts
--disable-libgomp
--disable-libitm
--disable-libmudflap
--disable-libquadmath
--disable-libsanitizer
--disable-libssp
--disable-libstdcxx-pch
--disable-libvtv
--disable-lto
--disable-lto-plugin
--disable-multilib
--disable-plugin
--disable-shared
--disable-threads
--enable-languages=c
--enable-static
--prefix=/gnu/store/mkhbgqfpj17p2pfpza95y56dlw2fmfj4-gcc-mesboot-4.7.4
--with-build-sysroot=/gnu/store/ffj8vq5zvm26jhw26fcmz3bjqdx5vfly-glibc-mesboot-2.2.5/include
--with-native-system-header-dir=/gnu/store/ffj8vq5zvm26jhw26fcmz3bjqdx5vfly-glibc-mesboot-2.2.5/include
Now, building _muldi3.o from libgcc2.c passes, interestingly indeed the
fresh `xgcc' compiler is used now
/tmp/guix-build-gcc-mesboot-4.7.4.drv-0/gcc-4.7.4/build/./gcc/xgcc -B/tmp/guix-build-gcc-mesboot-4.7.4.drv-0/gcc-4.7.4/build/./gcc/ -B/gnu/store/mkhbgqfpj17p2pfpza95y56dlw2fmfj4-gcc-mesboot-4.7.4/i686-unknown-linux-gnu/bin/ -B/gnu/store/mkhbgqfpj17p2pfpza95y56dlw2fmfj4-gcc-mesboot-4.7.4/i686-unknown-linux-gnu/lib/ -isystem /gnu/store/mkhbgqfpj17p2pfpza95y56dlw2fmfj4-gcc-mesboot-4.7.4/i686-unknown-linux-gnu/include -isystem /gnu/store/mkhbgqfpj17p2pfpza95y56dlw2fmfj4-gcc-mesboot-4.7.4/i686-unknown-linux-gnu/sys-include --sysroot=/gnu/store/ffj8vq5zvm26jhw26fcmz3bjqdx5vfly-glibc-mesboot-2.2.5/include -g -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fpic -g -DIN_LIBGCC2 -fno-stack-protector -fpic -I. -I. -I../.././gcc -I../../../libgcc -I../../../libgcc/. -I../../../libgcc/../gcc -I../../../libgcc/../include -DHAVE_CC_TLS -DUSE_TLS -o _muldi3.o -MT _muldi3.o -MD -MP -MF _
muldi3.dep -DL_muldi3 -c ../../../libgcc/libgcc2.c
no wonder it failed before.
However, now i get this error (I do not have pthreads/pthreads.h).
/tmp/guix-build-gcc-mesboot-4.7.4.drv-0/gcc-4.7.4/build/./gcc/xgcc -B/tmp/guix-build-gcc-mesboot-4.7.4.drv-0/gcc-4.7.4/build/./gcc/ -B/gnu/store/mkhbgqfpj17p2pfpza95y56dlw2fmfj4-gcc-mesboot-4.7.4/i686-unknown-linux-gnu/bin/ -B/gnu/store/mkhbgqfpj17p2pfpza95y56dlw2fmfj4-gcc-mesboot-4.7.4/i686-unknown-linux-gnu/lib/ -isystem /gnu/store/mkhbgqfpj17p2pfpza95y56dlw2fmfj4-gcc-mesboot-4.7.4/i686-unknown-linux-gnu/include -isystem /gnu/store/mkhbgqfpj17p2pfpza95y56dlw2fmfj4-gcc-mesboot-4.7.4/i686-unknown-linux-gnu/sys-include --sysroot=/gnu/store/ffj8vq5zvm26jhw26fcmz3bjqdx5vfly-glibc-mesboot-2.2.5/include -g -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fpic -g -DIN_LIBGCC2 -fno-stack-protector -fpic -I. -I. -I../.././gcc -I../../../libgcc -I../../../libgcc/. -I../../../libgcc/../gcc -I../../../libgcc/../include -DHAVE_CC_TLS -DUSE_TLS -o generic-morestack-thread.o -MT generi
c-morestack-thread.o -MD -MP -MF generic-morestack-thread.dep -c ../../../libgcc/generic-morestack-thread.c
../../../libgcc/generic-morestack-thread.c:41:21: fatal error: pthread.h: No such file or directory
compilation terminated.
make[3]: *** [../../../libgcc/static-object.mk:17: generic-morestack-thread.o] Error 1
Thanks a lot for listening!
Greetings,
janneke