Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit d3add25

Browse files
committed
Disable indirect symbols via GOT pcrel on Mach-O 64-bit
This commit currently causes LLVM to segfault when compiling Rust code on 64-bit OSX platforms, reported as this LLVM bug: https://llvm.org/bugs/show_bug.cgi?id=23779 A bisection turned up r230264 as the offending commit, the review of which is at http://reviews.llvm.org/D6922. To the best of my knowledge this looks like it's an optimization for OSX which is fine to omit, so this commit just flips the flag to *not* perform this optimization, allowing Rust to bootstrap and pass all tests on OSX 64-bit.
1 parent 8399ec4 commit d3add25

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

lib/CodeGen/TargetLoweringObjectFileImpl.cpp

+19-1
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,25 @@ TargetLoweringObjectFileELF::InitializeELF(bool UseInitArray_) {
437437

438438
TargetLoweringObjectFileMachO::TargetLoweringObjectFileMachO()
439439
: TargetLoweringObjectFile() {
440-
SupportIndirectSymViaGOTPCRel = true;
440+
// WARNING: this is a difference from upstream LLVM!
441+
// -------------------------------------------------
442+
//
443+
// Disable indirect symbols via GOT pcrel on Mach-O 64-bit
444+
//
445+
// If this flag is `true`, then it causes LLVM to segfault when compiling Rust
446+
// code on 64-bit OSX platforms, reported as this LLVM bug:
447+
//
448+
// https://llvm.org/bugs/show_bug.cgi?id=23779
449+
//
450+
// A bisection turned up r230264 as the offending commit, the review of which
451+
// is at http://reviews.llvm.org/D6922. To the best of my knowledge this looks
452+
// like it's an optimization for OSX which is fine to omit, so this commit
453+
// just flips the flag to *not* perform this optimization, allowing Rust to
454+
// bootstrap and pass all tests on OSX 64-bit.
455+
//
456+
// Once that LLVM bug has been fixed, this should be able to be set to `true`
457+
// again.
458+
SupportIndirectSymViaGOTPCRel = false;
441459
}
442460

443461
/// getDepLibFromLinkerOpt - Extract the dependent library name from a linker

0 commit comments

Comments
 (0)