When building gcc 4.9.0 on Ubuntu Lucid the build breaks with the following error: /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../gcc-4.9.0/libbacktrace -I ../gcc-4.9.0/libbacktrace/../include -I ../gcc-4.9.0/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=dwarf.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -g -O2 -c -o dwarf.lo ../gcc-4.9.0/libbacktrace/dwarf.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../gcc-4.9.0/libbacktrace -I ../gcc-4.9.0/libbacktrace/../include -I ../gcc-4.9.0/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=dwarf.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -g -O2 -c ../gcc-4.9.0/libbacktrace/dwarf.c -o dwarf.o ../gcc-4.9.0/libbacktrace/dwarf.c: In function 'dwarf_lookup_pc': ../gcc-4.9.0/libbacktrace/dwarf.c:2678: warning: implicit declaration of function '__atomic_load_n' ../gcc-4.9.0/libbacktrace/dwarf.c:2678: error: '__ATOMIC_ACQUIRE' undeclared (first use in this function) ../gcc-4.9.0/libbacktrace/dwarf.c:2678: error: (Each undeclared identifier is reported only once ../gcc-4.9.0/libbacktrace/dwarf.c:2678: error: for each function it appears in.) ../gcc-4.9.0/libbacktrace/dwarf.c:2738: warning: implicit declaration of function '__atomic_store_n' ../gcc-4.9.0/libbacktrace/dwarf.c:2738: error: '__ATOMIC_RELEASE' undeclared (first use in this function) ../gcc-4.9.0/libbacktrace/dwarf.c: In function 'dwarf_fileline': ../gcc-4.9.0/libbacktrace/dwarf.c:2873: error: '__ATOMIC_ACQUIRE' undeclared (first use in this function) ../gcc-4.9.0/libbacktrace/dwarf.c: In function 'backtrace_dwarf_add': ../gcc-4.9.0/libbacktrace/dwarf.c:3006: error: '__ATOMIC_ACQUIRE' undeclared (first use in this function) make[2]: Leaving directory `/home/ubuntu/build/gcc/libbacktrace' make[2]: *** [dwarf.lo] Error 1 It works fine on Ubuntu Precise. The gcc version on Lucid is 4.4.3 and on Precise 4.6.3. I configured the 4.9.0 build with --prefix=path/to/my/dir --disable-multilib --enable-languages=c,c++
It looks like the configure check for '__atomic extensions' reports they are available for you but in reality they are not. Please provide config.log from libbacktrace/.
Created attachment 32856 [details] config.log Attached is the config.log. Here comes some additional information that might help to understand this bug. The build failure does not happen when running |make| but |make install| which is surprising. It might be due to our deterministic build setup which uses Gitian and libfaketime. We had and still have a lot of trouble compiling GCC when using libfaketime and what we are currently doing is compiling GCC with -j1 we seems to avoid the problems involved in faking the timestamps. Until now. The lines immediately before the pieces I posted above are: make[2]: Leaving directory `/home/ubuntu/build/gcc/gcc' make[2]: warning: Clock skew detected. Your build may be incomplete. make[2]: Entering directory `/home/ubuntu/build/gcc/intl' make[2]: Warning: File `Makefile' has modification time 0.23 s in the future make[2]: Nothing to be done for `install'. make[2]: warning: Clock skew detected. Your build may be incomplete. make[2]: Leaving directory `/home/ubuntu/build/gcc/intl' make[2]: Entering directory `/home/ubuntu/build/gcc/libbacktrace' make[2]: Warning: File `dwarf.lo' has modification time 0.035 s in the future Here is what seems to happen: the build system seems to realize that there might have been issues in the build and is recompiling dwarf.c during the make-install-step but not using the compiler the configure was for but the one Lucid ships. That this is a non-issue for compiling on Precise might be due to me not compiling 4.9.0 in the Gitian/libfaketime environment. Does this make some sense? If so, do you see a workaround for us here? Pointing to the compiler the configure setup was for after |make| ran? Or...?
I made some more tests. Building on UbuntuPrecise is breaking as well with a similar error while compiling 4.9.0 and not faking timestamps with libfaketime works both on Lucid and Precise. This seems to support my analysis in comment 2.
Works in later versions of Ubuntu for sure. Sounds like timestamps are not working correctly for make :).