mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-24 03:32:35 +08:00
Attempt to unbreak filesystem tests on certain linux distros.
On some platforms clock_gettime is in librt, which we don't link by default when building the tests. However it is required by the filesystem tests. This patch introduces a workaround which links librt whenever the filesystem tests are enabled. The workaround should later be replaced with a patch that selectively links both libc++fs and librt only when building filesystem specific tests. However, the way the test configuration is set up right now, this is non-trivial. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@340406 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -222,12 +222,17 @@ class LinuxLocalTI(DefaultTargetInfo):
|
|||||||
self.full_config.config.available_features)
|
self.full_config.config.available_features)
|
||||||
llvm_unwinder = self.full_config.get_lit_bool('llvm_unwinder', False)
|
llvm_unwinder = self.full_config.get_lit_bool('llvm_unwinder', False)
|
||||||
shared_libcxx = self.full_config.get_lit_bool('enable_shared', True)
|
shared_libcxx = self.full_config.get_lit_bool('enable_shared', True)
|
||||||
|
# FIXME: Remove the need to link -lrt in all the tests, and instead
|
||||||
|
# limit it only to the filesystem tests. This ensures we don't cause an
|
||||||
|
# implicit dependency on librt except when filesystem is needed.
|
||||||
|
enable_fs = self.full_config.get_lit_bool('enable_filesystem',
|
||||||
|
default=False)
|
||||||
flags += ['-lm']
|
flags += ['-lm']
|
||||||
if not llvm_unwinder:
|
if not llvm_unwinder:
|
||||||
flags += ['-lgcc_s', '-lgcc']
|
flags += ['-lgcc_s', '-lgcc']
|
||||||
if enable_threads:
|
if enable_threads:
|
||||||
flags += ['-lpthread']
|
flags += ['-lpthread']
|
||||||
if not shared_libcxx:
|
if not shared_libcxx or enable_fs:
|
||||||
flags += ['-lrt']
|
flags += ['-lrt']
|
||||||
flags += ['-lc']
|
flags += ['-lc']
|
||||||
if llvm_unwinder:
|
if llvm_unwinder:
|
||||||
|
Reference in New Issue
Block a user