AIX: Teach ExportImportList to use toolchain-specific nm

This is needed to handle LTO objects.

Fixes: #27655
This commit is contained in:
Aditya Vidyadhar Kamath
2026-03-05 09:20:27 -06:00
committed by Brad King
parent dbc4d94715
commit 3e99e8efb2

View File

@@ -43,7 +43,13 @@ trap 'rm -f "$out_tmp"' EXIT INT TERM
# need to be handled differently. # need to be handled differently.
# #
# [0]: https://www.ibm.com/docs/en/openxl-c-and-cpp-aix/17.1.0?topic=compatibility-link-time-optimization-lto # [0]: https://www.ibm.com/docs/en/openxl-c-and-cpp-aix/17.1.0?topic=compatibility-link-time-optimization-lto
NM="$(dirname "$compiler")/../libexec/ibm-llvm-nm" if "$compiler" --version 2>/dev/null | grep -qi "IBM Open XL"; then
NM="$(dirname "$compiler")/../libexec/ibm-llvm-nm"
elif "$compiler" --version 2>/dev/null | grep -qi "[cf]lang version"; then
NM="$(dirname "$compiler")/../bin/llvm-nm"
else
NM="nm"
fi
function IsBitcode { function IsBitcode {
# N4 = first 4 bytes, -tx = output in hexadecimal, -An = don't display offset # N4 = first 4 bytes, -tx = output in hexadecimal, -An = don't display offset