[libc++][patch] Sort out common Linux linking issues.
Sebastian Redl
sebastian.redl at getdesigned.at
Tue Apr 1 10:37:06 PDT 2014
Following the recent inquiry and David Chisnall's advice, I have created
a patch that makes libc++ work a lot smoother on Linux. It allows a
plain "clang++ -stdlib=libc++" command line to work no matter what ABI
library is used, and fixes the linking errors I encountered.
However, I have absolutely no idea what it does on other platforms.
Log Message:
Sort out common Linux linking issues.
Using libc++ on Linux was problematic because using libsupc++ didn't
pull in
all necessary symbols, whereas linking against a dynamic ABI library
required
the user to explicitly link against the ABI library.
This patch adds a new property, LIBCXX_CXX_ABI_LINK, that can be set
to dynamic
(the default) or static. In dynamic mode, it links against the
dynamic library,
and substitutes its unversioned .so file with a linker script that links
against both libc++ and the ABI library. In static mode, it uses
--whole-archive
to force inclusion of the entire ABI library into the libc++.so.
It also automatically uses libstdc++ for dynamic mode and libsupc++
for static
mode if either was selected; the two ABI names are now synonyms.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linux.patch
Type: text/x-diff
Size: 11057 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140401/fbcefc16/attachment.patch>
More information about the cfe-commits
mailing list