[libcxx-commits] [libcxx] [libc++][AIX] Fixup problems with ABI list checking (PR #155643)

David Tenty via libcxx-commits libcxx-commits at lists.llvm.org
Wed Aug 27 15:27:22 PDT 2025


https://github.com/daltenty updated https://github.com/llvm/llvm-project/pull/155643

>From a1c111278a128e7d8ff8ea153ed0b1ab62884511 Mon Sep 17 00:00:00 2001
From: David Tenty <daltenty at ibm.com>
Date: Wed, 27 Aug 2025 11:37:04 -0400
Subject: [PATCH 1/4] [libc++][AIX] fix XCOFF magic in symcheck

There are some typos here in how XCOFF magic are defined,
we intended the second two digits to be a hex value, but
our syntax doesn't say that. Thus this will never match.
---
 libcxx/utils/libcxx/sym_check/util.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libcxx/utils/libcxx/sym_check/util.py b/libcxx/utils/libcxx/sym_check/util.py
index fc7ba4244ab5a..dbc886f29ddea 100644
--- a/libcxx/utils/libcxx/sym_check/util.py
+++ b/libcxx/utils/libcxx/sym_check/util.py
@@ -95,7 +95,7 @@ def is_xcoff_or_big_ar(filename):
     with open(filename, "rb") as f:
         magic_bytes = f.read(7)
     return (
-        magic_bytes[:4] in [b"\x01DF", b"\x01F7"]  # XCOFF32  # XCOFF64
+        magic_bytes[:2] in [b"\x01\xDF", b"\x01\xF7"]  # XCOFF32  # XCOFF64
         or magic_bytes == b"<bigaf>"
     )
 

>From a4a51f15a36c8268a716b711b5836570cf7dd3d0 Mon Sep 17 00:00:00 2001
From: David Tenty <daltenty at ibm.com>
Date: Wed, 27 Aug 2025 13:27:52 -0400
Subject: [PATCH 2/4] Ignore AIX version in ABI list

---
 libcxx/lib/abi/CMakeLists.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libcxx/lib/abi/CMakeLists.txt b/libcxx/lib/abi/CMakeLists.txt
index 7c08bd06c50b2..a28cfa9b261a9 100644
--- a/libcxx/lib/abi/CMakeLists.txt
+++ b/libcxx/lib/abi/CMakeLists.txt
@@ -16,6 +16,9 @@ function(cxx_abi_list_identifier result triple abi_library abi_version unstable
   elseif("${triple}" MATCHES "freebsd")
     # Ignore the major and minor versions of freebsd targets.
     string(REGEX REPLACE "freebsd[0-9]+\\.[0-9]+" "freebsd" triple "${triple}")
+  elseif("${triple}" MATCHES "aix")
+    # Ignore the V.R.M.F version string of aix targets.
+    string(REGEX REPLACE "aix[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+" "aix" triple  "${triple}")
   endif()
   list(APPEND abi_properties "${triple}")
   list(APPEND abi_properties "${abi_library}")
@@ -45,6 +48,7 @@ if (CMAKE_CXX_COMPILER_TARGET)
 else()
   set(triple "${LLVM_DEFAULT_TARGET_TRIPLE}")
 endif()
+
 cxx_abi_list_identifier(abi_list_identifier
   "${triple}"
   "${LIBCXX_CXX_ABI}"

>From 387e3b1f6cf208db339ceed39ac0fd95c0e6c72d Mon Sep 17 00:00:00 2001
From: David Tenty <daltenty at ibm.com>
Date: Wed, 27 Aug 2025 15:28:13 -0400
Subject: [PATCH 3/4] Remove extra blank line

---
 libcxx/lib/abi/CMakeLists.txt | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libcxx/lib/abi/CMakeLists.txt b/libcxx/lib/abi/CMakeLists.txt
index a28cfa9b261a9..cdeaa440906b2 100644
--- a/libcxx/lib/abi/CMakeLists.txt
+++ b/libcxx/lib/abi/CMakeLists.txt
@@ -48,7 +48,6 @@ if (CMAKE_CXX_COMPILER_TARGET)
 else()
   set(triple "${LLVM_DEFAULT_TARGET_TRIPLE}")
 endif()
-
 cxx_abi_list_identifier(abi_list_identifier
   "${triple}"
   "${LIBCXX_CXX_ABI}"

>From 2943b9a3512274727f81ea44b7716b7f0564ee37 Mon Sep 17 00:00:00 2001
From: David Tenty <daltenty.dev at gmail.com>
Date: Wed, 27 Aug 2025 18:27:13 -0400
Subject: [PATCH 4/4] Fix extra space

Co-authored-by: Hubert Tong <hubert.reinterpretcast at gmail.com>
---
 libcxx/lib/abi/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libcxx/lib/abi/CMakeLists.txt b/libcxx/lib/abi/CMakeLists.txt
index cdeaa440906b2..8f277aad2dcd5 100644
--- a/libcxx/lib/abi/CMakeLists.txt
+++ b/libcxx/lib/abi/CMakeLists.txt
@@ -18,7 +18,7 @@ function(cxx_abi_list_identifier result triple abi_library abi_version unstable
     string(REGEX REPLACE "freebsd[0-9]+\\.[0-9]+" "freebsd" triple "${triple}")
   elseif("${triple}" MATCHES "aix")
     # Ignore the V.R.M.F version string of aix targets.
-    string(REGEX REPLACE "aix[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+" "aix" triple  "${triple}")
+    string(REGEX REPLACE "aix[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+" "aix" triple "${triple}")
   endif()
   list(APPEND abi_properties "${triple}")
   list(APPEND abi_properties "${abi_library}")



More information about the libcxx-commits mailing list