Fixes the following issue:
[host@user:/nix/pkgs]$ nix build .\#pkgsStatic.gdb
checking size of unsigned long long... CXXLD libinproctrace.so
/nix/store/gzms61swp55fg5qbvshyqv5jfsnfvybz-x86_64-unknown-linux-musl-binutils-2.38/bin/x86_64-unknown-linux-musl-ld: /nix/store/dnmh1aj0kd60qz8yl4srak8kn2bspbxc-x86_64-unknown-linux-musl-stage-final-gcc-11.3.0/lib/gcc/x86_64-unknown-linux-musl/11.3.0/crtbeginT.o: relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a shared object
/nix/store/gzms61swp55fg5qbvshyqv5jfsnfvybz-x86_64-unknown-linux-musl-binutils-2.38/bin/x86_64-unknown-linux-musl-ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:383: libinproctrace.so] Error 1
make[2]: *** Waiting for unfinished jobs....
8
checking size of unsigned long... make[2]: Leaving directory '/build/gdb-12.1/_build/gdbserver'
make[1]: *** [Makefile:11064: all-gdbserver] Error 2
as the inprocess library can only be compiled as a shared library
A few rare targets don't have clean format strings on 32-bit systems:
https://github.com/NixOS/nixpkgs/pull/171216#issuecomment-1133541978
/build/gdb-12.1/_build/sim/../../sim/cris/sim-if.c:575:28:
error: format '%lx' expects argument of type 'long unsigned int',
but argument 4 has type 'bfd_size_type' {aka 'long long unsigned int'} [-Werror=format=]
We pull in patch pending upstream inclusion.
Added trivial updater script.
Refreshed nix-specific patch with path to debug symbols.
Dropped upstreamed patches for gcc-12 support and musl support.
Changes: https://www.sourceware.org/gdb/download/ANNOUNCEMENT
* 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.
Without the change the build fails as:
sim/cr16/interp.c: In function 'lookup_hash':
sim/cr16/interp.c:89:25: error:
the comparison will always evaluate as 'true'
for the address of 'mnimonic' will never be NULL [-Werror=address]
89 | if ((h->ops->mnimonic != NULL) &&
| ^~
This makes the targetPrefix always conform to nixpkgs' expectations
instead of relying on the autotools build system to figure it out
correctly (which is also inconsistent across versions).
See also ca9be0511b.
continuation of #109595
pkgconfig was aliased in 2018, however, it remained in
all-packages.nix due to its wide usage. This cleans
up the remaining references to pkgs.pkgsconfig and
moves the entry to aliases.nix.
python3Packages.pkgconfig remained unchanged because
it's the canonical name of the upstream package
on pypi.
The current gdb patch to support NIX_DEBUG_INFO_DIRS fails if
the user attempts to change the debug file directory to a
value other than the default. For instance:
(gdb) set debug-file-directory /run/booted-system/sw/lib/debug
results in:
munmap_chunk(): invalid pointer
Aborted (core dumped)
To fix this issue, the debug_file_directory is allocated
with xstrdup so that a subsequent call to xfree will succeed.
This has been not touched in 6 years. Let's remove it to cause less
problems when adding new cross-compiling infrastructure.
This also simplify gcc significantly.
Outside of the nix-build the target is `x86_64-apple-darwin17.4.0`,
while inside the target is `x86_64-apple-darwin`. This difference
causes the fallback target configuration for darwin, which disables
gdb. Add a patch to make the target matching more flexible.
There are separate derivations for these libraries and we don't want
conflict. Multitarget is generally more useful, and will eventually
speed up cross builds, so why not?!