gcc: use sanitiseHeaderPathsHook

This reduces the WebKitGTK runtime closure size from 1.45 GiB to
1.22 GiB on `aarch64-linux`, as measured by `nix-tree`.
This commit is contained in:
Emily
2025-07-04 12:02:26 +01:00
parent 034f0298f4
commit 1c2dfb8de9
2 changed files with 7 additions and 0 deletions
@@ -12,6 +12,7 @@
gmp,
mpfr,
libmpc,
sanitiseHeaderPathsHook,
libucontext ? null,
libxcrypt ? null,
isSnapshot ? false,
@@ -42,6 +43,10 @@ in
texinfo
which
gettext
# Prevent GCC leaking into the runtime closure of C++ packages
# through headers using `__FILE__`.
sanitiseHeaderPathsHook
]
++ optionals (perl != null) [ perl ]
++ optionals (with stdenv.targetPlatform; isVc4 || isRedox || isSnapshot && flex != null) [ flex ]
@@ -49,6 +49,7 @@
!enablePlugin
|| (stdenv.targetPlatform.isAvr && stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64),
nukeReferences,
sanitiseHeaderPathsHook,
callPackage,
majorMinorVersion,
apple-sdk,
@@ -179,6 +180,7 @@ let
pkgsBuildTarget
profiledCompiler
reproducibleBuild
sanitiseHeaderPathsHook
staticCompiler
stdenv
targetPackages