From 2357e828f5dc9fca7dc9df0e62f210c79f948649 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Thu, 23 Sep 2021 23:37:00 +0200 Subject: [PATCH] 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] 43b96f66ef7a69602b74f9bced64573c11a1df05 [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 --- pkgs/development/tools/misc/gdb/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/tools/misc/gdb/default.nix b/pkgs/development/tools/misc/gdb/default.nix index 5bb5bc0652fe..91947a024d7d 100644 --- a/pkgs/development/tools/misc/gdb/default.nix +++ b/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}"