Skip to content

Commit b8456e2

Browse files
authored
[libc++][AIX] Fixup problems with ABI list checking (#155643)
There are some problems with our ABI list checking exposed by recent compiler/cmake upgrades. - For symcheck, there are typos 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 a valid XCOFF file. - AIX triples can have version numbers. Those need to be discarded when looking for an libc++ ABI list, like we do for other targets.
1 parent 60c0663 commit b8456e2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

libcxx/lib/abi/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ function(cxx_abi_list_identifier result triple abi_library abi_version unstable
1616
elseif("${triple}" MATCHES "freebsd")
1717
# Ignore the major and minor versions of freebsd targets.
1818
string(REGEX REPLACE "freebsd[0-9]+\\.[0-9]+" "freebsd" triple "${triple}")
19+
elseif("${triple}" MATCHES "aix")
20+
# Ignore the V.R.M.F version string of aix targets.
21+
string(REGEX REPLACE "aix[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+" "aix" triple "${triple}")
1922
endif()
2023
list(APPEND abi_properties "${triple}")
2124
list(APPEND abi_properties "${abi_library}")

libcxx/utils/libcxx/sym_check/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def is_xcoff_or_big_ar(filename):
9595
with open(filename, "rb") as f:
9696
magic_bytes = f.read(7)
9797
return (
98-
magic_bytes[:4] in [b"\x01DF", b"\x01F7"] # XCOFF32 # XCOFF64
98+
magic_bytes[:2] in [b"\x01\xDF", b"\x01\xF7"] # XCOFF32 # XCOFF64
9999
or magic_bytes == b"<bigaf>"
100100
)
101101

0 commit comments

Comments
 (0)