Re-commit "Introduce a cmake module to figure out whether we need to link with libatomic."

This re-applies commit r260235. However, this time we add -gcc-toolchain
to the compiler's flags when the user has specified the LIBCXX_GCC_TOOLCHAIN
variable.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@260515 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Vasileios Kalintiris
2016-02-11 12:43:04 +00:00
parent ba41d7e1ff
commit cb6641a497
6 changed files with 52 additions and 0 deletions

View File

@@ -172,6 +172,9 @@ class LinuxLocalTI(DefaultTargetInfo):
flags += ['-lunwind', '-ldl']
else:
flags += ['-lgcc_s', '-lgcc']
use_libatomic = self.full_config.get_lit_bool('use_libatomic', False)
if use_libatomic:
flags += ['-latomic']
san = self.full_config.get_lit_conf('use_sanitizer', '').strip()
if san:
# The libraries and their order are taken from the