diff options
author | Alyssa Ross <hi@alyssa.is> | 2024-02-13 12:25:07 +0100 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2024-02-13 12:25:07 +0100 |
commit | a5e1520e4538e29ecfbd4b168306f890566d7bfd (patch) | |
tree | 28099c268b5d4b1e33c2b29f0714c45f0b961382 /nixpkgs/pkgs/development/compilers/llvm/15 | |
parent | 822f7c15c04567fbdc27020e862ea2b70cfbf8eb (diff) | |
parent | 3560d1c8269d0091b9aae10731b5e85274b7bbc1 (diff) | |
download | nixlib-a5e1520e4538e29ecfbd4b168306f890566d7bfd.tar nixlib-a5e1520e4538e29ecfbd4b168306f890566d7bfd.tar.gz nixlib-a5e1520e4538e29ecfbd4b168306f890566d7bfd.tar.bz2 nixlib-a5e1520e4538e29ecfbd4b168306f890566d7bfd.tar.lz nixlib-a5e1520e4538e29ecfbd4b168306f890566d7bfd.tar.xz nixlib-a5e1520e4538e29ecfbd4b168306f890566d7bfd.tar.zst nixlib-a5e1520e4538e29ecfbd4b168306f890566d7bfd.zip |
Merge branch 'nixos-unstable-small' of https://github.com/NixOS/nixpkgs
Conflicts: nixpkgs/nixos/modules/services/mail/rss2email.nix nixpkgs/pkgs/build-support/go/module.nix
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/llvm/15')
5 files changed, 20 insertions, 3 deletions
diff --git a/nixpkgs/pkgs/development/compilers/llvm/15/clang/default.nix b/nixpkgs/pkgs/development/compilers/llvm/15/clang/default.nix index c49d6368cb97..9ec15a393004 100644 --- a/nixpkgs/pkgs/development/compilers/llvm/15/clang/default.nix +++ b/nixpkgs/pkgs/development/compilers/llvm/15/clang/default.nix @@ -7,7 +7,7 @@ }: let - self = stdenv.mkDerivation (rec { + self = stdenv.mkDerivation (finalAttrs: rec { pname = "clang"; inherit version; @@ -97,7 +97,12 @@ let passthru = { inherit libllvm; isClang = true; - hardeningUnsupportedFlags = [ "fortify3" ]; + hardeningUnsupportedFlags = [ + "fortify3" + ]; + hardeningUnsupportedFlagsByTargetPlatform = targetPlatform: + lib.optional (!(targetPlatform.isx86_64 || targetPlatform.isAarch64)) "zerocallusedregs" + ++ (finalAttrs.passthru.hardeningUnsupportedFlags or []); }; meta = llvm_meta // { diff --git a/nixpkgs/pkgs/development/compilers/llvm/15/compiler-rt/default.nix b/nixpkgs/pkgs/development/compilers/llvm/15/compiler-rt/default.nix index 9817899345a9..fbf25786efee 100644 --- a/nixpkgs/pkgs/development/compilers/llvm/15/compiler-rt/default.nix +++ b/nixpkgs/pkgs/development/compilers/llvm/15/compiler-rt/default.nix @@ -138,5 +138,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/15/default.nix b/nixpkgs/pkgs/development/compilers/llvm/15/default.nix index 307198b5e9a3..d9ca0819f2e0 100644 --- a/nixpkgs/pkgs/development/compilers/llvm/15/default.nix +++ b/nixpkgs/pkgs/development/compilers/llvm/15/default.nix @@ -221,6 +221,7 @@ in let (!stdenv.targetPlatform.isWasm && stdenv.targetPlatform.useLLVM or false) "-lunwind" ++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions"; + nixSupport.cc-ldflags = lib.optionals (!stdenv.targetPlatform.isWasm) [ "-L${targetLlvmLibraries.libunwind}/lib" ]; }; clangNoLibcxx = wrapCCWith rec { diff --git a/nixpkgs/pkgs/development/compilers/llvm/15/libcxx/default.nix b/nixpkgs/pkgs/development/compilers/llvm/15/libcxx/default.nix index ed5f48e8c38f..be56770039d8 100644 --- a/nixpkgs/pkgs/development/compilers/llvm/15/libcxx/default.nix +++ b/nixpkgs/pkgs/development/compilers/llvm/15/libcxx/default.nix @@ -56,6 +56,14 @@ stdenv.mkDerivation rec { hash = "sha256-AaM9A6tQ4YAw7uDqCIV4VaiUyLZv+unwcOqbakwW9/k="; relative = "libcxx"; }) + # fix for https://github.com/NixOS/nixpkgs/issues/269548 + # https://github.com/llvm/llvm-project/pull/77218 + (fetchpatch { + name = "darwin-system-libcxxabi-link-flags.patch"; + url = "https://github.com/llvm/llvm-project/commit/c5b89b29ee6e3c444a355fd1cf733ce7ab2e316a.patch"; + hash = "sha256-LNoPg1KCoP8RWxU/AzHR52f4Dww24I9BGQJedMhFxyQ="; + relative = "libcxx"; + }) ] ++ lib.optionals stdenv.hostPlatform.isMusl [ ../../libcxx-0001-musl-hacks.patch ]; diff --git a/nixpkgs/pkgs/development/compilers/llvm/15/llvm/default.nix b/nixpkgs/pkgs/development/compilers/llvm/15/llvm/default.nix index 0b9e83259b2c..4f17678ba14f 100644 --- a/nixpkgs/pkgs/development/compilers/llvm/15/llvm/default.nix +++ b/nixpkgs/pkgs/development/compilers/llvm/15/llvm/default.nix @@ -343,7 +343,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" ( |