git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit47363ef04f20560adabc13dddf1bea28afe33dd8 authorWill Dietz <w@wdtz.org> dateMon 21 Mar 2022, 12:33 (5 years ago) parent17a43ee
1 file changed+7−1
pkgs/development/tools/misc/gdb/default.nix+7−1
pkgs/development/tools/misc/gdb/default.nix+7−1
@@ -37,6 +37,8 @@ stdenv.mkDerivation rec {
3737 postPatch = if stdenv.isDarwin then ''
3838 substituteInPlace gdb/darwin-nat.c \
3939 --replace '#include "bfd/mach-o.h"' '#include "mach-o.h"'
40+ '' else if stdenv.hostPlatform.isMusl then ''
41+ substituteInPlace sim/ppc/emul_unix.c --replace sys/termios.h termios.h
4042 '' else null;
4143
4244 patches = [
@@ -50,7 +52,11 @@ stdenv.mkDerivation rec {
5052 })
5153 ] ++ lib.optionals stdenv.isDarwin [
5254 ./darwin-target-match.patch
53− ];
55+ ] ++ lib.optional stdenv.hostPlatform.isMusl (fetchpatch {
56+ name = "musl-fix-pagesize-page_size.patch";
57+ url = "https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=fd0975b96b16d96010dce439af9620d3dfb65426";
58+ hash = "sha256-M3U7uIIFJnYu0g8/sMLJPhm02q7cGOi6pLjgsUUjeKI=";
59+ });
5460
5561 nativeBuildInputs = [ pkg-config texinfo perl setupDebugInfoDirs ];
5662