[PATCH] D37450: [CMake][runtimes] Use default compiler-rt build setting for default target
Petr Hosek via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 4 16:21:59 PDT 2017
phosek created this revision.
Herald added subscribers: mgorny, dberris.
Only set COMPILER_RT_DEFAULT_TARGET_ONLY when building non-default
target (i.e. target other than "default"). The default host target
has special behavior on some platforms, e.g. on Linux both i386 and
x86_64 targets are being built, and we want to support that behavior
for host targets.
Repository:
rL LLVM
https://reviews.llvm.org/D37450
Files:
runtimes/CMakeLists.txt
Index: runtimes/CMakeLists.txt
===================================================================
--- runtimes/CMakeLists.txt
+++ runtimes/CMakeLists.txt
@@ -228,33 +228,37 @@
add_custom_target(builtins)
add_custom_target(install-builtins)
foreach(target ${LLVM_BUILTIN_TARGETS})
- if(target STREQUAL "default")
- set(target ${LLVM_DEFAULT_TARGET_TRIPLE})
- endif()
-
string(REPLACE "-" ";" builtin_target_list ${target})
foreach(item ${builtin_target_list})
string(TOLOWER "${item}" item_lower)
if(item_lower MATCHES "darwin")
message(FATAL_ERROR "LLVM_BUILTIN_TARGETS isn't implemented for Darwin platform!")
endif()
endforeach()
+ if(target STREQUAL "default")
+ set(target ${LLVM_DEFAULT_TARGET_TRIPLE})
+ endif()
+
foreach(variableName ${variableNames})
if(variableName MATCHES "^BUILTINS_${target}")
string(REPLACE "BUILTINS_${target}_" "" new_name ${variableName})
list(APPEND ${target}_extra_args "-D${new_name}=${${variableName}}")
endif()
endforeach()
+
+ if(NOT target STREQUAL LLVM_DEFAULT_TARGET_TRIPLE)
+ list(APPEND ${target}_extra_args "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON")
+ endif()
+
llvm_ExternalProject_Add(builtins-${target}
${CMAKE_CURRENT_SOURCE_DIR}/compiler-rt/lib/builtins
CMAKE_ARGS -DLLVM_LIBRARY_OUTPUT_INTDIR=${LLVM_LIBRARY_DIR}
-DLLVM_RUNTIME_OUTPUT_INTDIR=${LLVM_TOOLS_BINARY_DIR}
-DCMAKE_C_COMPILER_TARGET=${target}
-DCMAKE_ASM_COMPILER_TARGET=${target}
-DCMAKE_C_COMPILER_WORKS=On
-DCMAKE_ASM_COMPILER_WORKS=On
- -DCOMPILER_RT_DEFAULT_TARGET_ONLY=On
${${target}_extra_args}
TOOLCHAIN_TOOLS clang lld llvm-ar llvm-ranlib
PASSTHROUGH_PREFIXES COMPILER_RT
@@ -340,7 +344,9 @@
endforeach()
if(NOT target STREQUAL LLVM_DEFAULT_TARGET_TRIPLE)
- list(APPEND ${name}_extra_args "-DLLVM_RUNTIMES_TARGET=${name}")
+ list(APPEND ${name}_extra_args
+ "-DLLVM_RUNTIMES_TARGET=${name}"
+ "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON")
endif()
llvm_ExternalProject_Add(runtimes-${name}
@@ -356,7 +362,6 @@
-DCMAKE_C_COMPILER_WORKS=ON
-DCMAKE_CXX_COMPILER_WORKS=ON
-DCMAKE_ASM_COMPILER_WORKS=ON
- -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON
${${name}_extra_args}
TOOLCHAIN_TOOLS clang lld llvm-ar llvm-ranlib
PASSTHROUGH_PREFIXES ${prefixes}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37450.113793.patch
Type: text/x-patch
Size: 3127 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170904/adcafd57/attachment.bin>
More information about the llvm-commits
mailing list