treewide: remove paxutils from stdenv

More then one year ago we removed grsecurity kernels from nixpkgs:
https://github.com/NixOS/nixpkgs/pull/25277

This removes now also paxutils from stdenv.
This commit is contained in:
Jörg Thalheim
2018-12-22 12:55:05 +01:00
parent 0a2efa121d
commit 1b146a8c6f
65 changed files with 17 additions and 687 deletions
+1 -8
View File
@@ -27,7 +27,6 @@
, git
, libgit2
, fetchFromGitHub
, paxctl
, findutils
, makeWrapper
, gnumake
@@ -150,7 +149,7 @@ stdenv.mkDerivation rec {
findutils
makeWrapper
gnumake
] ++ stdenv.lib.optional stdenv.needsPax paxctl;
];
# TODO: Revisit what's propagated and how
propagatedBuildInputs = [
@@ -218,9 +217,6 @@ stdenv.mkDerivation rec {
substituteInPlace swift/utils/build-script-impl \
--replace '/usr/include/c++' "${clang.cc.gcc}/include/c++"
patch -p1 -d swift -i ${./patches/glibc-arch-headers.patch}
'' + stdenv.lib.optionalString stdenv.needsPax ''
patch -p1 -d swift -i ${./patches/build-script-pax.patch}
'' + ''
patch -p1 -d swift -i ${./patches/0001-build-presets-linux-don-t-require-using-Ninja.patch}
patch -p1 -d swift -i ${./patches/0002-build-presets-linux-allow-custom-install-prefix.patch}
patch -p1 -d swift -i ${./patches/0004-build-presets-linux-plumb-extra-cmake-options.patch}
@@ -266,9 +262,6 @@ stdenv.mkDerivation rec {
tar xf $INSTALLABLE_PACKAGE -C $out --strip-components=3 $PREFIX
find $out -type d -empty -delete
paxmark pmr $out/bin/swift
paxmark pmr $out/bin/*
# TODO: Use wrappers to get these on the PATH for swift tools, instead
ln -s ${clang}/bin/* $out/bin/
ln -s ${targetPackages.stdenv.cc.bintools.bintools_bin}/bin/ar $out/bin/ar
@@ -1,33 +0,0 @@
--- swift/utils/build-script-impl 2017-01-23 12:47:20.401326309 -0600
+++ swift-pax/utils/build-script-impl 2017-01-23 13:24:10.339366996 -0600
@@ -1837,6 +1837,17 @@ function set_lldb_xcodebuild_options() {
fi
}
+## XXX: Taken from nixpkgs /pkgs/stdenv/generic/setup.sh
+isELF() {
+ local fn="$1"
+ local fd
+ local magic
+ exec {fd}< "$fn"
+ read -n 4 -u $fd magic
+ exec {fd}<&-
+ if [[ "$magic" =~ ELF ]]; then return 0; else return 1; fi
+}
+
#
# Configure and build each product
#
@@ -2735,6 +2746,12 @@ for host in "${ALL_HOSTS[@]}"; do
fi
call "${CMAKE_BUILD[@]}" "${build_dir}" $(cmake_config_opt ${product}) -- "${BUILD_ARGS[@]}" ${build_targets[@]}
+
+ while IFS= read -r -d $'\0' i; do
+ if ! isELF "$i"; then continue; fi
+ echo "setting pax flags on $i"
+ paxctl -czexm "$i" || true
+ done < <(find "${build_dir}" -executable -type f -wholename "*/bin/*" -print0)
fi
done
done