From 49abdbcca357ec3151088f7ee9b50358801c1e0c Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Thu, 1 Oct 2015 06:15:26 +0000 Subject: [PATCH] Dont link -lrt in the testsuite on linux unless using sanitizers. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@248986 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/libcxx/test/config.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/libcxx/test/config.py b/test/libcxx/test/config.py index f66b831fc..f8f336d59 100644 --- a/test/libcxx/test/config.py +++ b/test/libcxx/test/config.py @@ -529,7 +529,6 @@ class Configuration(object): self.cxx.link_flags += ['-lc', '-lm'] if enable_threads: self.cxx.link_flags += ['-lpthread'] - self.cxx.link_flags += ['-lrt'] if llvm_unwinder: self.cxx.link_flags += ['-lunwind', '-ldl'] else: @@ -604,7 +603,10 @@ class Configuration(object): # Setup the sanitizer compile flags self.cxx.flags += ['-g', '-fno-omit-frame-pointer'] if self.target_info.platform() == 'linux': - self.cxx.link_flags += ['-ldl'] + # The libraries and their order are taken from the + # linkSanitizerRuntimeDeps function in + # clang/lib/Driver/Tools.cpp + self.cxx.link_flags += ['-lpthread', '-lrt', '-lm', '-ldl'] if san == 'Address': self.cxx.flags += ['-fsanitize=address'] if llvm_symbolizer is not None: