diff options
| author | Sergei Trofimovich <slyich@gmail.com> | 2023-09-23 20:17:11 +0100 |
|---|---|---|
| committer | Sergei Trofimovich <slyich@gmail.com> | 2023-10-04 21:16:13 +0100 |
| commit | 537176760c8fab063ba1389d83b7b2da3857ee99 (patch) | |
| tree | 46c5c8618871e7a26a8a69eefaa21429a3451c62 /pkgs/development/python-modules/httpserver | |
| parent | 9155f8dc6e9bfbe77a8552735ae0b9d74a72714f (diff) | |
gcc12, gcc13: always mangle __FILE__ into invalid store path
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.
Diffstat (limited to 'pkgs/development/python-modules/httpserver')
0 files changed, 0 insertions, 0 deletions
