[PATCH] D67401: Use host's executable suffix for clang when cross-compiling compiler-rt

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 12 11:44:29 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL371754: Use host's executable suffix for clang when cross-compiling compiler-rt (authored by rnk, committed by ).
Herald added a subscriber: delcypher.

Changed prior to commit:
  https://reviews.llvm.org/D67401?vs=219545&id=219959#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67401/new/

https://reviews.llvm.org/D67401

Files:
  compiler-rt/trunk/cmake/base-config-ix.cmake


Index: compiler-rt/trunk/cmake/base-config-ix.cmake
===================================================================
--- compiler-rt/trunk/cmake/base-config-ix.cmake
+++ compiler-rt/trunk/cmake/base-config-ix.cmake
@@ -47,11 +47,21 @@
          ${LLVM_INCLUDE_TESTS})
   option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered"
          ${LLVM_ENABLE_WERROR})
+
   # Use just-built Clang to compile/link tests on all platforms.
+  if (CMAKE_CROSSCOMPILING)
+    if (CMAKE_HOST_WIN32)
+      set(_host_executable_suffix ".exe")
+    else()
+      set(_host_executable_suffix "")
+    endif()
+  else()
+    set(_host_executable_suffix ${CMAKE_EXECUTABLE_SUFFIX})
+  endif()
   set(COMPILER_RT_TEST_COMPILER
-    ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang${CMAKE_EXECUTABLE_SUFFIX})
+    ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang${_host_executable_suffix})
   set(COMPILER_RT_TEST_CXX_COMPILER
-    ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++${CMAKE_EXECUTABLE_SUFFIX})
+    ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++${_host_executable_suffix})
 else()
     # Take output dir and install path from the user.
   set(COMPILER_RT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67401.219959.patch
Type: text/x-patch
Size: 1171 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190912/e0ce7cf3/attachment-0001.bin>


More information about the llvm-commits mailing list