From c5e90a929295ed937e1b2d60e26bd002ca84e2a0 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Sat, 23 Jun 2018 16:53:38 -0500 Subject: [PATCH 1/2] llvm_{38,39}: unconditionally set triples, not just w/musl Follow-on to same changes made to other versions: See #42454, #42456. --- pkgs/development/compilers/llvm/3.8/llvm.nix | 4 ++++ pkgs/development/compilers/llvm/3.9/llvm.nix | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/llvm/3.8/llvm.nix b/pkgs/development/compilers/llvm/3.8/llvm.nix index b847a67e7e3f..835a5008ef58 100644 --- a/pkgs/development/compilers/llvm/3.8/llvm.nix +++ b/pkgs/development/compilers/llvm/3.8/llvm.nix @@ -78,6 +78,10 @@ in stdenv.mkDerivation rec { "-DLLVM_BUILD_TESTS=ON" "-DLLVM_ENABLE_FFI=ON" "-DLLVM_ENABLE_RTTI=ON" + + "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" + "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.targetPlatform.config}" + "-DTARGET_TRIPLE=${stdenv.targetPlatform.config}" ] ++ stdenv.lib.optional enableSharedLibraries [ "-DLLVM_LINK_LLVM_DYLIB=ON" ] ++ stdenv.lib.optional (!isDarwin) diff --git a/pkgs/development/compilers/llvm/3.9/llvm.nix b/pkgs/development/compilers/llvm/3.9/llvm.nix index 708e471bd4ac..458ad7db8efd 100644 --- a/pkgs/development/compilers/llvm/3.9/llvm.nix +++ b/pkgs/development/compilers/llvm/3.9/llvm.nix @@ -122,6 +122,10 @@ in stdenv.mkDerivation rec { "-DLLVM_ENABLE_FFI=ON" "-DLLVM_ENABLE_RTTI=ON" "-DCOMPILER_RT_INCLUDE_TESTS=OFF" # FIXME: requires clang source code + + "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" + "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.targetPlatform.config}" + "-DTARGET_TRIPLE=${stdenv.targetPlatform.config}" ] ++ stdenv.lib.optional enableSharedLibraries [ "-DLLVM_LINK_LLVM_DYLIB=ON" ] ++ stdenv.lib.optional (!isDarwin) @@ -133,9 +137,6 @@ in stdenv.mkDerivation rec { "-DCMAKE_CROSSCOMPILING=True" "-DLLVM_TABLEGEN=${buildPackages.llvmPackages_39.llvm}/bin/llvm-tblgen" ] ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [ - "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" - "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.targetPlatform.config}" - "-DTARGET_TRIPLE=${stdenv.targetPlatform.config}" # Not yet supported "-DCOMPILER_RT_BUILD_SANITIZERS=OFF" "-DCOMPILER_RT_BUILD_XRAY=OFF" From 632624691d2d0310d894329c44be4534059ac45e Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Mon, 25 Jun 2018 09:55:36 -0500 Subject: [PATCH 2/2] llvm-3.8: don't set triples a second time on musl I should have "moved" the flags instead of "copying" them earlier :). --- pkgs/development/compilers/llvm/3.8/llvm.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/development/compilers/llvm/3.8/llvm.nix b/pkgs/development/compilers/llvm/3.8/llvm.nix index 835a5008ef58..a6fb61198176 100644 --- a/pkgs/development/compilers/llvm/3.8/llvm.nix +++ b/pkgs/development/compilers/llvm/3.8/llvm.nix @@ -90,9 +90,6 @@ in stdenv.mkDerivation rec { "-DLLVM_ENABLE_LIBCXX=ON" "-DCAN_TARGET_i386=false" ] ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [ - "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" - "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.targetPlatform.config}" - "-DTARGET_TRIPLE=${stdenv.targetPlatform.config}" # Not yet supported "-DCOMPILER_RT_BUILD_SANITIZERS=OFF" "-DCOMPILER_RT_BUILD_XRAY=OFF"