treewide: remove usages of obsolete pie hardening flag (#449771)

This commit is contained in:
Philip Taron 2025-10-10 15:17:28 -07:00 committed by GitHub
commit eda556d94b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
64 changed files with 7 additions and 167 deletions

View file

@ -32,10 +32,6 @@ stdenv.mkDerivation rec {
faust2lv2 faust2lv2
]; ];
# ld: crtbegin.o: relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a PIE object
# ld: failed to set dynamic section sizes: bad value
hardeningDisable = [ "pie" ];
enableParallelBuilding = true; enableParallelBuilding = true;
dontWrapQtApps = true; dontWrapQtApps = true;

View file

@ -158,8 +158,6 @@ stdenv.mkDerivation rec {
++ lib.concatMap (p: p.buildInputs) enabledPlugins ++ lib.concatMap (p: p.buildInputs) enabledPlugins
++ extraBuildInputs; ++ extraBuildInputs;
hardeningEnable = [ "pie" ];
env.NIX_CFLAGS_COMPILE = env.NIX_CFLAGS_COMPILE =
"-I${python}/include/${python.libPrefix}" "-I${python}/include/${python.libPrefix}"
# Fix '_res_9_init: undefined symbol' error # Fix '_res_9_init: undefined symbol' error

View file

@ -150,9 +150,6 @@ stdenv.mkDerivation (finalAttrs: {
# Linking fails without this # Linking fails without this
hardeningDisable = [ "format" ]; hardeningDisable = [ "format" ];
# Pie needs to be enabled or else it segfaults
hardeningEnable = [ "pie" ];
preConfigure = '' preConfigure = ''
# mirror 2ship's stb # mirror 2ship's stb
mkdir stb mkdir stb

View file

@ -16,7 +16,6 @@ stdenv.mkDerivation {
hash = "sha256-rRJrtCcgfbqC/4qQiTVeUUcPqoJlNfitYRqIO58AmpA="; hash = "sha256-rRJrtCcgfbqC/4qQiTVeUUcPqoJlNfitYRqIO58AmpA=";
}; };
hardeningEnable = [ "pie" ];
preBuild = '' preBuild = ''
# pipe2() is only exposed with _GNU_SOURCE # pipe2() is only exposed with _GNU_SOURCE
# Upstream makefile explicitly uses -O3 to improve SHA-3 performance # Upstream makefile explicitly uses -O3 to improve SHA-3 performance

View file

@ -62,8 +62,6 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true; enableParallelBuilding = true;
doCheck = true; doCheck = true;
hardeningEnable = lib.optionals (!stdenv.hostPlatform.isDarwin) [ "pie" ];
passthru.tests = { passthru.tests = {
inherit (nixosTests) chrony chrony-ptp; inherit (nixosTests) chrony chrony-ptp;
}; };

View file

@ -53,8 +53,6 @@ stdenv.mkDerivation rec {
"PKG_CONFIG=${buildPackages.pkg-config}/bin/${buildPackages.pkg-config.targetPrefix}pkg-config" "PKG_CONFIG=${buildPackages.pkg-config}/bin/${buildPackages.pkg-config.targetPrefix}pkg-config"
]; ];
hardeningEnable = [ "pie" ];
postBuild = lib.optionalString stdenv.hostPlatform.isLinux '' postBuild = lib.optionalString stdenv.hostPlatform.isLinux ''
make -C contrib/lease-tools make -C contrib/lease-tools
''; '';

View file

@ -26,10 +26,6 @@ stdenv.mkDerivation rec {
bash bash
]; ];
# ld: /nix/store/*-gcc-14-20241116/lib/gcc/x86_64-unknown-linux-gnu/14.2.1/crtbegin.o:
# relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a PIE object
hardeningDisable = [ "pie" ];
dontWrapQtApps = true; dontWrapQtApps = true;
buildPhase = '' buildPhase = ''

View file

