summaryrefslogtreecommitdiffstats
path: root/libcxx/utils
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2019-02-05 19:50:47 +0000
committerPetr Hosek <phosek@chromium.org>2019-02-05 19:50:47 +0000
commit97bc08ae02bf4b490abbe27ecb0ee6250892e1e2 (patch)
treee8af37a17da79e58e863924dc59027143ff577fe /libcxx/utils
parente2c5847414692024bf955de68e72f74fc1ea391e (diff)
downloadbcm5719-llvm-97bc08ae02bf4b490abbe27ecb0ee6250892e1e2.tar.gz
bcm5719-llvm-97bc08ae02bf4b490abbe27ecb0ee6250892e1e2.zip
[CMake] Support compiler-rt builtins library in tests
We're building tests with -nostdlib which means that we need to explicitly include the builtins library. When using libgcc (default) we can simply include -lgcc_s on the link line, but when using compiler-rt builtins we need a complete path to the builtins library. This path is already available in CMake as <PROJECT>_BUILTINS_LIBRARY, so we just need to pass that path to lit and if config.compiler_rt is true, link it to the test. Prior to this patch, running tests when compiler-rt is being used as the builtins library was broken as all tests would fail to link, but with this change running tests when compiler-rt bultins library is being used should be supported. Differential Revision: https://reviews.llvm.org/D56701 llvm-svn: 353208
Diffstat (limited to 'libcxx/utils')
-rw-r--r--libcxx/utils/libcxx/test/target_info.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/libcxx/utils/libcxx/test/target_info.py b/libcxx/utils/libcxx/test/target_info.py
index fb450805f27..2ea24d62ebc 100644
--- a/libcxx/utils/libcxx/test/target_info.py
+++ b/libcxx/utils/libcxx/test/target_info.py
@@ -251,8 +251,10 @@ class LinuxLocalTI(DefaultTargetInfo):
flags += ['-lunwind', '-ldl']
else:
flags += ['-lgcc_s']
- compiler_rt = self.full_config.get_lit_bool('compiler_rt', False)
- if not compiler_rt:
+ builtins_lib = self.full_config.get_lit_conf('builtins_library')
+ if builtins_lib:
+ flags += [builtins_lib]
+ else:
flags += ['-lgcc']
use_libatomic = self.full_config.get_lit_bool('use_libatomic', False)
if use_libatomic:
OpenPOWER on IntegriCloud