make-binary-wrapper: Add sanitizer default option

This commit is contained in:
Jacek Galowicz 2021-12-09 15:53:51 +00:00 committed by Tobias Bergkvist
parent d5e028a441
commit bdaa0e2930

View File

@ -607,12 +607,19 @@ in
../build-support/setup-hooks/make-wrapper.sh;
makeBinaryWrapper = let
script = runCommand "make-binary-wrapper.sh" {} ''
substitute ${../build-support/setup-hooks/make-binary-wrapper.sh} $out \
--replace " @CC@ " " ${gcc}/bin/cc "
'';
f = { cc, sanitizers }: let
san = lib.concatMapStringsSep " " (s: "-fsanitize=${s}") sanitizers;
script = runCommand "make-binary-wrapper.sh" {} ''
substitute ${../build-support/setup-hooks/make-binary-wrapper.sh} $out \
--replace " @CC@ " " ${cc}/bin/cc ${san} "
'';
in
makeSetupHook { deps = [ dieHook ]; } script;
in
makeSetupHook { deps = [ dieHook ]; } script;
lib.makeOverridable f {
cc = gcc;
sanitizers = [ "undefined" "address" ];
};
makeModulesClosure = { kernel, firmware, rootModules, allowMissing ? false }:
callPackage ../build-support/kernel/modules-closure.nix {