gdb: fix build w/glibc-2.34

This is a problem that seems to be related to the most recent `gdb`
update in staging from 10.2 to 11.1[1] where `gdb` started to fail
during build with the following message:

    checking for stdlib.h... In file included from /nix/store/vf96x4h90fm7bwf5zvfx8zb82fm1p21j-glibc-2.34-5-dev/include/signal.h:328,
                     from ../../gnulib/import/signal.h:52,
                     from targ-map.c:7:
    targ-map.c:412:17: error: initializer element is not constant
      412 |   { "SIGSTKSZ", SIGSTKSZ, TARGET_SIGSTKSZ },
          |                 ^~~~~~~~
    targ-map.c:412:17: note: (near initialization for 'cb_init_signal_map[18].host_val')

Since I couldn't find any patches in the upstream repo or for other
repos - according to Repology we seem to be the only distro trying to
ship `gdb-11` with `glibc-2.34` - so I found the culprit while bisecting
`gdb` which seems to be commit `a0e674c1`[2].

It seems as if the entire `sim/`-subtree is now built by default if
`--enable-targets=all` is set (which we do for cross debugging). However
it also generates a file called `targ-map.c` referencing `SIGSTKSZ`
assuming that it's const, although this is not the case anymore with
`glibc-2.34`[3].

Since I don't really understand, what precisely is going on in there and
there are no patches available I decided to switch back to the 10.2
behavior here and disable the feature by specifying `--disable-sim` as
configure flag.

Failing Hydra build: https://hydra.nixos.org/build/153893135

[1] 43b96f66ef
[2] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=a0e674c1ce2c877426f8a861c5294c535c5d49e6
[3] see https://sourceware.org/pipermail/libc-alpha/2021-August/129718.html
main
Maximilian Bosch 3 years ago
parent 1b8aa881ea
commit 2357e828f5
No known key found for this signature in database
GPG Key ID: 091DBF4D1FC46B8E
  1. 1
      pkgs/development/tools/misc/gdb/default.nix

@ -92,6 +92,7 @@ stdenv.mkDerivation rec {
"--disable-shared" "--enable-static"
"--with-system-zlib"
"--with-system-readline"
"--disable-sim"
"--with-gmp=${gmp.dev}"
"--with-mpfr=${mpfr.dev}"

Loading…
Cancel
Save