1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-21 13:10:33 +00:00

build-support/grsecurity: simplify the grsecurityOverrider

Adding inputs required by gcc plugins to the ambient environment is sufficient.
This commit is contained in:
Joachim Fasting 2016-04-12 01:23:32 +02:00
parent cee752b8e2
commit 27035365ec

View file

@ -114,16 +114,10 @@ let
"-${grkern.grversion}-${grkern.revision}";
grsecurityOverrider = args: grkern: {
# Apparently as of gcc 4.6, gcc-plugin headers (which are needed by PaX plugins)
# include libgmp headers, so we need these extra tweaks
# As of gcc5 we also need libmpc
buildInputs = args.buildInputs ++ [ pkgs.gmp pkgs.libmpc pkgs.mpfr ];
preConfigure = ''
extraIncludes="-I${pkgs.gmp}/include -I${pkgs.libmpc}/include -I${pkgs.mpfr}/include"
${args.preConfigure or ""}
sed -i "s|-I|$extraIncludes -I|" scripts/gcc-plugin.sh
sed -i "s|HOST_EXTRACFLAGS +=|HOST_EXTRACFLAGS += $extraIncludes|" tools/gcc/Makefile
sed -i "s|HOST_EXTRACXXFLAGS +=|HOST_EXTRACXXFLAGS += $extraIncludes|" tools/gcc/Makefile
# additional build inputs for gcc plugins, required by some PaX/grsec features
nativeBuildInputs = args.nativeBuildInputs ++ (with pkgs; [ gmp libmpc mpfr ]);
preConfigure = args.preConfigure or "" + ''
rm localversion-grsec
echo ${localver grkern} > localversion-grsec
'';