From 7541e4f8accccf4ae40486797c4a2fe969d12e6c Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Thu, 28 Feb 2019 04:27:46 +0100 Subject: [PATCH] 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. --- pkgs/development/compilers/llvm/7/compiler-rt.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/llvm/7/compiler-rt.nix b/pkgs/development/compilers/llvm/7/compiler-rt.nix index 1c5d647a2269..b44ba62ee924 100644 --- a/pkgs/development/compilers/llvm/7/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/7/compiler-rt.nix @@ -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" ];