From 1f95c9c933b8762ac9d87d84c1e9218b46ab7441 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Mon, 30 Sep 2019 21:26:26 -0400 Subject: [PATCH] llvm9/compiler-rt: fix on i686 --- pkgs/development/compilers/llvm/9/compiler-rt.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/llvm/9/compiler-rt.nix b/pkgs/development/compilers/llvm/9/compiler-rt.nix index 0b7e6815c64..9a333ad7c11 100644 --- a/pkgs/development/compilers/llvm/9/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/9/compiler-rt.nix @@ -7,11 +7,10 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake python llvm ]; buildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin libcxxabi; - cmakeFlags = [ + cmakeFlags = stdenv.lib.optionals (stdenv.hostPlatform.useLLVM or false) [ "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" - ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "-DCMAKE_C_FLAGS=-nodefaultlibs" "-DCMAKE_CXX_COMPILER_WORKS=ON" "-DCOMPILER_RT_BUILD_SANITIZERS=OFF" @@ -46,7 +45,7 @@ stdenv.mkDerivation rec { postPatch = stdenv.lib.optionalString stdenv.isDarwin '' substituteInPlace cmake/config-ix.cmake \ --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)' - '' + stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + '' + stdenv.lib.optionalString (stdenv.hostPlatform.useLLVM or false) '' substituteInPlace lib/builtins/int_util.c \ --replace "#include " "" substituteInPlace lib/builtins/clear_cache.c \