summaryrefslogtreecommitdiffstats
path: root/libcxx/test
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2015-10-14 19:54:03 +0000
committerEric Fiselier <eric@efcs.ca>2015-10-14 19:54:03 +0000
commit8241405ad42a8ce85c2a61baff5f96948f90cfa6 (patch)
treedf7a218ade11902ca0828e7c70d864275347327c /libcxx/test
parent8a5d04396dd5d8bedf61f7e234971b891b4215e7 (diff)
downloadbcm5719-llvm-8241405ad42a8ce85c2a61baff5f96948f90cfa6.tar.gz
bcm5719-llvm-8241405ad42a8ce85c2a61baff5f96948f90cfa6.zip
[libcxx] Make it drastically simpler to link libc++.
Summary: Currently on most platforms you have to manually link the c++ abi library used with libc++ whenever you use libc++. So your typical libc++ command like invocation might look like: ``` clang++ -stdlib=libc++ foo.cpp -lc++abi ``` Having to manually link `libc++abi.so` makes it harder for libc++ to be used generically. This patch fixes that by generating a linker script for `libc++.so` that correctly links the ABI library. On linux the linker script for libc++abi would look like: ``` # libc++.so INPUT(libc++.so.1 -lc++abi) ``` With the linker script you can now use libc++ using only `-stdlib=libc++`. This is the technique that is used on FreeBSD in ordered to link cxxrt and I think it's the best approach to make our users lives simpler. The CMake option used to enable this is `LIBCXX_ENABLE_ABI_LINKER_SCRIPT`. In future I would like to enable this by default on all platforms except for Darwin. Reviewers: mclow.lists, danalbert, rsmith, jroelofs, EricWF Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D12508 llvm-svn: 250319
Diffstat (limited to 'libcxx/test')
-rw-r--r--libcxx/test/CMakeLists.txt5
1 files changed, 3 insertions, 2 deletions
diff --git a/libcxx/test/CMakeLists.txt b/libcxx/test/CMakeLists.txt
index 2e2cf61f111..b67b3b43f83 100644
--- a/libcxx/test/CMakeLists.txt
+++ b/libcxx/test/CMakeLists.txt
@@ -17,10 +17,11 @@ pythonize_bool(LIBCXX_GENERATE_COVERAGE)
pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER)
# The tests shouldn't link to any ABI library when it has been linked into
-# libc++ statically.
-if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
+# libc++ statically or via a linker script.
+if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY OR LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
set(LIBCXX_CXX_ABI_LIBNAME "none")
endif()
+
set(LIBCXX_TARGET_INFO "libcxx.test.target_info.LocalTI" CACHE STRING
"TargetInfo to use when setting up test environment.")
set(LIBCXX_EXECUTOR "None" CACHE STRING
OpenPOWER on IntegriCloud