mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-06 21:13:40 +00:00
537176760c
Without the change `__FILE__` used in static inline functions in headers embed paths to header files into executable images. For local headers it's not a problem, but for headers in `/nix/store` this causes `-dev` inputs to be retained in runtime closure. Typical examples are `nix` -> `nlonhmann_json` and `pipewire` -> `lttng-ust.dev`. Ideally we would like to use `-fmacro-prefix-map=` feature of `gcc` as: -fmacro-prefix-map=/nix/store/$hash1-nlohmann-json-ver=/nix/store/eeee.eee-nlohmann-json-ver -fmacro-prefix-map=/nix/... In practice it quickly exhausts argument lengtth limit due to `gcc` deficiency: https://gcc.gnu.org/PR111527 Until it;s fixed let's hardcode header mangling if $NIX_STORE variable is present in the environment. Tested as: $ printf "# 0 \"/nix/store/01234567890123456789012345678901-pppppp-vvvvvvv\" \nconst char * f(void) { return __FILE__; }" | NIX_STORE=/nix/store ./gcc/xgcc -Bgcc -x c - -S -o - ... .string "/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-pppppp-vvvvvvv" ... Mangled successfully. |
||
---|---|---|
.. | ||
4.9 | ||
6 | ||
7 | ||
8 | ||
9 | ||
10 | ||
11 | ||
12 | ||
13 | ||
ada-cctools-as-detection-configure.patch | ||
default.nix | ||
fix-bug-80431.patch | ||
gcc-12-gfortran-driving.patch | ||
gcc-12-no-sys-dirs.patch | ||
gfortran-darwin-NXConstStr.patch | ||
gfortran-driving.patch | ||
gnat-cflags-11.patch | ||
gnat-cflags.patch | ||
gnat-darwin-dylib-install-name.patch | ||
libgomp-dont-force-initial-exec.patch | ||
libphobos.patch | ||
libsanitizer-no-cyclades-9.patch | ||
libsanitizer-no-cyclades.patch | ||
libstdc++-netbsd-ctypes.patch | ||
libstdc++-target.patch | ||
no-sys-dirs-riscv-gcc9.patch | ||
no-sys-dirs-riscv.patch | ||
no-sys-dirs.patch | ||
parallel-bconfig.patch | ||
ppc-musl.patch | ||
res_state-not-declared.patch | ||
sigsegv-not-declared.patch | ||
struct-sigaltstack-4.9.patch | ||
struct-sigaltstack.patch | ||
struct-ucontext-4.5.patch | ||
struct-ucontext-4.8.patch | ||
struct-ucontext-libjava.patch | ||
struct-ucontext.patch | ||
update-mcfgthread-patches.sh | ||
use-source-date-epoch.patch |