Merge #160259: separateDebugInfo: Use --strip-unneeded

...into staging

+40 -1
+1 -1
pkgs/build-support/setup-hooks/separate-debug-info.sh
··· 34 34 # firmware blobs in QEMU.) 35 35 ( 36 36 $OBJCOPY --only-keep-debug "$i" "$dst/${id:0:2}/${id:2}.debug" 37 - $STRIP --strip-debug "$i" 37 + $STRIP --strip-unneeded "$i" 38 38 39 39 # Also a create a symlink <original-name>.debug. 40 40 ln -sfn ".build-id/${id:0:2}/${id:2}.debug" "$dst/../$(basename "$i")"
+2
pkgs/development/libraries/libpsl/default.nix
··· 3 3 , autoreconfHook 4 4 , docbook_xsl 5 5 , docbook_xml_dtd_43 6 + , glibc 6 7 , gtk-doc 7 8 , lzip 8 9 , libidn2 ··· 38 39 python3 39 40 libxslt 40 41 ] ++ lib.optionals enableValgrindTests [ 42 + glibc.debug 41 43 valgrind 42 44 ]; 43 45
+31
pkgs/development/tools/analysis/valgrind/debug-info-from-env.patch
··· 1 + diff --git a/coregrind/m_debuginfo/readelf.c b/coregrind/m_debuginfo/readelf.c 2 + index c586e3f33..e3bb1717f 100644 3 + --- a/coregrind/m_debuginfo/readelf.c 4 + +++ b/coregrind/m_debuginfo/readelf.c 5 + @@ -1508,13 +1508,25 @@ DiImage* find_debug_file( struct _DebugInfo* di, 6 + HChar* debugpath = NULL; /* where we found it */ 7 + 8 + if (buildid != NULL) { 9 + + const HChar *dir = VG_(getenv)("NIX_DEBUG_INFO_DIRS"); 10 + debugpath = ML_(dinfo_zalloc)("di.fdf.1", 11 + - VG_(strlen)(buildid) + 33); 12 + + VG_(strlen)(buildid) + 33 + 13 + + (dir ? VG_(strlen)(dir) : 0)); 14 + 15 + VG_(sprintf)(debugpath, "/usr/lib/debug/.build-id/%c%c/%s.debug", 16 + buildid[0], buildid[1], buildid + 2); 17 + 18 + dimg = open_debug_file(debugpath, buildid, 0, rel_ok, NULL); 19 + + 20 + + while (!dimg && dir) { 21 + + const HChar *sep = VG_(strchr)(dir, ':'); 22 + + Int size = sep ? sep - dir : VG_(strlen)(dir); 23 + + VG_(sprintf)(debugpath, "%.*s/.build-id/%c%c/%s.debug", 24 + + size, dir, buildid[0], buildid[1], buildid + 2); 25 + + dimg = open_debug_file(debugpath, buildid, 0, rel_ok, NULL); 26 + + dir = sep ? sep + 1 : NULL; 27 + + } 28 + + 29 + if (!dimg) { 30 + ML_(dinfo_free)(debugpath); 31 + debugpath = NULL;
+6
pkgs/development/tools/analysis/valgrind/default.nix
··· 1 1 { lib, stdenv, fetchurl, fetchpatch 2 2 , autoreconfHook, perl 3 3 , gdb, cctools, xnu, bootstrap_cmds 4 + , setupDebugInfoDirs 4 5 }: 5 6 6 7 stdenv.mkDerivation rec { ··· 19 20 url = "https://bugsfiles.kde.org/attachment.cgi?id=143535"; 20 21 sha256 = "036zyk30rixjvpylw3c7n171n4gpn6zcp7h6ya2dz4h5r478l9i6"; 21 22 }) 23 + ./debug-info-from-env.patch 22 24 ]; 23 25 24 26 outputs = [ "out" "dev" "man" "doc" ]; ··· 31 33 32 34 # Perl is also a native build input. 33 35 nativeBuildInputs = [ autoreconfHook perl ]; 36 + 37 + # Not propagatedNativeBuildInputs because of 38 + # https://github.com/NixOS/nixpkgs/issues/64992. 39 + propagatedBuildInputs = [ setupDebugInfoDirs ]; 34 40 35 41 enableParallelBuilding = true; 36 42 separateDebugInfo = stdenv.isLinux;