http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50237
Bug #: 50237
Summary: [4.7 regression] comparison failure caused by
HAVE_INITFINI_ARRAY check
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: blocker
Priority: P3
Component: bootstrap
AssignedTo: [email protected]
ReportedBy: [email protected]
Host: x86_64-suse-linux
Target: x86_64-suse-linux
Build: x86_64-suse-linux
I have had a bootstrap comparison failure for days on x86-64/Linux:
libcpp/lex.o differs
It turns out that stage3 has
6 .init_array 00000008 0000000000000000 0000000000000000 00003d20 2**3
CONTENTS, ALLOC, LOAD, RELOC, DATA
but stage2 has
6 .ctors 00000008 0000000000000000 0000000000000000 00003d20 2**3
CONTENTS, ALLOC, LOAD, RELOC, DATA
That isn't surprising because HAVE_INITFINI_ARRAY isn't uniform:
eric@hermes:~/build/gcc/native> grep HAVE_INITFINI_ARRAY stage1-gcc/auto-host.h
/* #undef HAVE_INITFINI_ARRAY */
eric@hermes:~/build/gcc/native> grep HAVE_INITFINI_ARRAY prev-gcc/auto-host.h
#define HAVE_INITFINI_ARRAY 1
i.e. despite http://gcc.gnu.org/ml/gcc-patches/2011-06/msg00659.html the check
is still applied to the host compiler, not to the target. The base compiler is
the system compiler on OpenSuSE 11.0 and the check doesn't pass for it:
eric@hermes:~/build/gcc/native> gcc -o t t.c
eric@hermes:~/build/gcc/native> ./t
Aborted
The compiler is configured with
eric@hermes:~/build/gcc/native> gcc/xgcc -v
Using built-in specs.
COLLECT_GCC=gcc/xgcc
Target: x86_64-suse-linux
Configured with: /home/eric/svn/gcc/configure x86_64-suse-linux
--prefix=/home/eric/install/gcc
--with-as=/home/eric/build/binutils/native/gas/as-new
--with-ld=/home/eric/build/binutils/native/ld/ld-new
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada
--enable-checking=yes,rtl --enable-__cxa_atexit --disable-nls
--disable-libmudflap
Thread model: posix
gcc version 4.7.0 20110830 (experimental) [trunk revision 178287] (GCC)
A workaround would be to get rid of the __attribute__((constructor)) in lex.c
but someone should sit down and write a correct HAVE_INITFINI_ARRAY check.