[PATCH] D134972: [CMake] Only set LLVM_DEFAULT_TARGET_TRIPLE to LLVM_HOST_TRIPLE when native target is enabled
Xiang Li via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 30 10:10:53 PDT 2022
python3kgae created this revision.
python3kgae added reviewers: beanz, pow2clk, bogner.
Herald added subscribers: ormris, pengfei, steven_wu, hiraditya.
Herald added a project: All.
python3kgae requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
This is for case when native target like X86 is not in LLVM_TARGETS_TO_BUILD.
Right now LLVM_DEFAULT_TARGET_TRIPLE is set to LLVM_HOST_TRIPLE even when native target is not enabled,
As a result, many lit tests will fail because default_triple is set for lit test but not enabled when build LLVM.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D134972
Files:
llvm/CMakeLists.txt
llvm/test/Examples/OrcV2Examples/lljit-with-remote-debugging.test
llvm/test/Examples/OrcV2Examples/lljit-with-thinlto-summaries.test
Index: llvm/test/Examples/OrcV2Examples/lljit-with-thinlto-summaries.test
===================================================================
--- llvm/test/Examples/OrcV2Examples/lljit-with-thinlto-summaries.test
+++ llvm/test/Examples/OrcV2Examples/lljit-with-thinlto-summaries.test
@@ -2,6 +2,8 @@
# RUN: opt -module-summary %p/Inputs/foo-mod.ll -o foo-mod.bc
# RUN: opt -module-summary %p/Inputs/bar-mod.ll -o bar-mod.bc
+# REQUIRES: default_triple
+
# RUN: llvm-lto -thinlto -o main-foo-bar main-mod.bc foo-mod.bc bar-mod.bc
# RUN: LLJITWithThinLTOSummaries main-foo-bar.thinlto.bc 2>&1 | FileCheck %s
Index: llvm/test/Examples/OrcV2Examples/lljit-with-remote-debugging.test
===================================================================
--- llvm/test/Examples/OrcV2Examples/lljit-with-remote-debugging.test
+++ llvm/test/Examples/OrcV2Examples/lljit-with-remote-debugging.test
@@ -1,6 +1,8 @@
# This test makes sure that the example builds and executes as expected.
# Instructions for debugging can be found in LLJITWithRemoteDebugging.cpp
+# REQUIRES: default_triple
+
# RUN: LLJITWithRemoteDebugging %p/Inputs/argc_sub1_elf.ll | FileCheck --check-prefix=CHECK0 %s
# CHECK0: Parsing input IR code from: {{.*}}/Inputs/argc_sub1_elf.ll
# CHECK0: Running: main()
Index: llvm/CMakeLists.txt
===================================================================
--- llvm/CMakeLists.txt
+++ llvm/CMakeLists.txt
@@ -848,7 +848,10 @@
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}")
+ # Only set default triple when native target is enabled.
+ if (LLVM_NATIVE_TARGET)
+ set(LLVM_DEFAULT_TARGET_TRIPLE_default "${LLVM_HOST_TRIPLE}")
+ endif()
endif()
set(LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE_default}" CACHE STRING
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134972.464317.patch
Type: text/x-patch
Size: 1945 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220930/3954bb97/attachment.bin>
More information about the llvm-commits
mailing list