[PATCH] D23420: libcxx: Fix libcxx test on aarch64 with libunwind

Adhemerval Zanella via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 11 13:00:34 PDT 2016

zatrazz created this revision.
zatrazz added reviewers: jroelofs, danalbert.
zatrazz added subscribers: rengolin, cfe-commits.
Herald added a subscriber: aemerson.

Some tests uses 'long double' to/from conversions and for some targets
they are provided by compiler runtime (either compiler-rt or libgcc).
However when building libcxx with linunwinder current test configuration
at target_info.py do not include the required libraries, as:

  not llvm_unwinder:
    [-lgcc_s] [-lgcc] [...] [-lgcc_s] [-lgcc]

    [-lunwind] [-ldl]

This causes some tests build issues with missing symbols on aarch64,
for instance, where 'long double' is a binary float with 128-bits with
mostly of internal operations being provided by software routines.

This patch changes how to define the default linker flags by:

  not llvm_unwinder:
    [-lgcc_s] [-lgcc]

    [-lunwind] [-ldl] [-lgcc_s] [-lgcc]

I checked and aarch64 and x86_64 with libcxx and libunwind (with and without



Index: test/libcxx/test/target_info.py
--- test/libcxx/test/target_info.py
+++ test/libcxx/test/target_info.py
@@ -170,17 +170,14 @@
         llvm_unwinder = self.full_config.get_lit_bool('llvm_unwinder', False)
         shared_libcxx = self.full_config.get_lit_bool('enable_shared', True)
         flags += ['-lm']
-        if not llvm_unwinder:
-            flags += ['-lgcc_s', '-lgcc']
         if enable_threads:
             flags += ['-lpthread']
             if not shared_libcxx:
               flags += ['-lrt']
         flags += ['-lc']
         if llvm_unwinder:
             flags += ['-lunwind', '-ldl']
-        else:
-            flags += ['-lgcc_s', '-lgcc']
+        flags += ['-lgcc_s', '-lgcc']
         use_libatomic = self.full_config.get_lit_bool('use_libatomic', False)
         if use_libatomic:
             flags += ['-latomic']

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23420.67732.patch
Type: text/x-patch
Size: 924 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160811/5ede098b/attachment.bin>

More information about the cfe-commits mailing list