diff options
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/llvm/13')
4 files changed, 6 insertions, 2 deletions
diff --git a/nixpkgs/pkgs/development/compilers/llvm/13/clang/default.nix b/nixpkgs/pkgs/development/compilers/llvm/13/clang/default.nix index 6604ae0efc3f..7673c903e71c 100644 --- a/nixpkgs/pkgs/development/compilers/llvm/13/clang/default.nix +++ b/nixpkgs/pkgs/development/compilers/llvm/13/clang/default.nix @@ -83,7 +83,7 @@ let passthru = { inherit libllvm; isClang = true; - hardeningUnsupportedFlags = [ "fortify3" ]; + hardeningUnsupportedFlags = [ "fortify3" "zerocallusedregs" ]; }; meta = llvm_meta // { diff --git a/nixpkgs/pkgs/development/compilers/llvm/13/compiler-rt/default.nix b/nixpkgs/pkgs/development/compilers/llvm/13/compiler-rt/default.nix index e36aec42e905..b6a9c13ba943 100644 --- a/nixpkgs/pkgs/development/compilers/llvm/13/compiler-rt/default.nix +++ b/nixpkgs/pkgs/development/compilers/llvm/13/compiler-rt/default.nix @@ -131,5 +131,8 @@ stdenv.mkDerivation { # "All of the code in the compiler-rt project is dual licensed under the MIT # license and the UIUC License (a BSD-like license)": license = with lib.licenses; [ mit ncsa ]; + # compiler-rt requires a Clang stdenv on 32-bit RISC-V: + # https://reviews.llvm.org/D43106#1019077 + broken = stdenv.hostPlatform.isRiscV32 && !stdenv.cc.isClang; }; } diff --git a/nixpkgs/pkgs/development/compilers/llvm/13/default.nix b/nixpkgs/pkgs/development/compilers/llvm/13/default.nix index c46ebee1d0db..c811b24c48ef 100644 --- a/nixpkgs/pkgs/development/compilers/llvm/13/default.nix +++ b/nixpkgs/pkgs/development/compilers/llvm/13/default.nix @@ -213,6 +213,7 @@ in let echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags '' + lib.optionalString (!stdenv.targetPlatform.isWasm) '' echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags + echo "-L${targetLlvmLibraries.libunwind}/lib" >> $out/nix-support/cc-ldflags '' + lib.optionalString (!stdenv.targetPlatform.isWasm && stdenv.targetPlatform.useLLVM or false) '' echo "-lunwind" >> $out/nix-support/cc-ldflags '' + lib.optionalString stdenv.targetPlatform.isWasm '' diff --git a/nixpkgs/pkgs/development/compilers/llvm/13/llvm/default.nix b/nixpkgs/pkgs/development/compilers/llvm/13/llvm/default.nix index 2a7c1c1867cb..1e71cdd89c6c 100644 --- a/nixpkgs/pkgs/development/compilers/llvm/13/llvm/default.nix +++ b/nixpkgs/pkgs/development/compilers/llvm/13/llvm/default.nix @@ -206,7 +206,7 @@ in stdenv.mkDerivation (rec { ] ++ optionals isDarwin [ "-DLLVM_ENABLE_LIBCXX=ON" "-DCAN_TARGET_i386=false" - ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ optionals ((stdenv.hostPlatform != stdenv.buildPlatform) && !(stdenv.buildPlatform.canExecute stdenv.hostPlatform)) [ "-DCMAKE_CROSSCOMPILING=True" "-DLLVM_TABLEGEN=${buildLlvmTools.llvm}/bin/llvm-tblgen" ( |