The Xcode 6.3 release (with Apple Clang 6.1 compilers based on 3.6.0svn) produces bootstrap comparison failures in the gcc 4.9.2 build on x86_64-apple-darwin14. The same bootstrap comparison failure is also seen on x86_64-apple-darwin13 with Xcode 6.2 but using the llvm.org clang 3.5.1, 3.5.2 or 3.6.0 compilers instead of the Apple Clang 6.0 compilers. Comparing stages 2 and 3 warning: gcc/cc1-checksum.o differs warning: gcc/cc1obj-checksum.o differs warning: gcc/cc1objplus-checksum.o differs warning: gcc/cc1plus-checksum.o differs Bootstrap comparison failure! gcc/asan.o differs gcc/attribs.o differs gcc/bitmap.o differs gcc/c/c-decl.o differs gcc/cfg.o differs gcc/coverage.o differs gcc/cp/class.o differs gcc/cp/semantics.o differs gcc/cp/tree.o differs gcc/dse.o differs gcc/dwarf2out.o differs gcc/except.o differs gcc/fortran/trans-common.o differs gcc/ggc-common.o differs gcc/graphite-clast-to-gimple.o differs gcc/graphite.o differs gcc/ipa-profile.o differs gcc/ira-color.o differs gcc/ira-costs.o differs gcc/java/jcf-io.o differs gcc/loop-unroll.o differs gcc/lto-streamer-in.o differs gcc/lto-streamer-out.o differs gcc/objc/objc-act.o differs gcc/objcp/objcp-act.o differs gcc/passes.o differs gcc/plugin.o differs gcc/postreload-gcse.o differs gcc/statistics.o differs gcc/trans-mem.o differs gcc/tree-cfg.o differs gcc/tree-eh.o differs gcc/tree-ssa-ccp.o differs gcc/tree-ssa-coalesce.o differs gcc/tree-ssa-dom.o differs gcc/tree-ssa-live.o differs gcc/tree-ssa-loop-ivopts.o differs gcc/tree-ssa-phiopt.o differs gcc/tree-ssa-pre.o differs gcc/tree-ssa-reassoc.o differs gcc/tree-ssa-threadupdate.o differs gcc/tree-ssa-uncprop.o differs gcc/tree-vectorizer.o differs gcc/valtrack.o differs gcc/vtable-verify.o differs Makefile:20180: recipe for target 'compare' failed The observation, that the llvm.org clang 3.5.1 or later compilers along side Xcode 6.2 produces the same bootstrap comparison failure, eliminates the cctools changes in Xcode 6.3 as the culprit and points to miscompilation of the stage1 compiler instead. Reducing the optimization of the stage1 bootstrap with STAGE1_CFLAGS="-O0 -g" and STAGE1_CXXFLAGS="-O0 -g" doesn't eliminate the bootstrap comparison failure. Interestingly, current gcc trunk 5.0svn doesn't exhibit the bootstrap comparison failure (with the stock build or using --enable-checking=release).
Gcc bootstraps were all tested with... ../gcc-4.9.2/configure --prefix=/sw --prefix=/sw/lib/gcc4.9 --mandir=/sw/share/man --infodir=/sw/lib/gcc4.9/info --enable-languages=c,c++,fortran,lto,objc,obj-c++,java --with-gmp=/sw --with-libiconv-prefix=/sw --with-isl=/sw --with-cloog=/sw --with-mpc=/sw --with-system-zlib --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --program-suffix=-fsf-4.9 The stock Apple clang 6.0 compilers from Xcode 6.2 don't exhibit the bootstrap comparison failure of course on either x86_64-apple-darwin13 or x86_64-apple-darwin14.
Current gcc-4_9-branch at r221965 suffers the same bootstrap comparison failure on x86_64-apple-darwin14 with Xcode 6.3's Apple Clang 6.1 compilers and on x86_64-apple-darwin13 with Xcode 6.2 and the llvm.org 3.6.0's clang compilers.
As Iain pointed out to me, the gcc configure output under the more recent clang compilers isn't setting BUILD_CONFIG. Oddly gcc trunk also doesn't set BUILD_CONFIG in the configure output under the more recent clang compilers but the bootstrap comparison failure isn't seen. For gcc 4.9 and gcc-4_9-branch, --with-build-config=bootstrap-debug has to be explicitly passed to configure to suppress the bootstrap comparison failures under the more recent clang compilers.
The issue in configure can be seen with... mkdir conftest cd conftest echo "int f (void) { return 0; }" > conftest.c clang-3.6 -c conftest.c mv conftest.o conftest.o.g0 clang-3.6 -c -g conftest.c mv conftest.o conftest.o.g ../gcc-4.9.3-20150410/contrib/compare-debug conftest.o.g0 conftest.o.g ..which unexpectedly produces... conftest.o.g0.stripped conftest.o.g.stripped differ: char 433, line 1 stripping off .eh_frame and LTO sections, then retrying failed to strip off .eh_frame conftest.o.g0.stripped conftest.o.g.stripped differ: char 433, line 1
Created attachment 35295 [details] binary conftest.o.g from clang 3.6.0 compiler The binary conftest.o.g was created on x86_64-apple-darwin13 using the cctools from Xcode 6.2 and the llvm.org 3.6.0 clang compilers with the command... echo "int f (void) { return 0; }" > conftest.c clang-3.6 -c -g conftest.c mv conftest.o conftest.o.g
Created attachment 35296 [details] binary conftest.o.g0 from clang 3.6.0 compiler The binary conftest.o.g was created on x86_64-apple-darwin13 using the cctools from Xcode 6.2 and the llvm.org 3.6.0 clang compilers with the command... echo "int f (void) { return 0; }" > conftest.c clang-3.6 -c conftest.c mv conftest.o conftest.o.g0
Using... ld -S -r -no_uuid conftest.o.g -o conftest.o.g.stripped ld -S -r -no_uuid conftest.o.g0 -o conftest.o.g0.stripped dwarfdump --eh-frame conftest.o.g.stripped > conftest.o.g.stripped.dwarfdump dwarfdump --eh-frame conftest.o.g0.stripped > conftest.o.g0.stripped.dwarfdump for conftest.c compiled with Xcode 6.2 Apple Clang 6.0 on x86_64-apple-darwin13, we get... % diff -u conftest.o.g.stripped.dwarfdump conftest.o.g0.stripped.dwarfdump --- conftest.o.g.stripped.dwarfdump 2015-04-10 21:43:15.000000000 -0400 +++ conftest.o.g0.stripped.dwarfdump 2015-04-10 21:43:04.000000000 -0400 @@ -1,5 +1,5 @@ ---------------------------------------------------------------------- - File: conftest.o.g.stripped (x86_64) + File: conftest.o.g0.stripped (x86_64) ---------------------------------------------------------------------- Exception handling frame information for section __eh_frame but for contest.c compiled with llvm.org 3.6.0's clang on x86_64-apple-darwin13, we get... % diff -u conftest.o.g.stripped.dwarfdump conftest.o.g0.stripped.dwarfdump --- conftest.o.g.stripped.dwarfdump 2015-04-10 21:42:02.000000000 -0400 +++ conftest.o.g0.stripped.dwarfdump 2015-04-10 21:41:52.000000000 -0400 @@ -1,12 +1,12 @@ ---------------------------------------------------------------------- - File: conftest.o.g.stripped (x86_64) + File: conftest.o.g0.stripped (x86_64) ---------------------------------------------------------------------- Exception handling frame information for section __eh_frame 0x00000000: CIE length: 0x00000014 CIE_id: 0xffffffff - version: 0x01 + version: 0x03 augmentation: "zR" code_align: 1 data_align: -8
(In reply to Jack Howarth from comment #7) > % diff -u conftest.o.g.stripped.dwarfdump conftest.o.g0.stripped.dwarfdump > --- conftest.o.g.stripped.dwarfdump 2015-04-10 21:42:02.000000000 -0400 > +++ conftest.o.g0.stripped.dwarfdump 2015-04-10 21:41:52.000000000 -0400 > @@ -1,12 +1,12 @@ > ---------------------------------------------------------------------- > - File: conftest.o.g.stripped (x86_64) > + File: conftest.o.g0.stripped (x86_64) > ---------------------------------------------------------------------- > Exception handling frame information for section __eh_frame > > 0x00000000: CIE > length: 0x00000014 > CIE_id: 0xffffffff > - version: 0x01 > + version: 0x03 Confirmed with TOT clang as of this morning. Please file an llvm BZ and/or a radar against Xcode 6.3.
Same problem with 4.8.5.
> > Confirmed with TOT clang as of this morning. Please file an llvm BZ and/or > a radar against Xcode 6.3. Reported as radar bug /20509942, "Apple Clang 6.1 emits inconsistent eh_frame dwarf versions"
This issue appears to have been introduced by... http://llvm.org/viewvc/llvm-project?view=revision&revision=211272 and seems to have been previously discussed... http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20141208/247970.html
It appears that clang 3.5 and later defaults to setting the CIE version to dwarf2 in the absence of -g. This behavior can't be overridden by passing -gdwarf-3 in the absence of -g. However the gcc configure test failure can be suppressed under clang by appending -gdwarf-2 instead (to downgrade the CIE version to dwarf3 in the presence of -g).