gdb: fix w/musl (#164766)

* gdb: fix on musl, sys/termios.h -> termios.h

* gdb: grab upstream patch to fix w/musl

Fixes instances of PAGESIZE/PAGE_SIZE that conflict
with header-provided definitions.

I was concerned about stability (IIRC version in these can change?)
but already risking that with the gcc-12 patch, so this is probably
okay.

Stale/unstable URL's are especially important to avoid on less
commonly used combinations such as w/musl, but also don't
want to bloat the tree :).

Risk is low, as this will be included in next update.
main
Will Dietz 2 years ago committed by GitHub
parent 17a43eefb8
commit 47363ef04f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      pkgs/development/tools/misc/gdb/default.nix

@ -37,6 +37,8 @@ stdenv.mkDerivation rec {
postPatch = if stdenv.isDarwin then ''
substituteInPlace gdb/darwin-nat.c \
--replace '#include "bfd/mach-o.h"' '#include "mach-o.h"'
'' else if stdenv.hostPlatform.isMusl then ''
substituteInPlace sim/ppc/emul_unix.c --replace sys/termios.h termios.h
'' else null;
patches = [
@ -50,7 +52,11 @@ stdenv.mkDerivation rec {
})
] ++ lib.optionals stdenv.isDarwin [
./darwin-target-match.patch
];
] ++ lib.optional stdenv.hostPlatform.isMusl (fetchpatch {
name = "musl-fix-pagesize-page_size.patch";
url = "https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=fd0975b96b16d96010dce439af9620d3dfb65426";
hash = "sha256-M3U7uIIFJnYu0g8/sMLJPhm02q7cGOi6pLjgsUUjeKI=";
});
nativeBuildInputs = [ pkg-config texinfo perl setupDebugInfoDirs ];

Loading…
Cancel
Save