Skip to content

Commit 780e797

Browse files
committed
Merging r340406:
------------------------------------------------------------------------ r340406 | ericwf | 2018-08-22 15:29:52 +0200 (Wed, 22 Aug 2018) | 12 lines 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. ------------------------------------------------------------------------ llvm-svn: 340419
1 parent 7642c02 commit 780e797

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

libcxx/utils/libcxx/test/target_info.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,17 @@ def add_cxx_link_flags(self, flags):
222222
self.full_config.config.available_features)
223223
llvm_unwinder = self.full_config.get_lit_bool('llvm_unwinder', False)
224224
shared_libcxx = self.full_config.get_lit_bool('enable_shared', True)
225+
# FIXME: Remove the need to link -lrt in all the tests, and instead
226+
# limit it only to the filesystem tests. This ensures we don't cause an
227+
# implicit dependency on librt except when filesystem is needed.
228+
enable_fs = self.full_config.get_lit_bool('enable_filesystem',
229+
default=False)
225230
flags += ['-lm']
226231
if not llvm_unwinder:
227232
flags += ['-lgcc_s', '-lgcc']
228233
if enable_threads:
229234
flags += ['-lpthread']
230-
if not shared_libcxx:
235+
if not shared_libcxx or enable_fs:
231236
flags += ['-lrt']
232237
flags += ['-lc']
233238
if llvm_unwinder:

0 commit comments

Comments
 (0)