libgcc: Mark libgcc_s as executable to ensure its stripped

Submitted by Richard Purdie on March 3, 2013, 5:04 p.m.

Details

Message ID 1362330269.4325.28.camel@ted
State New
Headers show

Commit Message

Richard Purdie March 3, 2013, 5:04 p.m.
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---

Patch hide | download patch | download mbox

diff --git a/meta/recipes-devtools/gcc/libgcc_4.7.bb b/meta/recipes-devtools/gcc/libgcc_4.7.bb
index 47669a2..6a0931f 100644
--- a/meta/recipes-devtools/gcc/libgcc_4.7.bb
+++ b/meta/recipes-devtools/gcc/libgcc_4.7.bb
@@ -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

Comments

Khem Raj March 4, 2013, 8:06 p.m.
On Sun, Mar 3, 2013 at 9:04 AM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> 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.
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
> diff --git a/meta/recipes-devtools/gcc/libgcc_4.7.bb b/meta/recipes-devtools/gcc/libgcc_4.7.bb
> index 47669a2..6a0931f 100644
> --- a/meta/recipes-devtools/gcc/libgcc_4.7.bb
> +++ b/meta/recipes-devtools/gcc/libgcc_4.7.bb
> @@ -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.


>         mv ${D}${libdir}/gcc/* ${D}${libdir}
>         rm -rf ${D}${libdir}/gcc/
>         # unwind.h is installed here which is shipped in gcc-cross
>
>
Richard Purdie March 5, 2013, 1:33 p.m.
On Mon, 2013-03-04 at 12:06 -0800, Khem Raj wrote:
> On Sun, Mar 3, 2013 at 9:04 AM, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > 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.
> >
> > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> > ---
> > diff --git a/meta/recipes-devtools/gcc/libgcc_4.7.bb b/meta/recipes-devtools/gcc/libgcc_4.7.bb
> > index 47669a2..6a0931f 100644
> > --- a/meta/recipes-devtools/gcc/libgcc_4.7.bb
> > +++ b/meta/recipes-devtools/gcc/libgcc_4.7.bb
> > @@ -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.

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

Cheers,

Richard