[flang-rt] replace the triple dir to 'aix' for flang-rt to be consistent with clang on AIX. (#130875)
This change is to put `libflang_rt.runtime.a` into
`build/lib/clang/21/lib/aix/libflang_rt.runtime.a`, which is consistent
with clang on AIX.
diff --git a/flang-rt/cmake/modules/GetToolchainDirs.cmake b/flang-rt/cmake/modules/GetToolchainDirs.cmake
index fba1250..8b38418 100644
--- a/flang-rt/cmake/modules/GetToolchainDirs.cmake
+++ b/flang-rt/cmake/modules/GetToolchainDirs.cmake
@@ -34,8 +34,9 @@
function (get_toolchain_library_subdir outvar)
set(outval "lib")
- if (APPLE)
+ if (APPLE OR (UNIX AND CMAKE_SYSTEM_NAME MATCHES "AIX"))
# Required to be "darwin" for MachO toolchain.
+ # AIX uses lib/${os_dir} as if LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF
get_toolchain_os_dirname(os_dirname)
set(outval "${outval}/${os_dirname}")
else ()