-
-
Notifications
You must be signed in to change notification settings - Fork 15k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
separateDebugInfo: Use --strip-unneeded #160259
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
, autoreconfHook | ||
, docbook_xsl | ||
, docbook_xml_dtd_43 | ||
, glibc | ||
, gtk-doc | ||
, lzip | ||
, libidn2 | ||
|
@@ -38,6 +39,7 @@ in stdenv.mkDerivation rec { | |
python3 | ||
libxslt | ||
] ++ lib.optionals enableValgrindTests [ | ||
glibc.debug | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Should this be in valgrind’s There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good question...! |
||
valgrind | ||
]; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
diff --git a/coregrind/m_debuginfo/readelf.c b/coregrind/m_debuginfo/readelf.c | ||
index c586e3f33..e3bb1717f 100644 | ||
--- a/coregrind/m_debuginfo/readelf.c | ||
+++ b/coregrind/m_debuginfo/readelf.c | ||
@@ -1508,13 +1508,25 @@ DiImage* find_debug_file( struct _DebugInfo* di, | ||
HChar* debugpath = NULL; /* where we found it */ | ||
|
||
if (buildid != NULL) { | ||
+ const HChar *dir = VG_(getenv)("NIX_DEBUG_INFO_DIRS"); | ||
debugpath = ML_(dinfo_zalloc)("di.fdf.1", | ||
- VG_(strlen)(buildid) + 33); | ||
+ VG_(strlen)(buildid) + 33 + | ||
+ (dir ? VG_(strlen)(dir) : 0)); | ||
|
||
VG_(sprintf)(debugpath, "/usr/lib/debug/.build-id/%c%c/%s.debug", | ||
buildid[0], buildid[1], buildid + 2); | ||
|
||
dimg = open_debug_file(debugpath, buildid, 0, rel_ok, NULL); | ||
+ | ||
+ while (!dimg && dir) { | ||
+ const HChar *sep = VG_(strchr)(dir, ':'); | ||
+ Int size = sep ? sep - dir : VG_(strlen)(dir); | ||
+ VG_(sprintf)(debugpath, "%.*s/.build-id/%c%c/%s.debug", | ||
+ size, dir, buildid[0], buildid[1], buildid + 2); | ||
+ dimg = open_debug_file(debugpath, buildid, 0, rel_ok, NULL); | ||
+ dir = sep ? sep + 1 : NULL; | ||
+ } | ||
+ | ||
if (!dimg) { | ||
ML_(dinfo_free)(debugpath); | ||
debugpath = NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this ever be used on macOS? FWIW it supports neither flags.
strip is an area I've noticed where we tend to use non portable flags, maybe it's time to introduce a more bespoke strip wrapper…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, all this sounds more like future improvements.