Closed Bug 638149 Opened 9 years ago Closed 9 years ago
Need a way to disable -dead
_strip on OS X
The current OS X linker crashes if using both LTO and -dead_strip, so we need a way to disable -dead_strip.
I'd rather not add more configure options. Can you just detect that you're using LTO and not use dead strip in that case?
Not sure if in a reliable way. There are many ways to enable it. With clang you can use -O4, -flto or -emit-llvm. GCC has -flto and I think -fwhopr. For clang the most reliable is probably to test the type of file the compiler produces, but gcc uses native files with extra sections containing the IL. Should I just ignore newer GCCs on OS X for now? Another option would be adding a test that crashes -dead_strip, but I never managed to get a small enough test to include in a configure. I will also try xcode 4 to see if that linker is fixed. If it is, it might not be worth it to add the option.
Unfortunately the linker in xcode4 still fails :-(
This patch adds a macro for checking for LTO and uses that to disable -dead_stip. It currently only handles LLVM based compilers, but could be extended if anyone is interested in trying gcc.
Attachment #516302 - Attachment is obsolete: true
9 years ago
Attachment #516506 - Flags: review?(ted.mielczarek)
Comment on attachment 516506 [details] [diff] [review] alternative patch Funky, but sounds ok. Can we call it MOZ_LLVM_LTO_ENABLED or something like that? MOZ_CHECK_LLVM_LTO ? Also, is there an existing autoconf macro to get the assembly output from a compile? I guess it's hard to say since we're using such an ancient autoconf...
Attachment #516506 - Flags: review?(ted.mielczarek) → review+
This is avoiding a bug in the linker, so I assume it could also hit gcc's lto. In which case they just have to extend this macro. I can only do copy-and-paste programming with m4, so I don't know if there is an autoconf macro available, but I didn't notice one in the existing configure source code.
Okay. That's fine.
I landed this on cedar <http://hg.mozilla.org/projects/cedar/rev/eb6edf77b7c8> but had to back it out immediately <http://hg.mozilla.org/projects/cedar/rev/224477bd4b3c> because it breaks the builds. http://tinderbox.mozilla.org/showlog.cgi?log=Cedar/1301253927.1301254046.2775.gz
Sorry, the previous patch was missing a change to js/src/aclocal.m4
Attachment #523933 - Flags: review?(ted.mielczarek) → review+
9 years ago
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.2
You need to log in before you can comment on or make changes to this bug.