glibc: Enable separate debug symbols
The importance of glibc makes it worthwhile to provide debug
symbols. However, this revealed an issue with separateDebugInfo: it
was indiscriminately adding --build-id to all ld invocations, while in
fact it should only do that for final links. Glibc also uses non-final
("relocatable") links, leading to subsequent failure to apply a build
ID ("Cannot create .note.gnu.build-id section, --build-id
ignored"). So now ld-wrapper.sh only passes --build-id for final
links.
This commit is contained in:
@@ -37,6 +37,10 @@ postInstall() {
|
||||
|
||||
# Get rid of more unnecessary stuff.
|
||||
rm -rf $out/var $out/sbin/sln
|
||||
|
||||
for i in $out/lib/*.a; do
|
||||
strip -S "$i"
|
||||
done
|
||||
}
|
||||
|
||||
genericBuild
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
, installLocales ? true
|
||||
, profilingLibraries ? false
|
||||
, gccCross ? null
|
||||
, debugSymbols ? false
|
||||
, withGd ? false, gd ? null, libpng ? null
|
||||
}:
|
||||
|
||||
@@ -13,9 +12,7 @@ let
|
||||
cross = if gccCross != null then gccCross.target else null;
|
||||
in
|
||||
build cross ({
|
||||
name = "glibc"
|
||||
+ lib.optionalString debugSymbols "-debug"
|
||||
+ lib.optionalString withGd "-gd";
|
||||
name = "glibc" + lib.optionalString withGd "-gd";
|
||||
|
||||
inherit lib stdenv fetchurl linuxHeaders installLocales
|
||||
profilingLibraries gccCross withGd gd libpng;
|
||||
@@ -38,23 +35,13 @@ in
|
||||
fi
|
||||
'';
|
||||
|
||||
separateDebugInfo = true;
|
||||
|
||||
meta.description = "The GNU C Library";
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
(if debugSymbols
|
||||
then {
|
||||
# Build with debugging symbols, but leave optimizations on and don't
|
||||
# attempt to keep the build tree.
|
||||
dontStrip = true;
|
||||
dontCrossStrip = true;
|
||||
NIX_STRIP_DEBUG = 0;
|
||||
}
|
||||
else {})
|
||||
|
||||
//
|
||||
|
||||
(if cross != null
|
||||
then {
|
||||
preConfigure = ''
|
||||
|
||||
Reference in New Issue
Block a user