Bug 61314 - Building GCC 4.9.0 breaks in libbacktrace on Ubuntu Lucid and Precise using libfaketime
Summary: Building GCC 4.9.0 breaks in libbacktrace on Ubuntu Lucid and Precise using l...
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: sanitizer (show other bugs)
Version: 4.9.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-26 07:57 UTC by Georg Koppen
Modified: 2016-09-12 03:17 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2014-05-26 00:00:00


Attachments
config.log (8.50 KB, text/x-log)
2014-05-26 20:01 UTC, Georg Koppen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Georg Koppen 2014-05-26 07:57:35 UTC
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++
Comment 1 Richard Biener 2014-05-26 12:16:17 UTC
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/.
Comment 2 Georg Koppen 2014-05-26 20:01:44 UTC
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...?
Comment 3 Georg Koppen 2014-05-28 12:40:20 UTC
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.
Comment 4 Andrew Pinski 2016-09-12 03:17:02 UTC
Works in later versions of Ubuntu for sure.  Sounds like timestamps are not working correctly for make :).