[libcxx-commits] [PATCH] D102632: [libcxx/cxxabi/unwind][AIX] Add an AIX target and config for testing.

Sean Fertile via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon May 17 08:26:14 PDT 2021


sfertile created this revision.
sfertile added reviewers: ldionne, jasonliu, xingxue, daltenty.
Herald added subscribers: mstorsjo, jfb, arichardson.
sfertile requested review of this revision.
Herald added a project: libc++.
Herald added a reviewer: libc++.

Adds a target info for local AIX testing, and adjusts some of the link option to enable running testing on AIX for libcxx, libcxxabi and libunwind.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102632

Files:
  libcxx/utils/libcxx/test/config.py
  libcxx/utils/libcxx/test/target_info.py


Index: libcxx/utils/libcxx/test/target_info.py
===================================================================
--- libcxx/utils/libcxx/test/target_info.py
+++ libcxx/utils/libcxx/test/target_info.py
@@ -30,6 +30,9 @@
     def is_mingw(self):
         return False
 
+    def is_aix(self):
+        return False
+
     def add_cxx_flags(self, flags): pass
     def add_cxx_compile_flags(self, flags): pass
     def add_cxx_link_flags(self, flags): pass
@@ -152,6 +155,16 @@
     def is_mingw(self):
         return True
 
+class AIXLocalTI(DefaultTargetInfo):
+    def __init__(self, full_config):
+        super(AIXLocalTI, self).__init__(full_config)
+
+    def add_cxx_link_flags(self, flags):
+        flags += ['-lpthread', '-lc++abi', '-lunwind', '-latomic']
+
+    def is_aix(self):
+        return True
+
 def make_target_info(full_config):
     default = "libcxx.test.target_info.LocalTI"
     info_str = full_config.get_lit_conf('target_info', default)
@@ -168,4 +181,5 @@
     if target_system == 'Linux':   return LinuxLocalTI(full_config)
     if target_system == 'Windows': return WindowsLocalTI(full_config)
     if target_system == 'OS/390':  return ZOSLocalTI(full_config)
+    if target_system == "AIX":     return AIXLocalTI(full_config)
     return DefaultTargetInfo(full_config)
Index: libcxx/utils/libcxx/test/config.py
===================================================================
--- libcxx/utils/libcxx/test/config.py
+++ libcxx/utils/libcxx/test/config.py
@@ -356,7 +356,7 @@
 
         # Configure libraries
         if self.cxx_stdlib_under_test == 'libc++':
-            if self.target_info.is_mingw():
+            if self.target_info.is_mingw() or self.target_info.is_aix():
                 self.cxx.link_flags += ['-nostdlib++']
             else:
                 self.cxx.link_flags += ['-nodefaultlibs']
@@ -385,7 +385,9 @@
             if self.target_info.is_windows() and self.link_shared:
                 self.add_path(self.cxx.compile_env, self.cxx_library_root)
         if self.cxx_runtime_root:
-            if not self.target_info.is_windows():
+            if self.target_info.is_aix():
+                self.exec_env['LIBPATH'] = self.cxx_runtime_root
+            elif not self.target_info.is_windows():
                 self.cxx.link_flags += ['-Wl,-rpath,' +
                                         self.cxx_runtime_root]
             elif self.target_info.is_windows() and self.link_shared:
@@ -399,7 +401,9 @@
         if self.abi_library_root:
             self.cxx.link_flags += ['-L' + self.abi_library_root]
         if self.abi_runtime_root:
-            if not self.target_info.is_windows():
+            if self.target_info.is_aix():
+                self.exec_env['LIBPATH'] = self.abi_runtime_root
+            elif not self.target_info.is_windows():
                 self.cxx.link_flags += ['-Wl,-rpath,' + self.abi_runtime_root]
             else:
                 self.add_path(self.exec_env, self.abi_runtime_root)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102632.345894.patch
Type: text/x-patch
Size: 2990 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210517/771e8d7d/attachment-0001.bin>


More information about the libcxx-commits mailing list