llvm/7/compiler-rt: define CMAKE_*_COMPILER_TARGET unconditionally

When building with -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON the compiler-rt
CMake configuration attempts to use CMAKE_*_COMPILER_TARGET variables,
which are usually only defined in cross-compilation mode.
This commit is contained in:
Pierre Bourdon 2019-02-28 04:27:46 +01:00
parent 83c92d8215
commit 7541e4f8ac
No known key found for this signature in database
GPG Key ID: 6FB80DCD84DA0F1C

View File

@ -9,6 +9,8 @@ stdenv.mkDerivation rec {
cmakeFlags = [
"-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON"
"-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}"
"-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}"
] ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [
"-DCMAKE_C_FLAGS=-nodefaultlibs"
"-DCMAKE_CXX_COMPILER_WORKS=ON"
@ -17,8 +19,6 @@ stdenv.mkDerivation rec {
"-DCOMPILER_RT_BUILD_XRAY=OFF"
"-DCOMPILER_RT_BUILD_LIBFUZZER=OFF"
"-DCOMPILER_RT_BUILD_PROFILE=OFF"
"-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}"
"-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}"
"-DCOMPILER_RT_BAREMETAL_BUILD=ON"
];