diff options
author | Dan Liew <dan@su-root.co.uk> | 2018-05-14 15:48:49 +0000 |
---|---|---|
committer | Dan Liew <dan@su-root.co.uk> | 2018-05-14 15:48:49 +0000 |
commit | 7bb5a5d2e5f6c07afefd5fde2d7f858663b3da08 (patch) | |
tree | 8133360fcd3a153c0d0131b79924ec6af1dce3a4 /test/lit.common.cfg | |
parent | 504c4196afe17ab91d73b6a4b691c911c042908b (diff) |
Fix another case where libstdc++ is being inappropriately requested (see
r328775) for all platforms.
Given that this is the second occurance of this problem it seemed worth
fixing this problem in a more generic way. r328775 has been reverted and
now a substitution `%linux_static_libstdcplusplus` has been provided.
This substitution expands to Clang driver arguments to use a static
libstdc++ on Linux and on all other platforms it expands to nothing.
The `asan/TestCases/throw_invoke_test.cc` and
`test/tsan/static_init6.cc` test cases now use this substitution.
rdar://problem/39948818
Differential Revision: https://reviews.llvm.org/D46401
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@332254 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/lit.common.cfg')
-rw-r--r-- | test/lit.common.cfg | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/lit.common.cfg b/test/lit.common.cfg index 37035919c..177e6ca4d 100644 --- a/test/lit.common.cfg +++ b/test/lit.common.cfg @@ -322,6 +322,14 @@ elif config.host_os == 'SunOS': config.substitutions.append( ("%ld_flags_rpath_exe", "-Wl,-R\$ORIGIN -L%T -l%xdynamiclib_namespec") ) config.substitutions.append( ("%ld_flags_rpath_so", '') ) +# Provide a substituion that can be used to tell Clang to use a static libstdc++. +# The substitution expands to nothing on non Linux platforms. +# FIXME: This should check the target OS, not the host OS. +if config.host_os == 'Linux': + config.substitutions.append( ("%linux_static_libstdcplusplus", "-stdlib=libstdc++ -static-libstdc++") ) +else: + config.substitutions.append( ("%linux_static_libstdcplusplus", "") ) + # Must be defined after the substitutions that use %dynamiclib. config.substitutions.append( ("%dynamiclib", '%T/%xdynamiclib_filename') ) config.substitutions.append( ("%xdynamiclib_filename", 'lib%xdynamiclib_namespec.so') ) |