[PATCH] D16544: [libcxx] Framework to allow testing of static libc++abi

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 11 09:36:53 PST 2016


EricWF added a comment.

Did you consider simply wrapping the library in "-Wl,-Bstatic" and "-Wl,-Bdynamic" linker flags? It seems like that would work almost as well as explicitly naming the target.


================
Comment at: test/libcxx/test/config.py:463
@@ -462,2 +462,3 @@
         else:
-            self.cxx.link_flags += ['-lc++']
+            libcxx_shared = self.get_lit_bool('enable_shared')
+            if libcxx_shared:
----------------
```
libcxx_shared = self.get_lit_bool('enable_shared', default=True)
```


================
Comment at: test/libcxx/test/config.py:469
@@ +468,3 @@
+                if cxx_library_root:
+                    abs_path = cxx_library_root + "/libc++.a"
+                    self.cxx.link_flags += [abs_path]
----------------
Why not just wrap it in '-B,-static'?

================
Comment at: test/libcxx/test/config.py:482
@@ -472,2 +481,3 @@
             if self.target_info.allow_cxxabi_link():
-                self.cxx.link_flags += ['-lc++abi']
+                libcxxabi_shared = self.get_lit_bool('libcxxabi_shared')
+                if libcxxabi_shared:
----------------
Same as above.

================
Comment at: test/libcxx/test/target_info.py:173
@@ -164,2 +172,3 @@
         llvm_unwinder = self.full_config.get_lit_bool('llvm_unwinder', False)
+        shared_libcxx = self.full_config.get_lit_bool('enable_shared', False)
         flags += ['-lm']
----------------
Hmm... this would have a different default compared to elsewhere after my suggested edits.


http://reviews.llvm.org/D16544





More information about the cfe-commits mailing list