[llvm-dev] Link statically against libc++ on Cray XC 40

Schlottke-Lakemper, Michael via llvm-dev llvm-dev at lists.llvm.org
Tue Sep 29 23:12:32 PDT 2015


Hi folks,

In our scientific simulation tool, we set up our build system to link against LLVMSupport to print stack traces for debugging purposes, also from other compilers. This works very well on most hosts, but we fail to make it work with gcc on a Cray XC 40 cluster. They have a very restrictive toolchain setup (everything is controlled by the “module” command; you never get to see any real paths or commands but just use “CC” as the compiler and everything is included/linked to automagically).

I already could solve some of the problems but now I am stuck at the linking stage. Specifically, their CC tool tries to link everything statically, but since we built LLVM using libc++, we also need to link against libc++, which fails with the error

/usr/bin/ld: attempted static link of dynamic object `/zhome/academic/HLRS/xac/xacmicha/.pool/llvm/cur/lib/libc++.so’

Does anyone have a suggestion what I can do to make this work (link)?

Regards,

Michael

P.S.: This is the full linker command minus some (many) object files and -Wl,-rpath,library/paths:

/opt/cray/craype/2.4.1/bin/CC   -O0 -g3 -fno-inline -std=c++11 -pedantic  -fdiagnostics-color=auto    -L/zhome/academic/HLRS/xac/xacmicha/.pool/llvm/cur/lib <many_object_files_go_here> CMakeFiles/zfs.dir/main.cpp.o  -o zfs -rdynamic /zhome/academic/HLRS/xac/xacmicha/.pool/llvm/cur/lib/libLLVMSupport.a -ldl -lpthread /zhome/academic/HLRS/xac/xacmicha/.pool/llvm/cur/lib/libc++.so /zhome/academic/HLRS/xac/xacmicha/.pool/llvm/cur/lib/libc++abi.a


--
Michael Schlottke-Lakemper

Chair of Fluid Mechanics and Institute of Aerodynamics
RWTH Aachen University
Wüllnerstraße 5a
52062 Aachen
Germany

Phone: +49 (241) 80 95188
Fax: +49 (241) 80 92257
Mail: m.schlottke-lakemper at aia.rwth-aachen.de<mailto:m.schlottke-lakemper at aia.rwth-aachen.de>
Web: http://www.aia.rwth-aachen.de

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150930/ad927679/attachment.html>


More information about the llvm-dev mailing list