mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
Merge pull request #29483 from veprbl/hardening_unsupported_flags
cc-wrapper: allow compilers to specify unsupported hardening modes
This commit is contained in:
commit
64965e8224
5 changed files with 13 additions and 12 deletions
|
@ -292,7 +292,7 @@ stdenv.mkDerivation {
|
|||
## Hardening support
|
||||
##
|
||||
|
||||
export hardening_unsupported_flags=""
|
||||
export hardening_unsupported_flags="${builtins.concatStringsSep " " (cc.hardeningUnsupportedFlags or [])}"
|
||||
''
|
||||
|
||||
+ optionalString hostPlatform.isCygwin ''
|
||||
|
|
|
@ -422,8 +422,11 @@ stdenv.mkDerivation ({
|
|||
"-Wl,${libpthreadCross.TARGET_LDFLAGS}"
|
||||
]);
|
||||
|
||||
passthru = { inherit langC langCC langAda langFortran langVhdl
|
||||
enableMultilib version; isGNU = true; };
|
||||
passthru = {
|
||||
inherit langC langCC langAda langFortran langVhdl enableMultilib version;
|
||||
isGNU = true;
|
||||
hardeningUnsupportedFlags = [ "stackprotector" ];
|
||||
};
|
||||
|
||||
enableParallelBuilding = !langAda;
|
||||
|
||||
|
|
|
@ -507,8 +507,11 @@ stdenv.mkDerivation ({
|
|||
"-Wl,${libpthreadCross.TARGET_LDFLAGS}"
|
||||
]);
|
||||
|
||||
passthru =
|
||||
{ inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; isGNU = true; };
|
||||
passthru = {
|
||||
inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version;
|
||||
isGNU = true;
|
||||
hardeningUnsupportedFlags = [ "stackprotector" ];
|
||||
};
|
||||
|
||||
inherit enableParallelBuilding enableMultilib;
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ stdenv.mkDerivation {
|
|||
# GCC_INSTALL_PREFIX points here, so just use it even though it may not
|
||||
# actually be a gcc
|
||||
gcc = stdenv.cc.cc;
|
||||
hardeningUnsupportedFlags = [ "stackprotector" ];
|
||||
};
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
|
|
@ -5543,13 +5543,7 @@ with pkgs;
|
|||
clang_38 = llvmPackages_38.clang;
|
||||
clang_37 = llvmPackages_37.clang;
|
||||
clang_35 = wrapCC llvmPackages_35.clang;
|
||||
clang_34 = (wrapCC llvmPackages_34.clang).override {
|
||||
# Default cc-wrapper's hardening flags don't work with clang-3.4,
|
||||
# so just remove it entirely for this wrapper.
|
||||
extraBuildCommands = ''
|
||||
:> $out/nix-support/add-hardening.sh
|
||||
'';
|
||||
};
|
||||
clang_34 = wrapCC llvmPackages_34.clang;
|
||||
|
||||
clang-tools = callPackage ../development/tools/clang-tools { };
|
||||
|
||||
|
|
Loading…
Reference in a new issue