about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/llvm/15/clang/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/llvm/15/clang/default.nix')
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/15/clang/default.nix9
1 files changed, 7 insertions, 2 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 // {