[cfe-dev] -static-libstdc++ & libc++abi

Eric Fiselier via cfe-dev cfe-dev at lists.llvm.org
Thu Nov 17 20:00:27 PST 2016


On Thu, Nov 17, 2016 at 5:20 PM, Mike Aizatsky via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hello!
>
> I've recently encountered a bug (https://llvm.org/bugs/show_
> bug.cgi?id=30919) and I would like an advice on how to approach it.
>
> It seems that right now libc++abi is not handled by Tools.cpp. Normal
> linking works  because:
>
> $ cat ~/out/llvm/default/lib/libc++.so
> INPUT(libc++.so.1 -lc++abi)
>
> And if I use -static-libstdc++ then c++abi is not automatically linked in
> at all.
>
> Is there a similar magic for .a files like for .so? Should Tools.cpp know
> about lc++abi? Are there any alternatives?
>

First, Tools.cpp shouldn't know about libc++abi/libsupc++/libcxxrt or w/e
C++ ABI library your STL is using.

There are two alternatives to your problem.  If you want to use a static
libc++abi you can build libc++ with LIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON
<http://libcxx.llvm.org/docs/BuildingLibcxx.html#cmdoption-arg-LIBCXX_ENABLE_STATIC_ABI_LIBRARY>
.
Alternatively you can define libc++.a as a linker script just like
libc++.so. (Ex INPUT(libc++static.a -lc++abi))

/Eric


>
>
> --
> Mike
> Sent from phone
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20161117/5cdfe396/attachment.html>


More information about the cfe-dev mailing list