[PATCH] D118377: [LLVM][AIX] Prefer a 32-bit default target triple on AIX
David Tenty via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 27 22:25:20 PST 2022
daltenty updated this revision to Diff 403888.
daltenty added a comment.
Slightly tweak the match and replace to preserve any custom OS versioned triple the user may have passed in.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118377/new/
https://reviews.llvm.org/D118377
Files:
llvm/CMakeLists.txt
Index: llvm/CMakeLists.txt
===================================================================
--- llvm/CMakeLists.txt
+++ llvm/CMakeLists.txt
@@ -703,8 +703,15 @@
include(config-ix)
# By default, we target the host, but this can be overridden at CMake
-# invocation time.
-set(LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_HOST_TRIPLE}" CACHE STRING
+# invocation time. Except on 64-bit AIX, where the system toolchain
+# expect 32-bit objects by default.
+if("${LLVM_HOST_TRIPLE}" MATCHES "^powerpc64-ibm-aix")
+ string(REGEX REPLACE "^powerpc64" "powerpc" LLVM_DEFAULT_TARGET_TRIPLE_default "${LLVM_HOST_TRIPLE}")
+else()
+ set(LLVM_DEFAULT_TARGET_TRIPLE_default "${LLVM_HOST_TRIPLE}")
+endif()
+
+set(LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE_default}" CACHE STRING
"Default target for which LLVM will generate code." )
set(TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}")
message(STATUS "LLVM host triple: ${LLVM_HOST_TRIPLE}")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118377.403888.patch
Type: text/x-patch
Size: 945 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220128/2bd221c6/attachment.bin>
More information about the llvm-commits
mailing list