Mac OS X: Linking to llvm modifies behaviour of abort()
| Bugzilla Link | 3570 |
| Resolution | WORKSFORME |
| Resolved on | Sep 03, 2009 20:56 |
| Version | trunk |
| OS | MacOS X |
| Reporter | LLVM Bugzilla Contributor |
| CC | @asl,@echristo |
Extended Description
The following behavior applies to Mac OS X 10.5.6 with latest updates.
Consider program abort.cpp:
#include <stdlib.h>
int main(const int argc, char **argv) { abort(); return 0; }
Compile it normally and run:
g++ crash.cpp && ./a.out
Produces the expected crash behaviour.
Now do the same thing, while linking to llvm:
g++ crash.cpp llvm-config --ldflags llvm-config --libs && ./a.out
As you can see the abort() behaviour is modified. Before aborting, the process hangs for about a minute. Finally, (if you have crash reporting enabled for non-GUI processes), the crash reporter window pops up, but instead of having the stack trace of my program as expected (and as the case before), it instead reports that the "application ReportCrash quit unexpectedly".
Linking to llvm libraries should not have such a side-effect on the behaviour of abort().
I can't reproduce this with either of my machines (both 10.6.0). Can anyone cc'd still reproduce? Pull it out of worksforme if so, Thanks!
I've determined that if I remove LLVMCellSPUCodeGen.o from the linker flags, the problem goes away. Something in that object file is the cause of the problem. This is on X86, by the way.
I have no idea why this would be. Can you track it down to one library that causes this?