summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorSebastian Pop <spop@codeaurora.org>2012-01-04 19:47:22 +0000
committerSebastian Pop <spop@codeaurora.org>2012-01-04 19:47:22 +0000
commit8a86887ba3dcf59ddfd1d26bd2af1ac9c6bed76a (patch)
treed063101aa566588fde106548beed730b9023ced8 /cmake
parentb0e7af779732c5ff3c054c837a4b04ad6089d0ac (diff)
downloadllvm-8a86887ba3dcf59ddfd1d26bd2af1ac9c6bed76a.tar.gz
llvm-8a86887ba3dcf59ddfd1d26bd2af1ac9c6bed76a.tar.bz2
llvm-8a86887ba3dcf59ddfd1d26bd2af1ac9c6bed76a.tar.xz
use getHostTriple instead of getDefaultTargetTriple in getClosestTargetForJIT
Get back getHostTriple. For JIT compilation, use the host triple instead of the default target: this fixes some JIT testcases that used to fail when the compiler has been configured as a cross compiler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147542 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rwxr-xr-xcmake/config-ix.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index b380a48637..4ee433ae94 100755
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -288,13 +288,16 @@ include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-Wno-variadic-macros" SUPPORTS_NO_VARIADIC_MACROS_FLAG)
include(GetTargetTriple)
+get_target_triple(LLVM_HOST_TRIPLE)
get_target_triple(LLVM_DEFAULT_TARGET_TRIPLE)
+set(HOST_TRIPLE "${LLVM_HOST_TRIPLE}")
set(TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}")
# Determine the native architecture.
string(TOLOWER "${LLVM_TARGET_ARCH}" LLVM_NATIVE_ARCH)
if( LLVM_NATIVE_ARCH STREQUAL "host" )
+ string(REGEX MATCH "^[^-]*" LLVM_NATIVE_ARCH ${LLVM_HOST_TRIPLE})
string(REGEX MATCH "^[^-]*" LLVM_NATIVE_ARCH ${LLVM_DEFAULT_TARGET_TRIPLE})
endif ()