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:
Eelco Dolstra
2016-02-28 02:57:37 +01:00
parent 69a337edae
commit d5bb6a1f9c
4 changed files with 25 additions and 18 deletions
@@ -1,4 +1,5 @@
export NIX_LDFLAGS+=" --build-id --compress-debug-sections"
export NIX_SET_BUILD_ID=1
export NIX_LDFLAGS+=" --compress-debug-sections=zlib"
export NIX_CFLAGS_COMPILE+=" -ggdb -Wa,--compress-debug-sections"
dontStrip=1