Skip to content

[3.0] Non-determinism in self-host on x86-32 linux #11572

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
llvmbot opened this issue Oct 21, 2011 · 28 comments
Closed

[3.0] Non-determinism in self-host on x86-32 linux #11572

llvmbot opened this issue Oct 21, 2011 · 28 comments
Labels
bugzilla Issues migrated from bugzilla build-problem obsolete Issues with old (unsupported) versions of LLVM

Comments

@llvmbot
Copy link
Member

llvmbot commented Oct 21, 2011

Bugzilla Link 11200
Version unspecified
OS Linux
Reporter LLVM Bugzilla Contributor
CC @stoklund

Extended Description

Using the script utils/release/test-release.sh to do a Release clang self-host,
on 64 bit linux I see the following:

Comparing Phase 2 and Phase 3 files

file CommandLine.o differs between phase 2 and phase 3
file Path.o differs between phase 2 and phase 3

This is normal: these two files have the path and or date embedded in them
(that should be fixed if possible, but that's another story).

However on 32 bit linux I see:

Comparing Phase 2 and Phase 3 files

file SparseBitVectorTest.o differs between phase 2 and phase 3
file CXType.o differs between phase 2 and phase 3
file LiveVariables.o differs between phase 2 and phase 3
file PrintfFormatString.o differs between phase 2 and phase 3
file FormatString.o differs between phase 2 and phase 3
file CGDebugInfo.o differs between phase 2 and phase 3
file Lexer.o differs between phase 2 and phase 3
file ExprConstant.o differs between phase 2 and phase 3
file ASTContext.o differs between phase 2 and phase 3
file Expr.o differs between phase 2 and phase 3
file SemaChecking.o differs between phase 2 and phase 3
file SemaExprMember.o differs between phase 2 and phase 3
file SemaType.o differs between phase 2 and phase 3
file ParseDecl.o differs between phase 2 and phase 3
file ParseExprCXX.o differs between phase 2 and phase 3
file ParseStmt.o differs between phase 2 and phase 3
file ClangAttrEmitter.o differs between phase 2 and phase 3
file ClangDiagnosticsEmitter.o differs between phase 2 and phase 3
file MSP430InstrInfo.o differs between phase 2 and phase 3
file TargetData.o differs between phase 2 and phase 3
file AlphaISelDAGToDAG.o differs between phase 2 and phase 3
file X86ISelLowering.o differs between phase 2 and phase 3
file X86FloatingPoint.o differs between phase 2 and phase 3
file X86CodeEmitter.o differs between phase 2 and phase 3
file X86InstrInfo.o differs between phase 2 and phase 3
file X86FastISel.o differs between phase 2 and phase 3
file X86DisassemblerDecoder.o differs between phase 2 and phase 3
file X86AsmParser.o differs between phase 2 and phase 3
file X86AsmBackend.o differs between phase 2 and phase 3
file X86MCCodeEmitter.o differs between phase 2 and phase 3
file BlackfinISelLowering.o differs between phase 2 and phase 3
file BlackfinRegisterInfo.o differs between phase 2 and phase 3
file CBackend.o differs between phase 2 and phase 3
file ARMCodeEmitter.o differs between phase 2 and phase 3
file ARMFastISel.o differs between phase 2 and phase 3
file ARMBaseInstrInfo.o differs between phase 2 and phase 3
file ARMExpandPseudoInsts.o differs between phase 2 and phase 3
file ARMDisassembler.o differs between phase 2 and phase 3
file ARMInstPrinter.o differs between phase 2 and phase 3
file ARMAsmParser.o differs between phase 2 and phase 3
file SystemZISelLowering.o differs between phase 2 and phase 3

file SPUISelDAGToDAG.o differs between phase 2 and phase 3
file SPUISelLowering.o differs between phase 2 and phase 3
file MBlazeDisassembler.o differs between phase 2 and phase 3
file MBlazeAsmParser.o differs between phase 2 and phase 3
file Lint.o differs between phase 2 and phase 3
file ConstantFolding.o differs between phase 2 and phase 3
file LiveVariables.o differs between phase 2 and phase 3
file LiveIntervalAnalysis.o differs between phase 2 and phase 3
file ShrinkWrapping.o differs between phase 2 and phase 3
file PHIElimination.o differs between phase 2 and phase 3
file MachineVerifier.o differs between phase 2 and phase 3
file AsmPrinterDwarf.o differs between phase 2 and phase 3
file DwarfException.o differs between phase 2 and phase 3
file DAGCombiner.o differs between phase 2 and phase 3
file SelectionDAGBuilder.o differs between phase 2 and phase 3
file JITDwarfEmitter.o differs between phase 2 and phase 3
file SimplifyCFG.o differs between phase 2 and phase 3
file AsmLexer.o differs between phase 2 and phase 3
file Function.o differs between phase 2 and phase 3
file ConstantFold.o differs between phase 2 and phase 3
file AsmWriter.o differs between phase 2 and phase 3
file Module.o differs between phase 2 and phase 3
file Instructions.o differs between phase 2 and phase 3
file regexec.o differs between phase 2 and phase 3
file APInt.o differs between phase 2 and phase 3
file CommandLine.o differs between phase 2 and phase 3
file Path.o differs between phase 2 and phase 3
file SubtargetEmitter.o differs between phase 2 and phase 3

@llvmbot
Copy link
Member Author

llvmbot commented Oct 23, 2011

The CommandLine.o and Path.o will be ignored, similar to how gcc ignores some harmless diffs in their .o files.

The Linux ones are a bit more worrisome. Can you generate the .s files for one of those? If it's something like different debugging information, we can ignore it (and maybe get the tests to ignore it as well...).

@llvmbot
Copy link
Member Author

llvmbot commented Oct 24, 2011

It seems to be real. Here are the differences between SparseBitVectorTest
in phases 2 and 3:

2448c2448
< movl 40(%esp), %ebp

movl 40(%esp), %edx
2450c2450
< cmpl %ebp, %ecx


cmpl %edx, %ecx
2453c2453,2454
< cmpl %ebp, %ecx


cmpl %edx, %ecx
movl %edx, %ecx
2459a2461
movl %ecx, %ebp
2475a2478
movl %ebp, %ecx
2478c2481
< cmpl %ebp, 8(%edi)


cmpl %ecx, 8(%edi)
2487a2491
movl %ecx, %ebp
2527c2531,2532
< cmpl %ebp, 8(%edi)


movl %ebp, %ecx
cmpl %ecx, 8(%edi)

@llvmbot
Copy link
Member Author

llvmbot commented Oct 24, 2011

@llvmbot
Copy link
Member Author

llvmbot commented Oct 24, 2011

@llvmbot
Copy link
Member Author

llvmbot commented Oct 24, 2011

It seems to be real. Here are the differences between SparseBitVectorTest
in phases 2 and 3:

Oh my...this is bad. Looks like non-determinism has snuck in.

@llvmbot
Copy link
Member Author

llvmbot commented Oct 25, 2011

@llvmbot
Copy link
Member Author

llvmbot commented Oct 25, 2011

@llvmbot
Copy link
Member Author

llvmbot commented Oct 25, 2011

This is looking worse and worse. I tried having the clang build in phase1
compile AsmPrinterDwarf.cpp (the smallest file showing non-determinism)
in a loop, checking to see if the output changes. It never did. However
running clang from phase2 produces different output to the phase1 clang.
On the other hand, running phase2 clang in a loop always results in the same
output (different to phase1, but the same on every run), and phase3 clang always
produces the same output as phase2 clang. I'm not sure what to deduce from
this...

@stoklund
Copy link
Mannequin

stoklund mannequin commented Oct 25, 2011

I can reproduce this with a Release+Asserts build, compiling Function.o. There is a difference in the machine code coming out of isel in the function _ZNK4llvm8Function14getIntrinsicIDEv:

There is an extra jump table (jt4), and some virtual register numbers are off by two:

@@ -84733,12 +84733,12 @@ define i32 @​_ZNK4llvm8Function14getIntri
Frame Objects:
fi#-1: size=4, align=16, fixed, at location [SP+4]
Jump Tables:

  • jt#0: BB#10 BB#332 BB#334 BB#363 BB#372 BB#461 BB#472 BB#4940 BB#492 BB#4940 BB#4940 BB#505 BB#524 BB#4940 BB#529 BB#531 BB#4940 BB#1419 BB#1428 BB#1841 BB#1845 BB#1849 BB#4940 BB#1866 jt#1: BB#1927 BB#4940 BB#4940 BB#1931 BB#1957 BB#2016 BB#2043 BB#2058 BB#2233 BB#2557 BB#3018 BB#3446 BB#3853 BB#4028 BB#4239 BB#4543 BB#4666 BB#4771 BB#4808 BB#4881 BB#4903 BB#4940 BB#4925 jt#2: BB#4075 BB#4097 BB#4940 BB#4940 BB#4130 BB#4940 BB#4134 BB#4940 BB#4940 BB#4940 BB#4156 jt#3: BB#3585 BB#4940 BB#4940 BB#4940 BB#3643 BB#3734 BB#3742 jt#4: BB#3505 BB#3509 BB#4940 BB#4940 BB#3542 BB#4940 BB#3557 BB#4940 BB#4940 BB#4940 BB#3561 jt#5: BB#2737 BB#4940 BB#4940 BB#4940 BB#2790 BB#2918 BB#2947 jt#6: BB#2464 BB#2468 BB#4940 BB#4940 BB#2505 BB#4940 BB#4940 BB#2546 jt#7: BB#1850 BB#1854 BB#1858 BB#4940 BB#4940 BB#4940 BB#4940 BB#4940 BB#1862 jt#8: BB#1439 BB#4940 BB#1443 BB#1447 BB#1481 BB#1556 BB#1666 BB#1778 BB#1814 jt#9: BB#1673 BB#4940 BB#1686 BB#1722 BB#4940 BB#1730 jt#10: BB#1624 BB#1635 BB#1639 BB#4940 BB#4940 BB#4940 BB#1651 BB#4940 BB#4940 BB#4940 BB#4940 BB#1662 jt#11: BB#1563 BB#4940 BB#1577 BB#1600 BB#4940 BB#1608 jt#12: BB#1491 BB#1500 BB#1504 BB#1514 BB#4940 BB#1522 BB#4940 BB#4940 BB#4940 BB#4940 BB#4940 BB#4940 BB#1529 BB#1533 BB#1537 BB#4940 BB#4940 BB#4940 BB#1544 BB#4940 BB#4940 BB#4940 BB#4940 BB#1552 jt#13: BB#1457 BB#1461 BB#1464 BB#4940 BB#4940 BB#1467 jt#14: BB#538 BB#566 BB#579 BB#4940 BB#583 BB#604 BB#608 BB#633 BB#686 BB#770 BB#861 BB#984 BB#1175 BB#1306 BB#1332 jt#15: BB#1030 BB#1034 BB#4940 BB#4940 BB#1069 BB#4940 BB#4940 BB#1107 BB#4940 BB#1148 jt#16: BB#4941 BB#858 BB#859 BB#860 jt#17: BB#4941 BB#763 BB#764 BB#765 jt#18: BB#4941 BB#679 BB#680 BB#681 jt#19: BB#4941 BB#630 BB#631 BB#632 jt#20: BB#4941 BB#601 BB#602 BB#603 jt#21: BB#379 BB#4940 BB#383 BB#387 BB#406 BB#430 BB#445 BB#449 BB#4940 BB#4940 BB#4940 BB#4940 BB#4940 BB#453 BB#457 jt#22: BB#166 BB#186 BB#230 BB#234 BB#249 BB#4940 BB#253 BB#268 BB#287 BB#4940 BB#302 BB#306 jt#23: BB#4941 BB#284 BB#285 BB#286 jt#24: BB#4941 BB#278 BB#279 BB#280 jt#25: BB#197 BB#4940 BB#4940 BB#4940 BB#211 BB#4940 BB#222 BB#4940 BB#226
  • jt#0: BB#10 BB#332 BB#334 BB#363 BB#372 BB#461 BB#472 BB#4940 BB#492 BB#4940 BB#4940 BB#505 BB#524 BB#4940 BB#529 BB#531 BB#4940 BB#1419 BB#1428 BB#1841 BB#1845 BB#1849 BB#4940 BB#1866 jt#1: BB#1927 BB#4940 BB#4940 BB#1931 BB#1957 BB#2016 BB#2043 BB#2058 BB#2233 BB#2557 BB#3018 BB#3446 BB#3853 BB#4028 BB#4239 BB#4543 BB#4666 BB#4771 BB#4808 BB#4881 BB#4903 BB#4940 BB#4925 jt#2: BB#4075 BB#4097 BB#4940 BB#4940 BB#4130 BB#4940 BB#4134 BB#4940 BB#4940 BB#4940 BB#4156 jt#3: BB#3585 BB#4940 BB#4940 BB#4940 BB#3643 BB#3734 BB#3742 jt#4: BB#3757 BB#4940 BB#4940 BB#4940 BB#3761 BB#4940 BB#4940 BB#3765 BB#4940 BB#3823 jt#5: BB#3505 BB#3509 BB#4940 BB#4940 BB#3542 BB#4940 BB#3557 BB#4940 BB#4940 BB#4940 BB#3561 jt#6: BB#2737 BB#4940 BB#4940 BB#4940 BB#2790 BB#2918 BB#2947 jt#7: BB#2464 BB#2468 BB#4940 BB#4940 BB#2505 BB#4940 BB#4940 BB#2546 jt#8: BB#1850 BB#1854 BB#1858 BB#4940 BB#4940 BB#4940 BB#4940 BB#4940 BB#1862 jt#9: BB#1439 BB#4940 BB#1443 BB#1447 BB#1481 BB#1556 BB#1666 BB#1778 BB#1814 jt#10: BB#1673 BB#4940 BB#1686 BB#1722 BB#4940 BB#1730 jt#11: BB#1624 BB#1635 BB#1639 BB#4940 BB#4940 BB#4940 BB#1651 BB#4940 BB#4940 BB#4940 BB#4940 BB#1662 jt#12: BB#1563 BB#4940 BB#1577 BB#1600 BB#4940 BB#1608 jt#13: BB#1491 BB#1500 BB#1504 BB#1514 BB#4940 BB#1522 BB#4940 BB#4940 BB#4940 BB#4940 BB#4940 BB#4940 BB#1529 BB#1533 BB#1537 BB#4940 BB#4940 BB#4940 BB#1544 BB#4940 BB#4940 BB#4940 BB#4940 BB#1552 jt#14: BB#1457 BB#1461 BB#1464 BB#4940 BB#4940 BB#1467 jt#15: BB#538 BB#566 BB#579 BB#4940 BB#583 BB#604 BB#608 BB#633 BB#686 BB#770 BB#861 BB#984 BB#1175 BB#1306 BB#1332 jt#16: BB#1030 BB#1034 BB#4940 BB#4940 BB#1069 BB#4940 BB#4940 BB#1107 BB#4940 BB#1148 jt#17: BB#4941 BB#858 BB#859 BB#860 jt#18: BB#4941 BB#763 BB#764 BB#765 jt#19: BB#4941 BB#679 BB#680 BB#681 jt#20: BB#4941 BB#630 BB#631 BB#632 jt#21: BB#4941 BB#601 BB#602 BB#603 jt#22: BB#379 BB#4940 BB#383 BB#387 BB#406 BB#430 BB#445 BB#449 BB#4940 BB#4940 BB#4940 BB#4940 BB#4940 BB#453 BB#457 jt#23: BB#166 BB#186 BB#230 BB#234 BB#249 BB#4940 BB#253 BB#268 BB#287 BB#4940 BB#302 BB#306 jt#24: BB#4941 BB#284 BB#285 BB#286 jt#25: BB#4941 BB#278 BB#279 BB#280 jt#26: BB#197 BB#4940 BB#4940 BB#4940 BB#211 BB#4940 BB#222 BB#4940 BB#226
    Function Live Outs: %EAX

BB#0: derived from LLVM BB %entry

  •   %vreg12116<def> = MOVPC32r 0, %ESP<imp-use>; GR32:%vreg12116
    
  •   %vreg1215<def> = ADD32ri %vreg12116, <es:_GLOBAL_OFFSET_TABLE_>[TF=1], %EFLAGS<imp-def>; GR32:%vreg1215,%vreg12116
    
  •   %vreg12118<def> = MOVPC32r 0, %ESP<imp-use>; GR32:%vreg12118
    
  •   %vreg1215<def> = ADD32ri %vreg12118, <es:_GLOBAL_OFFSET_TABLE_>[TF=1], %EFLAGS<imp-def>; GR32:%vreg1215,%vreg12118
      %vreg1208<def> = MOV32rm <fi#-1>, 1, %noreg, 0, %noreg; mem:LD4[FixedStack-1](align=16) GR32:%vreg1208
      %vreg0<def> = MOV32rm %vreg1208<kill>, 1, %noreg, 16, %noreg; mem:LD4[%Name.i](tbaa=!"any pointer") GR32:%vreg0,%vreg1208
      %vreg1207<def> = MOV32r0 %EFLAGS<imp-def,dead>; GR32:%vreg1207
    

Later on some BB numbers are also switched.

-BB#6266: derived from LLVM BB %_ZNK4llvm9StringRefixEj.exit9479
+BB#6263: derived from LLVM BB %_ZNK4llvm9StringRefixEj.exit9479
Predecessors according to CFG: BB#205

  •   CMP32ri8 %vreg12062, 114, %EFLAGS<imp-def>; GR32:%vreg12062
    
  •   CMP32ri8 %vreg12064, 114, %EFLAGS<imp-def>; GR32:%vreg12064
      JNE_4 <BB#4940>, %EFLAGS<imp-use>
      JMP_4 <BB#206>
    
    Successors according to CFG: BB#206 BB#4940

The IR printed by -print-isel-output is identical, although that printout doesn't include use-list orders.

This is probably not a problem with the clang frontend, my guess is the selectiondag switch lowering.

@stoklund
Copy link
Mannequin

stoklund mannequin commented Oct 25, 2011

Duncan, can you tell if this is a proper nondeterminism issue (i.e., the same compiler is producing different results in different runs), or if it is simply the phase 1 and 2 compilers producing different, but consistent output?

I suspect that this is related to floating point code in switch lowering. Would gcc build the phase1 compiler with x87 floats while clang builds phase2 with SSE floats?

@stoklund
Copy link
Mannequin

stoklund mannequin commented Oct 26, 2011

Enabling debug output from SelectionDAGBuilder.cpp, I get:

@@ -52719,32 +52719,10 @@
LEnd: 112, RBegin: 114
LDensity: 2.666667e-01, RDensity: 1.000000e+00
Metric: 1.266667e+00
-Selecting best pivot:
-First: 105, Last: 114
-LSize: 1, RSize: 3
-=>Step
-LEnd: 105, RBegin: 109
-LDensity: 1.000000e+00, RDensity: 5.000000e-01
-Metric: 3.000000e+00
-Current metric set to: 3.000000e+00
-=>Step
-LEnd: 109, RBegin: 112
-LDensity: 4.000000e-01, RDensity: 6.666667e-01
-Metric: 2.133333e+00
-=>Step
-LEnd: 112, RBegin: 114
-LDensity: 3.750000e-01, RDensity: 1.000000e+00
-Metric: 1.375000e+00
-Total number of unique destinations: 3
-Total number of comparisons: 3
-Compare range: 5
-Low bound: 109
-High bound: 114
-Total number of unique destinations: 1
-Total number of comparisons: 1
-Compare range: 0
-Low bound: 105
-High bound: 105
+Lowering jump table
+First entry: 105. Last entry: 114
+Range: 10. Size: 4. Density: 4.000000e-01
+
Total number of unique destinations: 1
Total number of comparisons: 1
Compare range: 0

Which translates to this code in handleJTSwitchCase() making different decisions:

APInt Range = ComputeRange(First, Last);
double Density = TSize.roundToDouble() / Range.roundToDouble();
if (Density < 0.4)
return false;

DEBUG(dbgs() << "Lowering jump table\n"
<< "First entry: " << First << ". Last entry: " << Last << '\n'
<< "Range: " << Range
<< ". Size: " << TSize << ". Density: " << Density << "\n\n");

This is definitely caused by gcc using x87 instructions while clang defaults to SSE.

@llvmbot
Copy link
Member Author

llvmbot commented Oct 26, 2011

Is it possible to use APFloat instead of roundToDouble(), or would that result in the same thing?

@stoklund
Copy link
Mannequin

stoklund mannequin commented Oct 26, 2011

This particular test is pretty simple to do in pure integers, so that's what I'll do.

@stoklund
Copy link
Mannequin

stoklund mannequin commented Oct 26, 2011

Fixed in r143006. Duncan, please verify. Bill, please merge.

@llvmbot
Copy link
Member Author

llvmbot commented Oct 26, 2011

Fixed in r143006. Duncan, please verify. Bill, please merge.

Merged in. Thanks!

@llvmbot
Copy link
Member Author

llvmbot commented Oct 26, 2011

With a release build, the phase1 and phase2 compilers each seems
deterministic. They produce different, but consistent, output.
In reply to comment 10.

@llvmbot
Copy link
Member Author

llvmbot commented Oct 26, 2011

I will reopen after the next round of release testing if this is still an issue.

@llvmbot
Copy link
Member Author

llvmbot commented Oct 26, 2011

With a release build, the phase1 and phase2 compilers each seems
deterministic. They produce different, but consistent, output.
In reply to comment 10.

I would expect Phase 1 and Phase 2 to have different .o files. Phase 2 and Phase 3 should have identical .o files, though. (That is .o files for the compiler itself. If the Phase 1 and Phase 2 compilers are generating different code for the same program, then that doesn't sound good.)

@llvmbot
Copy link
Member Author

llvmbot commented Oct 26, 2011

Phase1 and phase2 were generating different .o files. Hopefully Jakob fixed
this - we will see.

@stoklund
Copy link
Mannequin

stoklund mannequin commented Oct 26, 2011

I would expect Phase 1 and Phase 2 to have different .o files. Phase 2 and
Phase 3 should have identical .o files, though. (That is .o files for the
compiler itself. If the Phase 1 and Phase 2 compilers are generating
different code for the same program, then that doesn't sound good.)

The problem is gcc and clang have different defaults for floating point code generation on i386-linux.

The Phase1 compiler is built by gcc using x87 floating point instructions (80-bit precision). It thinks that 4.0/10 < 0.4.

The Phase2 compiler is built by clang using SSE floating point instructions (64-bit). It thinks that 4.0/10 >= 0.4.

This difference means that the Phase1 and Phase2 compilers disagree about when to create a jump table when building the Phase2 and Phase3 compilers.

A fourth phase would be identical to Phase3.

@llvmbot
Copy link
Member Author

llvmbot commented Nov 3, 2011

Exactly the same problem occurs in rc2.

@llvmbot
Copy link
Member Author

llvmbot commented Nov 3, 2011

grepping for double in lib/CodeGen shows that there are a still a bunch of
floating point computations out there.

@llvmbot
Copy link
Member Author

llvmbot commented Nov 4, 2011

While this should be fixed, I don't think it can be considered release critical:
the built compilers are deterministic, it's just that small details of their
output depends on whether they were built with gcc or LLVM.

@llvmbot
Copy link
Member Author

llvmbot commented Nov 4, 2011

While this should be fixed, I don't think it can be considered release
critical:
the built compilers are deterministic, it's just that small details of their
output depends on whether they were built with gcc or LLVM.

Do the compare differences go away if we pass -msee to gcc when building stage1? If not, do they go away if we do a 4 stage bootstrap?

@llvmbot
Copy link
Member Author

llvmbot commented May 23, 2014

log of 4-stage bootstrap on x86_64-darwin11
Hi, this is a recent log of my fink build of release 3.4.1 on x86_64-darwin11, where I also see stage 2 vs. 3 differing (many generated .inc files differ), but 3 vs. 4 converges.

Search for the string "Comparing objects from stage" in the log.
You'll see a 2 vs. 3, and a 3 vs. 4 section.

On objects that differ, I try to examine the disassembly, strings dumps, and resolve away differences in file/path names.

I have not been able to figure out why the TG-generated .inc files differ in 2 vs. 3.

Let me know if I can tar up any files for examination.

@llvmbot
Copy link
Member Author

llvmbot commented May 24, 2014

These random failures in the stage2/stage3 comparison for the llvm 3.4.1 bootstrap (as currently built in fink for llvm34-3.4.1-0a) appear to be a side-effect of the implicit use of -stdlib=libstdc++ in stage1 on 10.7/10.8 and -stdlib=libc++ in stage2 and stage3 (as those compilers are built against the libc++ from the matching llvm release). I have never seen a stage4 occur in that llvm34 bootstrap on 10.9 which defaults to -stdlib=libc++ in stage1. Explicitly setting -DCMAKE_CXX_FLAGS="-fno-common -std=c++11 -stdlib=libc++" in stage1 on 10.7 with Xcode 4.6.3 and 10.8 with Xcode 5.1.1 eliminates the occurrences of the stage2/stage3 comparison failure and the stage3 bootstrap always succeeds. Since the system libc++ support in 10.7/10.8 is (currently) sufficient to bootstrap llvm 3.5svn with its new requirement for a c++ shared library that supports c++-11, the use of -std=c++11 -stdlib=libc++ for the stage1 bootstrap appears to be the solution going forward.

It would be nice if Apple could update the system libc++ on 10.8 to a newer compatibility version matching the llvm svn release used in Xcode 5.1.1.

@llvmbot
Copy link
Member Author

llvmbot commented May 30, 2014

Concerning the 3 or 4-stage bootstrap on darwin11+:
What someone should investigate is how the choice of c++ library in building stage 1 with the host/system compiler influences the output of TableGen built in stage 2. One would expect that differences between stage 1 should get resolved away by stage 2.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
@arsenm
Copy link
Contributor

arsenm commented Aug 13, 2023

Old build issue

@arsenm arsenm closed this as not planned Won't fix, can't repro, duplicate, stale Aug 13, 2023
@EugeneZelenko EugeneZelenko added build-problem obsolete Issues with old (unsupported) versions of LLVM labels Aug 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla build-problem obsolete Issues with old (unsupported) versions of LLVM
Projects
None yet
Development

No branches or pull requests

3 participants