[cfe-dev] Crash in Clang 3.3

Tim Northover t.p.northover at gmail.com
Wed Sep 25 04:03:34 PDT 2013


Hi fil,

Most of the activity here happens via the mailing lists rather than
that "nabble.com", and your error message in particular hasn't shown
up here:

fil$ clang++-3.3 -stdlib=libc++ -lboost_iostreams -lboost_date_time
-lboost_system -lboost_filesystem -g -O0 Col.o Decimal.o Dim.o NTime.o
Stream.o String.o main.o ops.o tick.o -o stat -v

clang version 3.3 (tags/RELEASE_33/final)
Target: x86_64-apple-darwin12.5.0
Thread model: posix
 "/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min
10.8.0 -o stat -lboost_iostreams -lboost_date_time -lboost_system
-lboost_filesystem Col.o Decimal.o Dim.o NTime.o Stream.o String.o
main.o ops.o tick.o -lc++ -lSystem
/usr/local/Cellar/llvm33/3.3/lib/llvm-3.3/bin/../lib/clang/3.3/lib/darwin/libclang_rt.osx.a
Stack dump:
0. Running pass 'Function Pass Manager' on module 'ld-temp.o'.
1. Running pass 'X86 AT&T-Style Assembly Printer' on function '@_GLOBAL__I_a'
clang: error: unable to execute command: Segmentation fault: 11
clang: error: linker command failed due to signal (use -v to see invocation)

On 25 September 2013 01:14, fil <fil at pobox.com> wrote:
> One thing I just noticed: I was using -emit-llvm to compile the .cpp code,
> removing that causes it to compile OK. However, compiling with -emit-llvm
> under Apple LLVM 3.3 still works OK.

The error comes from ld, and indicates that LTO is being tried. That
fits with you passing -emit-llvm. It also means you're trying to do
the actual compilation of some LLVM IR produced by Clang 3.4trunk
using the backends and so on (libLTO.dylib) from Apple's Clang 3.3
branch. That's not going to end well.

One (unsupported, I believe) option is to point ld at a libLTO that
was built alongside your clang by setting the environment variable
DYLD_LIBRARY_PATH=/path/where/libLTO/lives.

Cheers.

Tim.



More information about the cfe-dev mailing list