@ -32,8 +32,6 @@ stdenv.mkDerivation rec {
libopus libopus
]; ];
hardeningEnable = [ "pie" ];
meta = { meta = {
description = "Server software for streaming multimedia"; description = "Server software for streaming multimedia";
mainProgram = "icecast"; mainProgram = "icecast";

View file

@ -35,8 +35,6 @@ stdenv.mkDerivation (finalAttrs: {
"DESTROOT=$(out)" "DESTROOT=$(out)"
]; ];
hardeningEnable = [ "pie" ];
unpackCmd = '' unpackCmd = ''
mkdir cron mkdir cron
pushd cron pushd cron

View file

@ -42,7 +42,6 @@ stdenv.mkDerivation rec {
"format" "format"
"pic" "pic"
"relro" "relro"
"pie"
]; ];
# Prevent kexec-tools from using uname to detect target, which is wrong in # Prevent kexec-tools from using uname to detect target, which is wrong in

View file

@ -57,8 +57,6 @@ stdenv.mkDerivation (finalAttrs: {
enableParallelBuilding = true; enableParallelBuilding = true;
hardeningEnable = lib.optionals (!stdenv.hostPlatform.isDarwin) [ "pie" ];
# darwin currently lacks a pure `pgrep` which is extensively used here # darwin currently lacks a pure `pgrep` which is extensively used here
doCheck = !stdenv.hostPlatform.isDarwin; doCheck = !stdenv.hostPlatform.isDarwin;
nativeCheckInputs = [ nativeCheckInputs = [

View file

@ -38,8 +38,6 @@ stdenv.mkDerivation rec {
# Note: tcmalloc and mimalloc are also supported (and normal malloc) # Note: tcmalloc and mimalloc are also supported (and normal malloc)
cmakeFlags = lib.optional enableJemalloc "-DUSE_ALTERNATIVE_MALLOC=jemalloc"; cmakeFlags = lib.optional enableJemalloc "-DUSE_ALTERNATIVE_MALLOC=jemalloc";
hardeningDisable = lib.optional stdenv.hostPlatform.isMusl "pie";
meta = with lib; { meta = with lib; {
description = "Lightweight high-performance multi-threaded web server"; description = "Lightweight high-performance multi-threaded web server";
mainProgram = "lwan"; mainProgram = "lwan";

View file

@ -25,8 +25,6 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true; enableParallelBuilding = true;
hardeningEnable = [ "pie" ];
configureFlags = [ configureFlags = [
"--enable-default-colors" "--enable-default-colors"
"--enable-widec" "--enable-widec"

View file

@ -25,8 +25,6 @@ stdenv.mkDerivation rec {
libevent libevent
]; ];
hardeningEnable = [ "pie" ];
env.NIX_CFLAGS_COMPILE = toString ( env.NIX_CFLAGS_COMPILE = toString (
[ "-Wno-error=deprecated-declarations" ] ++ lib.optional stdenv.hostPlatform.isDarwin "-Wno-error" [ "-Wno-error=deprecated-declarations" ] ++ lib.optional stdenv.hostPlatform.isDarwin "-Wno-error"
); );

View file

@ -21,8 +21,6 @@ buildGoModule rec {
buildInputs = lib.optional stdenv.hostPlatform.isLinux libX11; buildInputs = lib.optional stdenv.hostPlatform.isLinux libX11;
hardeningEnabled = [ "pie" ];
meta = { meta = {
description = "Automated WireGuard® Management Client"; description = "Automated WireGuard® Management Client";
mainProgram = "netclient"; mainProgram = "netclient";

View file

@ -45,8 +45,6 @@ stdenv.mkDerivation rec {
libcap libcap
]; ];
hardeningEnable = [ "pie" ];
postInstall = '' postInstall = ''
rm -rf $out/share/doc rm -rf $out/share/doc
''; '';

View file

@ -100,7 +100,6 @@ stdenv.mkDerivation rec {
++ lib.optional withTLSRPT libtlsrpt; ++ lib.optional withTLSRPT libtlsrpt;
hardeningDisable = [ "format" ]; hardeningDisable = [ "format" ];
hardeningEnable = [ "pie" ];
patches = [ patches = [
./postfix-script-shell.patch ./postfix-script-shell.patch

View file

@ -74,8 +74,6 @@ stdenv.mkDerivation (finalAttrs: {
] ]
++ lib.optional gamemodeSupport gamemode; ++ lib.optional gamemodeSupport gamemode;
hardeningEnable = lib.optionals stdenv.hostPlatform.isLinux [ "pie" ];
cmakeFlags = [ cmakeFlags = [
# downstream branding # downstream branding
(lib.cmakeFeature "Launcher_BUILD_PLATFORM" "nixpkgs") (lib.cmakeFeature "Launcher_BUILD_PLATFORM" "nixpkgs")

View file

@ -68,8 +68,6 @@ stdenv.mkDerivation (finalAttrs: {
enableParallelBuilding = true; enableParallelBuilding = true;
hardeningEnable = lib.optionals (!stdenv.hostPlatform.isDarwin) [ "pie" ];
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isClang [ "-std=c11" ]); env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isClang [ "-std=c11" ]);
# darwin currently lacks a pure `pgrep` which is extensively used here # darwin currently lacks a pure `pgrep` which is extensively used here

View file

@ -66,8 +66,6 @@ stdenv.mkDerivation (finalAttrs: {
enableParallelBuilding = true; enableParallelBuilding = true;
hardeningEnable = lib.optionals (!stdenv.hostPlatform.isDarwin) [ "pie" ];
env.NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isFreeBSD "-lexecinfo"; env.NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isFreeBSD "-lexecinfo";
# darwin currently lacks a pure `pgrep` which is extensively used here # darwin currently lacks a pure `pgrep` which is extensively used here

View file

@ -56,8 +56,6 @@ stdenv.mkDerivation rec {
}) })
]; ];
hardeningEnable = [ "pie" ];
nativeBuildInputs = [ nativeBuildInputs = [
cmake cmake
pkg-config pkg-config

View file

@ -104,10 +104,6 @@ stdenv.mkDerivation (finalAttrs: {
fi fi
''; '';
# ${src}/support/cpp/gcc/Makefile.in states:
# We don't want to compile the compilers with -fPIE, it make PCH fail.
hardeningDisable = [ "pie" ];
meta = { meta = {
homepage = "https://sdcc.sourceforge.net/"; homepage = "https://sdcc.sourceforge.net/";
description = "Small Device C Compiler"; description = "Small Device C Compiler";

View file

@ -65,7 +65,6 @@ stdenv.mkDerivation (finalAttrs: {
hardeningDisable = [ hardeningDisable = [
"fortify" "fortify"
"pic" "pic"
"pie" # ld: warning: creating DT_TEXTREL in a PIE (and more)
"stackprotector" "stackprotector"
]; ];

View file

@ -15,8 +15,6 @@ stdenv.mkDerivation {
sha256 = "1sj7a77isc2jmh7gw2naw9l9366kjx6jb909h7spj7daxdwvji8f"; sha256 = "1sj7a77isc2jmh7gw2naw9l9366kjx6jb909h7spj7daxdwvji8f";
}; };
hardeningEnable = [ "pie" ];
preConfigure = '' preConfigure = ''
makeFlags=( "PREFIX=$out" ) makeFlags=( "PREFIX=$out" )
''; '';

View file

@ -38,8 +38,6 @@ stdenv.mkDerivation rec {
readline readline
]; ];
hardeningEnable = [ "pie" ];
enableParallelBuilding = true; enableParallelBuilding = true;
nativeCheckInputs = [ nativeCheckInputs = [

View file

@ -40,8 +40,6 @@ stdenv.mkDerivation {
hash = "sha256-KbeY667Y/ZPUuRIGYOZMMAuVEVJ7Kn9UDUSThX5zfII="; hash = "sha256-KbeY667Y/ZPUuRIGYOZMMAuVEVJ7Kn9UDUSThX5zfII=";
}; };
hardeningEnable = [ "pie" ];
configurePhase = '' configurePhase = ''
runHook preConfigure runHook preConfigure
sh configure.sh --prefix=/ sh configure.sh --prefix=/

View file

@ -24,8 +24,6 @@ buildGoModule rec {
"-w" "-w"
]; ];
hardeningEnable = lib.optionals (!stdenv.hostPlatform.isDarwin) [ "pie" ];
passthru.updateScript = nix-update-script { }; passthru.updateScript = nix-update-script { };
meta = { meta = {

View file

@ -83,7 +83,6 @@ stdenv.mkDerivation {
hardeningDisable = [ hardeningDisable = [
"pic" "pic"
"pie" # MBR gets too big with PIE
"stackprotector" "stackprotector"
"fortify" "fortify"
]; ];

View file

@ -41,7 +41,6 @@ stdenv.mkDerivation rec {
]; ];
hardeningDisable = [ hardeningDisable = [
"pie"
"stackprotector" "stackprotector"
]; ];

View file

@ -64,8 +64,6 @@ stdenv.mkDerivation (finalAttrs: {
enableParallelBuilding = true; enableParallelBuilding = true;
hardeningEnable = lib.optionals (!stdenv.hostPlatform.isDarwin) [ "pie" ];
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isClang [ "-std=c11" ]); env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isClang [ "-std=c11" ]);
# darwin currently lacks a pure `pgrep` which is extensively used here # darwin currently lacks a pure `pgrep` which is extensively used here

View file

@ -80,9 +80,6 @@ stdenv.mkDerivation rec {
"FPC=${startFPC}/bin/fpc" "FPC=${startFPC}/bin/fpc"
]; ];
# disabled by default in fpcsrc/compiler/llvm/agllvm.pas
hardeningDisable = [ "pie" ];
installFlags = [ "INSTALL_PREFIX=\${out}" ]; installFlags = [ "INSTALL_PREFIX=\${out}" ];
postInstall = '' postInstall = ''

View file

@ -234,7 +234,6 @@ pipe
hardeningDisable = [ hardeningDisable = [
"format" "format"
"pie"
"stackclashprotection" "stackclashprotection"
]; ];

View file

@ -474,13 +474,6 @@ stdenv.mkDerivation {
"$out/bin/ghc-pkg" --package-db="$package_db" recache "$out/bin/ghc-pkg" --package-db="$package_db" recache
''; '';
# GHC cannot currently produce outputs that are ready for `-pie` linking.
# Thus, disable `pie` hardening, otherwise `recompile with -fPIE` errors appear.
# See:
# * https://github.com/NixOS/nixpkgs/issues/129247
# * https://gitlab.haskell.org/ghc/ghc/-/issues/19580
hardeningDisable = [ "pie" ];
doInstallCheck = true; doInstallCheck = true;
installCheckPhase = '' installCheckPhase = ''
# Sanity check, can ghc create executables? # Sanity check, can ghc create executables?

View file

@ -438,13 +438,6 @@ stdenv.mkDerivation {
"$out/bin/ghc-pkg" --package-db="$package_db" recache "$out/bin/ghc-pkg" --package-db="$package_db" recache
''; '';
# GHC cannot currently produce outputs that are ready for `-pie` linking.
# Thus, disable `pie` hardening, otherwise `recompile with -fPIE` errors appear.
# See:
# * https://github.com/NixOS/nixpkgs/issues/129247
# * https://gitlab.haskell.org/ghc/ghc/-/issues/19580
hardeningDisable = [ "pie" ];
doInstallCheck = true; doInstallCheck = true;
installCheckPhase = '' installCheckPhase = ''
# Sanity check, can ghc create executables? # Sanity check, can ghc create executables?

View file

@ -417,13 +417,6 @@ stdenv.mkDerivation {
"$out/bin/ghc-pkg" --package-db="$package_db" recache "$out/bin/ghc-pkg" --package-db="$package_db" recache
''; '';
# GHC cannot currently produce outputs that are ready for `-pie` linking.
# Thus, disable `pie` hardening, otherwise `recompile with -fPIE` errors appear.
# See:
# * https://github.com/NixOS/nixpkgs/issues/129247
# * https://gitlab.haskell.org/ghc/ghc/-/issues/19580
hardeningDisable = [ "pie" ];
doInstallCheck = true; doInstallCheck = true;
installCheckPhase = '' installCheckPhase = ''
# Sanity check, can ghc create executables? # Sanity check, can ghc create executables?

View file

@ -432,13 +432,6 @@ stdenv.mkDerivation {
"$out/bin/ghc-pkg" --package-db="$package_db" recache "$out/bin/ghc-pkg" --package-db="$package_db" recache
''; '';
# GHC cannot currently produce outputs that are ready for `-pie` linking.
# Thus, disable `pie` hardening, otherwise `recompile with -fPIE` errors appear.
# See:
# * https://github.com/NixOS/nixpkgs/issues/129247
# * https://gitlab.haskell.org/ghc/ghc/-/issues/19580
hardeningDisable = [ "pie" ];
doInstallCheck = true; doInstallCheck = true;
installCheckPhase = '' installCheckPhase = ''
# Sanity check, can ghc create executables? # Sanity check, can ghc create executables?

View file

@ -780,14 +780,8 @@ stdenv.mkDerivation (
checkTarget = "test"; checkTarget = "test";
# GHC cannot currently produce outputs that are ready for `-pie` linking.
# Thus, disable `pie` hardening, otherwise `recompile with -fPIE` errors appear.
# See:
# * https://github.com/NixOS/nixpkgs/issues/129247
# * https://gitlab.haskell.org/ghc/ghc/-/issues/19580
hardeningDisable = [ hardeningDisable = [
"format" "format"
"pie"
]; ];
# big-parallel allows us to build with more than 2 cores on # big-parallel allows us to build with more than 2 cores on

View file

@ -600,14 +600,8 @@ stdenv.mkDerivation (
checkTarget = "test"; checkTarget = "test";
# GHC cannot currently produce outputs that are ready for `-pie` linking.
# Thus, disable `pie` hardening, otherwise `recompile with -fPIE` errors appear.
# See:
# * https://github.com/NixOS/nixpkgs/issues/129247
# * https://gitlab.haskell.org/ghc/ghc/-/issues/19580
hardeningDisable = [ hardeningDisable = [
"format" "format"
"pie"
]; ];
# big-parallel allows us to build with more than 2 cores on # big-parallel allows us to build with more than 2 cores on

View file

@ -134,8 +134,7 @@ stdenv.mkDerivation (
]; ];
# x86_64-unknown-linux-musl-ld: -r and -pie may not be used together # x86_64-unknown-linux-musl-ld: -r and -pie may not be used together
hardeningDisable = hardeningDisable =
lib.optional (lib.versionAtLeast version "4.09" && stdenv.hostPlatform.isMusl) "pie" lib.optional (lib.versionAtLeast version "5.0" && stdenv.cc.isClang) "strictoverflow"
++ lib.optional (lib.versionAtLeast version "5.0" && stdenv.cc.isClang) "strictoverflow"
++ lib.optionals (args ? hardeningDisable) args.hardeningDisable; ++ lib.optionals (args ? hardeningDisable) args.hardeningDisable;
# Older versions have some race: # Older versions have some race:

View file

@ -39,7 +39,6 @@ let
static_gtest = gtest.overrideAttrs (old: { static_gtest = gtest.overrideAttrs (old: {
dontDisableStatic = true; dontDisableStatic = true;
disableHardening = [ "pie" ];
cmakeFlags = old.cmakeFlags ++ [ "-DBUILD_SHARED_LIBS=OFF" ]; cmakeFlags = old.cmakeFlags ++ [ "-DBUILD_SHARED_LIBS=OFF" ];
}); });

View file

@ -730,13 +730,7 @@ lib.fix (
# package specifies `hardeningDisable`. # package specifies `hardeningDisable`.
hardeningDisable = hardeningDisable =
lib.optionals (args ? hardeningDisable) hardeningDisable lib.optionals (args ? hardeningDisable) hardeningDisable
++ lib.optional (ghc.isHaLVM or false) "all" ++ lib.optional (ghc.isHaLVM or false) "all";
# Static libraries (ie. all of pkgsStatic.haskellPackages) fail to build
# because by default Nix adds `-pie` to the linker flags: this
# conflicts with the `-r` and `-no-pie` flags added by GHC (see
# https://gitlab.haskell.org/ghc/ghc/-/issues/19580). hardeningDisable
# changes the default Nix behavior regarding adding "hardening" flags.
++ lib.optional enableStaticLibraries "pie";
configurePhase = '' configurePhase = ''
runHook preConfigure runHook preConfigure

View file

@ -122,11 +122,6 @@ stdenv.mkDerivation {
cd builddir cd builddir
''; '';
# ;; Loading file ../src/defmacro.lisp ...
# *** - handle_fault error2 ! address = 0x8 not in [0x1000000c0000,0x1000000c0000) !
# SIGSEGV cannot be cured. Fault address = 0x8.
hardeningDisable = [ "pie" ];
doCheck = true; doCheck = true;
postInstall = lib.optionalString (withModules != [ ]) '' postInstall = lib.optionalString (withModules != [ ]) ''

View file

@ -584,9 +584,6 @@ stdenv.mkDerivation (finalAttrs: {
export CFLAGS_NODIST="-fno-semantic-interposition" export CFLAGS_NODIST="-fno-semantic-interposition"
''; '';
# Our aarch64-linux bootstrap files lack Scrt1.o, which fails the config test
hardeningEnable = lib.optionals (!withMinimalDeps && !stdenv.hostPlatform.isAarch64) [ "pie" ];
setupHook = python-setup-hook sitePackages; setupHook = python-setup-hook sitePackages;
postInstall = postInstall =

View file

@ -48,8 +48,6 @@ stdenv.mkDerivation (finalAttrs: {
sourceRoot=$(readlink -e "./libgcc") sourceRoot=$(readlink -e "./libgcc")
''; '';
hardeningDisable = [ "pie" ];
preConfigure = '' preConfigure = ''
# Drop in libiberty, as external builds are not expected # Drop in libiberty, as external builds are not expected
cd "$buildRoot" cd "$buildRoot"

View file

@ -58,12 +58,11 @@ in
makeFlagsArray+=("bindir=$bin/bin" "sbindir=$bin/sbin" "rootsbindir=$bin/sbin") makeFlagsArray+=("bindir=$bin/bin" "sbindir=$bin/sbin" "rootsbindir=$bin/sbin")
''; '';
# The pie, stackprotector and fortify hardening flags are autodetected by # The stackprotector and fortify hardening flags are autodetected by
# glibc and enabled by default if supported. Setting it for every gcc # glibc and enabled by default if supported. Setting it for every gcc
# invocation does not work. # invocation does not work.
hardeningDisable = [ hardeningDisable = [
"fortify" "fortify"
"pie"
"stackprotector" "stackprotector"
"strictflexarrays3" "strictflexarrays3"
]; ];

View file

@ -24,9 +24,6 @@ buildDunePackage rec {
export sourceRoot=$PWD export sourceRoot=$PWD
''; '';
# x86_64-unknown-linux-musl-ld: -r and -pie may not be used together
hardeningDisable = lib.optional stdenv.hostPlatform.isStatic "pie";
nativeBuildInputs = [ nativeBuildInputs = [
menhir menhir
odoc odoc

View file

@ -35,9 +35,6 @@ buildGoModule (finalAttrs: {
doCheck = false; doCheck = false;
# /nix/store/.../bin/ld: internal/mkcw/embed/entrypoint_amd64.o: relocation R_X86_64_32S against `.rodata.1' can not be used when making a PIE object; recompile with -fPIE
hardeningDisable = [ "pie" ];
nativeBuildInputs = [ nativeBuildInputs = [
go-md2man go-md2man
installShellFiles installShellFiles

View file

@ -179,7 +179,6 @@ stdenv.mkDerivation {
hardeningDisable = [ hardeningDisable = [
"format" "format"
"pie"
]; ];
configurePlatforms = [ configurePlatforms = [

View file

@ -209,7 +209,6 @@ stdenv.mkDerivation (finalAttrs: {
hardeningDisable = [ hardeningDisable = [
"format" "format"
"pie"
]; ];
configurePlatforms = [ configurePlatforms = [

View file

@ -31,9 +31,6 @@ stdenv.mkDerivation (finalAttrs: {
]; ];
strictDeps = true; strictDeps = true;
# x86_64-unknown-linux-musl-ld: -r and -pie may not be used together
hardeningDisable = lib.optional stdenv.hostPlatform.isStatic "pie";
configurePhase = '' configurePhase = ''
runHook preConfigure runHook preConfigure

View file

@ -69,7 +69,6 @@ stdenv.mkDerivation rec {
hardeningDisable = [ hardeningDisable = [
"format" "format"
"pie"
] ]
++ lib.optionals enableStatic [ "fortify" ]; ++ lib.optionals enableStatic [ "fortify" ];

View file

@ -573,7 +573,6 @@ lib.makeOverridable (
"fortify" "fortify"
"stackprotector" "stackprotector"
"pic" "pic"
"pie"
]; ];
makeFlags = [ makeFlags = [

View file

@ -254,8 +254,6 @@ stdenv.mkDerivation {
--replace-fail '@nixStoreDirLen@' "''${#NIX_STORE}" --replace-fail '@nixStoreDirLen@' "''${#NIX_STORE}"
'' postPatch; '' postPatch;
hardeningEnable = lib.optional (!stdenv.hostPlatform.isDarwin) "pie";
enableParallelBuilding = true; enableParallelBuilding = true;
preInstall = '' preInstall = ''

View file

@ -137,8 +137,6 @@ stdenv.mkDerivation rec {
preConfigure = (lib.concatMapStringsSep "\n" (mod: mod.preConfigure or "") modules); preConfigure = (lib.concatMapStringsSep "\n" (mod: mod.preConfigure or "") modules);
hardeningEnable = optional (!stdenv.hostPlatform.isDarwin) "pie";
enableParallelBuilding = true; enableParallelBuilding = true;
postInstall = '' postInstall = ''

View file

@ -169,8 +169,6 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true; enableParallelBuilding = true;
hardeningEnable = [ "pie" ];
meta = with lib; { meta = with lib; {
description = "Scalable, high-performance, open source NoSQL database"; description = "Scalable, high-performance, open source NoSQL database";
homepage = "http://www.mongodb.org"; homepage = "http://www.mongodb.org";

View file

@ -52,8 +52,6 @@ stdenv.mkDerivation (finalAttrs: {
__structuredAttrs = true; __structuredAttrs = true;
hardeningEnable = lib.optionals (!stdenv.cc.isClang) [ "pie" ];
outputs = [ outputs = [
"out" "out"
"dev" "dev"

View file

@ -151,7 +151,6 @@ let
"nostrictaliasing" "nostrictaliasing"
"pacret" "pacret"
"pic" "pic"
"pie"
"relro" "relro"
"stackprotector" "stackprotector"
"glibcxxassertions" "glibcxxassertions"
@ -439,7 +438,7 @@ let
else else
subtractLists hardeningDisable' (defaultHardeningFlags ++ hardeningEnable); subtractLists hardeningDisable' (defaultHardeningFlags ++ hardeningEnable);
# hardeningDisable additionally supports "all". # hardeningDisable additionally supports "all".
erroneousHardeningFlags = subtractLists knownHardeningFlags ( erroneousHardeningFlags = subtractLists (knownHardeningFlags ++ [ "pie" ]) (
hardeningEnable ++ remove "all" hardeningDisable hardeningEnable ++ remove "all" hardeningDisable
); );
@ -637,7 +636,9 @@ let
else else
null null
} = } =
builtins.concatStringsSep " " enabledHardeningOptions; lib.warnIf ((builtins.elem "pie" hardeningEnable) || (builtins.elem "pie" hardeningDisable))
"The 'pie' hardening flag has been removed in favor of enabling PIE by default in compilers and should no longer be used. PIE can be disabled with the -no-pie compiler flag, but this is usually not necessary as most build systems pass this if needed. Usage of the 'pie' hardening flag will become an error in future."
(builtins.concatStringsSep " " enabledHardeningOptions);
# TODO: remove platform condition # TODO: remove platform condition
# Enabling this check could be a breaking change as it requires to edit nix.conf # Enabling this check could be a breaking change as it requires to edit nix.conf

View file

@ -696,7 +696,6 @@ nameDrvAfterAttrName (
relROExplicitDisabled = brokenIf true ( relROExplicitDisabled = brokenIf true (
checkTestBin checkTestBin
(f2exampleWithStdEnv stdenv { (f2exampleWithStdEnv stdenv {
hardeningDisable = [ "pie" ];
}) })
{ {
ignoreRelRO = false; ignoreRelRO = false;
@ -1202,7 +1201,6 @@ nameDrvAfterAttrName (
hardeningDisable = [ "all" ]; hardeningDisable = [ "all" ];
hardeningEnable = [ hardeningEnable = [
"fortify" "fortify"
"pie"
]; ];
}; };
in in

View file

@ -136,8 +136,6 @@ stdenv.mkDerivation (finalAttrs: {
enableParallelBuilding = true; enableParallelBuilding = true;
hardeningEnable = [ "pie" ];
doCheck = false; doCheck = false;
enableParallelChecking = false; enableParallelChecking = false;
nativeCheckInputs = [ nativeCheckInputs = [

View file

@ -32,8 +32,6 @@ stdenv.mkDerivation rec {
}) })
]; ];
hardeningEnable = [ "pie" ];
nativeBuildInputs = [ nativeBuildInputs = [
autoreconfHook autoreconfHook
w3m w3m

View file

@ -373,7 +373,6 @@ stdenv.mkDerivation (finalAttrs: {
# fortify breaks the build with lto and musl for some reason # fortify breaks the build with lto and musl for some reason
++ lib.optional stdenv.hostPlatform.isMusl "fortify"; ++ lib.optional stdenv.hostPlatform.isMusl "fortify";
# hardeningEnable = lib.optionals (!stdenv.hostPlatform.isDarwin) [ "pie" ];
separateDebugInfo = stdenv.hostPlatform.isLinux && !enableStatic; separateDebugInfo = stdenv.hostPlatform.isLinux && !enableStatic;
enableParallelBuilding = true; enableParallelBuilding = true;

View file

@ -101,8 +101,6 @@ stdenv.mkDerivation (finalAttrs: {
"doc" "doc"
]; ];
hardeningEnable = lib.optionals (!stdenv.hostPlatform.isDarwin) [ "pie" ];
hardeningDisable = [ hardeningDisable = [
"shadowstack" "shadowstack"
] ]

View file

@ -150,7 +150,6 @@ let
pkg-config pkg-config
]; ];
separateDebugInfo = !stdenv.hostPlatform.isStatic; separateDebugInfo = !stdenv.hostPlatform.isStatic;
hardeningDisable = lib.optional stdenv.hostPlatform.isStatic "pie";
}; };
mesonLibraryLayer = finalAttrs: prevAttrs: { mesonLibraryLayer = finalAttrs: prevAttrs: {

View file

@ -32,12 +32,6 @@ stdenv.mkDerivation rec {
hash = "sha256-+MNIZQnecFGSE4sA7ywAu73Q6Eww1cB9I/xzqdxMycw="; hash = "sha256-+MNIZQnecFGSE4sA7ywAu73Q6Eww1cB9I/xzqdxMycw=";
}; };
# PIE is incompatible with the "persistent malloc" ("pma") feature.
# While build system attempts to pass -no-pie to gcc. nixpkgs' `ld`
# wrapped still passes `-pie` flag to linker and breaks linkage.
# Let's disable "pie" until `ld` is fixed to do the right thing.
hardeningDisable = [ "pie" ];
# When we do build separate interactive version, it makes sense to always include man. # When we do build separate interactive version, it makes sense to always include man.
outputs = [ outputs = [
"out" "out"