mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-18 07:46:09 +01:00
Merge pull request #37710 from dtzWill/feature/musl-unwind
musl: provide debug info, separately, don't disable unwind tables
This commit is contained in:
commit
0183369770
1 changed files with 14 additions and 3 deletions
|
@ -33,6 +33,14 @@ stdenv.mkDerivation rec {
|
||||||
# so musl can selectively disable as needed
|
# so musl can selectively disable as needed
|
||||||
hardeningDisable = [ "stackprotector" ];
|
hardeningDisable = [ "stackprotector" ];
|
||||||
|
|
||||||
|
# Leave these, be friendlier to debuggers/perf tools
|
||||||
|
# Don't force them on, but don't force off either
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace configure \
|
||||||
|
--replace -fno-unwind-tables "" \
|
||||||
|
--replace -fno-asynchronous-unwind-tables ""
|
||||||
|
'';
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
configureFlagsArray+=("--syslibdir=$out/lib")
|
configureFlagsArray+=("--syslibdir=$out/lib")
|
||||||
'';
|
'';
|
||||||
|
@ -40,6 +48,7 @@ stdenv.mkDerivation rec {
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
"--enable-shared"
|
"--enable-shared"
|
||||||
"--enable-static"
|
"--enable-static"
|
||||||
|
"--enable-debug"
|
||||||
"CFLAGS=-fstack-protector-strong"
|
"CFLAGS=-fstack-protector-strong"
|
||||||
# Fix cycle between outputs
|
# Fix cycle between outputs
|
||||||
"--disable-wrapper"
|
"--disable-wrapper"
|
||||||
|
@ -48,15 +57,17 @@ stdenv.mkDerivation rec {
|
||||||
outputs = [ "out" "dev" ];
|
outputs = [ "out" "dev" ];
|
||||||
|
|
||||||
dontDisableStatic = true;
|
dontDisableStatic = true;
|
||||||
dontStrip = true;
|
separateDebugInfo = true;
|
||||||
|
|
||||||
postInstall =
|
postInstall =
|
||||||
''
|
''
|
||||||
# Not sure why, but link in all but scsi directory as that's what uclibc/glibc do.
|
# Not sure why, but link in all but scsi directory as that's what uclibc/glibc do.
|
||||||
# Apparently glibc provides scsi itself?
|
# Apparently glibc provides scsi itself?
|
||||||
(cd $dev/include && ln -s $(ls -d ${linuxHeaders}/include/* | grep -v "scsi$") .)
|
(cd $dev/include && ln -s $(ls -d ${linuxHeaders}/include/* | grep -v "scsi$") .)
|
||||||
'' +
|
'' + ''
|
||||||
''
|
# Strip debug out of the static library
|
||||||
|
$STRIP -S $out/lib/libc.a
|
||||||
|
'' + ''
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
# Create 'ldd' symlink, builtin
|
# Create 'ldd' symlink, builtin
|
||||||
ln -s $out/lib/libc.so $out/bin/ldd
|
ln -s $out/lib/libc.so $out/bin/ldd
|
||||||
|
|
Loading…
Reference in a new issue