nixpkgs/pkgs/development/compilers/gcc/patches
Sergei Trofimovich be41f86a80 gcc: amend __FILE__ mangling patch to only affect -fmacro-prefix-map=
THe initial intent of the change was to only affect
`-fmacro-prefix-map=` option.

Due to the bug of `if (maps == macro_prefix_maps)` condition of initial
setting all three of:

    static file_prefix_map *macro_prefix_maps; /* -fmacro-prefix-map  */
    static file_prefix_map *debug_prefix_maps; /* -fdebug-prefix-map  */
    static file_prefix_map *profile_prefix_maps; /* -fprofile-prefix-map  */

matches the comparison and applied the mangling (as long as on options
were passed into those before).

As a result not only (intended) `__FILE__` embedding happened in `.data`
section, but also (unintended) debugging symbols (`-fdebug-prefix-map`)
and profiling data (`-fprofile-prefix-map`) were broken by mangling.

The patch update fixes it by explicitly passing a boolean that controls
the mangling in a single call site relevant to `-fmacro-prefix-map`.

While at it fixed `int / size_t` mismatch that caused build failure on
upcoming `gcc-14`.

Tested as:

- `nix` still has no `nlohmann_json` retention
- `gdb` can now resolve `stdc++` debugging symbols in templates
- `--coverage` has working source file paths
2024-02-02 20:59:41 +00:00
..
4.9
6
7
8
9
10
11
12
13
ada-cctools-as-detection-configure.patch
clang-genconditions.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
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-ucontext-4.8.patch
struct-ucontext.patch
update-mcfgthread-patches.sh
use-source-date-epoch.patch