Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 118207 - sys-libs/glibc: splitdebug strips two times some files.
Summary: sys-libs/glibc: splitdebug strips two times some files.
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords: InVCS, REGRESSION
Depends on:
Blocks:
 
Reported: 2006-01-07 11:00 UTC by Diego Elio Pettenò (RETIRED)
Modified: 2006-01-13 04:15 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Double-stripped files (double-strip.list,15.26 KB, text/plain)
2006-01-10 00:54 UTC, Diego Elio Pettenò (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Elio Pettenò (RETIRED) gentoo-dev 2006-01-07 11:00:59 UTC
Difficult to explain, easy to reproduce, try to build glibc with splitdebug info enabled, it will break at the end as bash won't start anymore because bash can't be started.

It was also generating .debug.debug files, stripping the same file two times.
It might be breaking the actual libc for that.

I'd rather not test it once again ;) I rebuilt it 6 times thinking it was --as-needed breaking it.
Comment 1 solar (RETIRED) gentoo-dev 2006-01-07 11:30:45 UTC
Strange that your the first one to hit this. I've rebuilt glibc several times.

If it's not a problem with just your install then I suppose we can add a 
[ "${RESTRICT//*splitdebug*/true}" == "true" ] && return 0 
to the save_elf_debug() function of prepstrip
Comment 2 Diego Elio Pettenò (RETIRED) gentoo-dev 2006-01-07 12:13:00 UTC
Might be because of multilib? Not sure.
It might also because of -g3 in CFLAGS, but I would be suprised if that is the case (for the news, the whole rest of the system is built with -g3).
It's for sure not --as-needed, as I was able to build without splitdebug, both with and without --as-needed.

Anyway, the .debug.debug is for sure caused by splitdebug: prepallstrip called from the ebuild creates the first /usr/lib/debug directory, then it goes on and restrip it, again.
Comment 3 Diego Elio Pettenò (RETIRED) gentoo-dev 2006-01-09 03:12:22 UTC
Okay I can completely rule out the --as-needed route as this night I was able to build glibc while using --as-needed and bash still works.
Remains splitdebug/multilib and -g3.
I'll see if I can try -g3 today and see if it's that... also if I'm not really happy to do so :P
Comment 4 Diego Elio Pettenò (RETIRED) gentoo-dev 2006-01-10 00:54:39 UTC
Created attachment 76700 [details]
Double-stripped files

Okay, I can confirm the debug.debug problem (splitdebug run two times) and I'm attaching a list of files that are created with debug.debug names.
The system didn't broke this time with only splitdebug and no -g3 so the breakage comes from that instead.
Comment 5 solar (RETIRED) gentoo-dev 2006-01-10 14:45:36 UTC
Index: prepstrip
===================================================================
--- prepstrip	(revision 2558)
+++ prepstrip	(working copy)
@@ -21,6 +21,9 @@
 
 	[ "${FEATURES//*splitdebug*/true}" != "true" ] && return 0
 
+	# dont save debug info twice.
+	[ "${x:7}" == ".debug" ] && return 0
+
 	mkdir -p $(dirname ${y})
 	${CHOST}-objcopy --only-keep-debug ${x} ${y}.debug
 	${CHOST}-objcopy --add-gnu-debuglink=${y}.debug ${x}
Comment 6 solar (RETIRED) gentoo-dev 2006-01-10 14:48:04 UTC
that prevents double foo.bar.debug.debug but you still have a problem that your *.debug files just got stripped by the double calling of the prepallstrip. 
Blame glibc for that one.
Comment 7 Diego Elio Pettenò (RETIRED) gentoo-dev 2006-01-10 16:38:28 UTC
Can't prepstrip just ignore /usr/lib/debug when checking it?
That's where all debug info should be anyway.
Comment 8 solar (RETIRED) gentoo-dev 2006-01-11 06:15:12 UTC
There is no point in that really. Everything thats double stripped will result in non functional debug info anyway. I'd say your best bet is to find out why the prepallstrip is called directly from the ebuild. 
I can see ebuilds calling it directly only if it were to explicity set 'nostrip'
like for the sake of preventing libpthread_db.so or the likes from getting stripped at all.
Comment 9 SpanKY gentoo-dev 2006-01-12 03:49:34 UTC
strip is called by glibc because it's needed to get stripping while cross-compiling done correctly 

this bug happens on multilib systems only and it's because of the way the ebuild has been rewritten:
src_install() {
   foreach abi {
       glibc_src_install
   }
}
glibc_src_install() {
    prepstrip
}
Comment 10 SpanKY gentoo-dev 2006-01-13 04:15:11 UTC
thanks for testing, ive updated glibc ebuilds and portage