Skip to contentSkip to conversation

libgcc_s.so not stripped

PATCH In review Enrico Scholz 3 participants 7 messages Aug 22, 2012 – Mar 5, 2013

lore
Share & tools
lore
#0 lore raw

Hi,

I just noticed that libgcc_s.so.1 is not stripped in the .ipk. Is there any reason to keep the debug symbols? Uncompressed, this makes a difference of more than 1 MB.

Enrico

#1 lore raw
Quoted 4 lines · Enrico Scholz

I just noticed that libgcc_s.so.1 is not stripped in the .ipk. Is there any reason to keep the debug symbols? Uncompressed, this makes a difference of more than 1 MB.

I dont see a reason to have debug info there. Symbol table probably should be left in.

#2 lore raw

PATCH 1/1 libgcc: Mark libgcc_s as executable to ensure its stripped

libgcc_s is not marked as executable and hence it doesn't get stripped. This means its about 1MB larger than it needs to be. There is no good reason it shouldn't get stripped so ensure it does and mark as executable.

---

meta/recipes-devtools/gcc/libgcc_4.7.bb +3 -0
index 47669a2..6a0931f 100644
@@ -57,6 +57,9 @@ do_install () {
 	# install the runtime in /usr/lib/ not in /usr/lib/gcc on target
 	# so that cross-gcc can find it in the sysroot
 
+	# Ensure libs are executable else they aren't stripped
+	chmod a+x ${D}/${base_libdir}/*
+
 	mv ${D}${libdir}/gcc/* ${D}${libdir}
 	rm -rf ${D}${libdir}/gcc/
 	# unwind.h is installed here which is shipped in gcc-cross
#3 lore raw

Re: [PATCH] libgcc: Mark libgcc_s as executable to ensure its stripped

Quoted 11 lines · Richard Purdie

libgcc_s is not marked as executable and hence it doesn't get stripped. This means its about 1MB larger than it needs to be. There is no good reason it shouldn't get stripped so ensure it does and mark as executable.

---

meta/recipes-devtools/gcc/libgcc_4.7.bb +0 -0
index 47669a2..6a0931f 100644

meta/recipes-devtools/gcc/libgcc_4.7.bb do_install () { · line 62

Quoted 6 lines
meta/recipes-devtools/gcc/libgcc_4.7.bb +3 -0
@@ -57,6 +57,9 @@ do_install () {
        # install the runtime in /usr/lib/ not in /usr/lib/gcc on target
        # so that cross-gcc can find it in the sysroot
 
+       # Ensure libs are executable else they aren't stripped
+       chmod a+x ${D}/${base_libdir}/*
+

hmmm, while this solves the issue I think better fix would for stripper to know that its a shared object
and can be stripped. Marking libraries with exe (except ld.so which can execute on its own) seems not
right to me.

Quoted 5 lines
meta/recipes-devtools/gcc/libgcc_4.7.bb +0 -0
        mv ${D}${libdir}/gcc/* ${D}${libdir}
        rm -rf ${D}${libdir}/gcc/
        # unwind.h is installed here which is shipped in gcc-cross
#4 lore raw

Re: [PATCH] libgcc: Mark libgcc_s as executable to ensure its stripped

Quoted 16 lines · Khem Raj
Quoted 14 lines · Richard Purdie

libgcc_s is not marked as executable and hence it doesn't get stripped. This means its about 1MB larger than it needs to be. There is no good reason it shouldn't get stripped so ensure it does and mark as executable.

---

meta/recipes-devtools/gcc/libgcc_4.7.bb +0 -0
index 47669a2..6a0931f 100644
@@ -57,6 +57,9 @@ do_install () {
        # install the runtime in /usr/lib/ not in /usr/lib/gcc on target
        # so that cross-gcc can find it in the sysroot
 
Quoted 9 lines

meta/recipes-devtools/gcc/libgcc_4.7.bb do_install () { · line 62

Quoted 3 lines
meta/recipes-devtools/gcc/libgcc_4.7.bb +3 -0
+       # Ensure libs are executable else they aren't stripped
+       chmod a+x ${D}/${base_libdir}/*
+

hmmm, while this solves the issue I think better fix would for stripper to know that its a shared object
and can be stripped. Marking libraries with exe (except ld.so which can execute on its own) seems not
right to me.

Agreed, I've pushed something which addresses the root cause in package.bbclass.

Cheers,

Richard

#5 lore raw
In reply to Khem Raj
Quoted 9 lines · Khem Raj
Quoted 4 lines · Enrico Scholz

I just noticed that libgcc_s.so.1 is not stripped in the .ipk. Is there any reason to keep the debug symbols? Uncompressed, this makes a difference of more than 1 MB.

I dont see a reason to have debug info there. Symbol table probably should be left in.

I noticed this when clearing out old emails and I've just posted a patch for it.

Worryingly, there are other non-executables in the lib directories which aren't getting stripped. I've opened a bug:

https://bugzilla.yoctoproject.org/show_bug.cgi?id=3973

Cheers,

Richard

#6 lore raw
Quoted 10 lines · Richard Purdie
Quoted 9 lines · Khem Raj
Quoted 4 lines · Enrico Scholz

I just noticed that libgcc_s.so.1 is not stripped in the .ipk. Is there any reason to keep the debug symbols? Uncompressed, this makes a difference of more than 1 MB.

I dont see a reason to have debug info there. Symbol table probably should be left in.

yes as long as symbol table is left intact it should work fine.

Quoted 13 lines

I noticed this when clearing out old emails and I've just posted a patch for it.

Worryingly, there are other non-executables in the lib directories which aren't getting stripped. I've opened a bug:

https://bugzilla.yoctoproject.org/show_bug.cgi?id=3973

Cheers,

Richard