[meta-swupdate] Add libgcc to list of runtime dependencies
diff mbox series

Message ID 6a28b18d-f12d-4e46-8576-5db43038b9ea@googlegroups.com
State Rejected
Headers show
Series
  • [meta-swupdate] Add libgcc to list of runtime dependencies
Related show

Commit Message

Alexander Vickberg Dec. 5, 2019, 7:33 a.m. UTC
libgcc_s.so is dlopened by glibc so bitbake cannot automatically add
it. Without this library on a minimal image swupdate outputs the
following: "libgcc_s.so.1 must be installed for pthread_cancel to
work". Until a method to detect usage of functions in glibc which
dlopen libgcc_s.so is implemented in bitbake it is necessary to add it
manually with RDEPENDS.

Please see this discussion for more information:
https://yocto.yoctoproject.narkive.com/Hi849dZ8/btrfs-tools-requires-libgcc-s-so-1

Signed-off-by: Alexander Vickberg <wickbergster@gmail.com>
---
 recipes-support/swupdate/swupdate.inc | 1 +
 1 file changed, 1 insertion(+)

Comments

'Jonas Mark (BT-FIR/ENG1-Grb)' via swupdate Dec. 5, 2019, 8:10 a.m. UTC | #1
Hi,

On 12/5/19 8:33 AM, Alexander Vickberg wrote:
> libgcc_s.so is dlopened by glibc so bitbake cannot automatically add
> it. Without this library on a minimal image swupdate outputs the
> following: "libgcc_s.so.1 must be installed for pthread_cancel to
> work". Until a method to detect usage of functions in glibc which
> dlopen libgcc_s.so is implemented in bitbake it is necessary to add it
> manually with RDEPENDS.
>

If glibc dlopens this, shouldn't it be a RDEPEND of glibc then?

Regards,

Jeroen
Alexander Vickberg Dec. 5, 2019, 9:03 a.m. UTC | #2
Den torsdag 5 december 2019 kl. 09:11:00 UTC+1 skrev Jeroen Hofstee:
>
> Hi, 
>
> On 12/5/19 8:33 AM, Alexander Vickberg wrote: 
> > libgcc_s.so is dlopened by glibc so bitbake cannot automatically add 
> > it. Without this library on a minimal image swupdate outputs the 
> > following: "libgcc_s.so.1 must be installed for pthread_cancel to 
> > work". Until a method to detect usage of functions in glibc which 
> > dlopen libgcc_s.so is implemented in bitbake it is necessary to add it 
> > manually with RDEPENDS. 
> > 
>
> If glibc dlopens this, shouldn't it be a RDEPEND of glibc then? 
>
> Regards, 
>
> Jeroen 
>
>
Hi Jeroen,

This was mentioned in 
https://bugzilla.yoctoproject.org/show_bug.cgi?id=10954. However Glibc only 
dlopen this in certain functions so it seems to not be done to avoid 
bloating the image. It also says that the recipes shouldn't have to do this 
but for now it seems to be the only solution. The link in the commit 
message is about btrfs-tools which faced the same issue and there it was 
solved by adding libgcc to RDEPENDS.

Best regards
Alexander Vickberg
'Jonas Mark (BT-FIR/ENG1-Grb)' via swupdate Dec. 5, 2019, 10:38 a.m. UTC | #3
Hello Alexander,

On 12/5/19 10:03 AM, Alexander Vickberg wrote:
>
>
> This was mentioned in 
> https://bugzilla.yoctoproject.org/show_bug.cgi?id=10954. However Glibc 
> only dlopen this in certain functions so it seems to not be done to 
> avoid bloating the image. It also says that the recipes shouldn't have 
> to do this but for now it seems to be the only solution. The link in 
> the commit message is about btrfs-tools which faced the same issue and 
> there it was solved by adding libgcc to RDEPENDS.
>

Then they should just make it optional and default to depend on it.
Those who want to squeeze the last kilobytes out of an image
can then disable it, but at least you get a normal functional library
by default.

Regards,

Jeroen
Stefano Babic Dec. 10, 2019, 11:12 a.m. UTC | #4
On 05/12/19 10:03, Alexander Vickberg wrote:
> Den torsdag 5 december 2019 kl. 09:11:00 UTC+1 skrev Jeroen Hofstee:
> 
>     Hi,
> 
>     On 12/5/19 8:33 AM, Alexander Vickberg wrote:
>     > libgcc_s.so is dlopened by glibc so bitbake cannot automatically add
>     > it. Without this library on a minimal image swupdate outputs the
>     > following: "libgcc_s.so.1 must be installed for pthread_cancel to
>     > work". Until a method to detect usage of functions in glibc which
>     > dlopen libgcc_s.so is implemented in bitbake it is necessary to
>     add it
>     > manually with RDEPENDS.
>     >
> 
>     If glibc dlopens this, shouldn't it be a RDEPEND of glibc then?
> 
>     Regards,
> 
>     Jeroen
> 
> 
> Hi Jeroen,
> 
> This was mentioned
> in https://bugzilla.yoctoproject.org/show_bug.cgi?id=10954. However
> Glibc only dlopen this in certain functions so it seems to not be done
> to avoid bloating the image. It also says that the recipes shouldn't
> have to do this but for now it seems to be the only solution. The link
> in the commit message is about btrfs-tools which faced the same issue
> and there it was solved by adding libgcc to RDEPENDS.
> 

I agree with Jeroen, and it is weird that an issue (or a missing
dependency) in another package should be fixed here. However, I see this
as workaround not just in btrfs, but in many other ones (ntp, tpm2, ..).
So I guess for now it is ok to merge this, but still open for a cleaner
solution in future, if any.

Regards,
Stefano
'Jonas Mark (BT-FIR/ENG1-Grb)' via swupdate Dec. 10, 2019, 3:18 p.m. UTC | #5
Hi,

be aware that there are people who do not use gcc but clang specially to 
avoid having libgcc in their image!

BR



On Tuesday, December 10, 2019 at 12:13:04 PM UTC+1, Stefano Babic wrote:
>
> On 05/12/19 10:03, Alexander Vickberg wrote: 
> > Den torsdag 5 december 2019 kl. 09:11:00 UTC+1 skrev Jeroen Hofstee: 
> > 
> >     Hi, 
> > 
> >     On 12/5/19 8:33 AM, Alexander Vickberg wrote: 
> >     > libgcc_s.so is dlopened by glibc so bitbake cannot automatically 
> add 
> >     > it. Without this library on a minimal image swupdate outputs the 
> >     > following: "libgcc_s.so.1 must be installed for pthread_cancel to 
> >     > work". Until a method to detect usage of functions in glibc which 
> >     > dlopen libgcc_s.so is implemented in bitbake it is necessary to 
> >     add it 
> >     > manually with RDEPENDS. 
> >     > 
> > 
> >     If glibc dlopens this, shouldn't it be a RDEPEND of glibc then? 
> > 
> >     Regards, 
> > 
> >     Jeroen 
> > 
> > 
> > Hi Jeroen, 
> > 
> > This was mentioned 
> > in https://bugzilla.yoctoproject.org/show_bug.cgi?id=10954. However 
> > Glibc only dlopen this in certain functions so it seems to not be done 
> > to avoid bloating the image. It also says that the recipes shouldn't 
> > have to do this but for now it seems to be the only solution. The link 
> > in the commit message is about btrfs-tools which faced the same issue 
> > and there it was solved by adding libgcc to RDEPENDS. 
> > 
>
> I agree with Jeroen, and it is weird that an issue (or a missing 
> dependency) in another package should be fixed here. However, I see this 
> as workaround not just in btrfs, but in many other ones (ntp, tpm2, ..). 
> So I guess for now it is ok to merge this, but still open for a cleaner 
> solution in future, if any. 
>
> Regards, 
> Stefano 
>
>
>
> -- 
> ===================================================================== 
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk 
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany 
> Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de 
> <javascript:> 
> ===================================================================== 
>
Stefano Babic Dec. 10, 2019, 3:23 p.m. UTC | #6
Hi Ayoub,

On 10/12/19 16:18, 'Ayoub Zaki' via swupdate wrote:
> Hi,
> 
> be aware that there are people who do not use gcc but clang specially to
> avoid having libgcc in their image!

Thanks for pointing out - that is correct. There is also the use case
without glibc at all - SWUpdate is sued at least with musl. I am also
unsure if adding libgcc is ok in case of musl (or in case of another
glibc flavour). Anyway, I do not understand how this is managed by other
packages. Taking into account btrfs (well, not very often on embedded, I
admit) or better ntp: libgcc is then added to RDEPENDS. I would prefer
to move it into the image's recipe (rootfs), and anyone can decide if it
is required or not. Maybe adding some hints to the documentation.

Regards,
Stefano

> 
> BR
> 
> 
> 
> On Tuesday, December 10, 2019 at 12:13:04 PM UTC+1, Stefano Babic wrote:
> 
>     On 05/12/19 10:03, Alexander Vickberg wrote:
>     > Den torsdag 5 december 2019 kl. 09:11:00 UTC+1 skrev Jeroen Hofstee:
>     >
>     >     Hi,
>     >
>     >     On 12/5/19 8:33 AM, Alexander Vickberg wrote:
>     >     > libgcc_s.so is dlopened by glibc so bitbake cannot
>     automatically add
>     >     > it. Without this library on a minimal image swupdate outputs
>     the
>     >     > following: "libgcc_s.so.1 must be installed for
>     pthread_cancel to
>     >     > work". Until a method to detect usage of functions in glibc
>     which
>     >     > dlopen libgcc_s.so is implemented in bitbake it is necessary to
>     >     add it
>     >     > manually with RDEPENDS.
>     >     >
>     >
>     >     If glibc dlopens this, shouldn't it be a RDEPEND of glibc then?
>     >
>     >     Regards,
>     >
>     >     Jeroen
>     >
>     >
>     > Hi Jeroen,
>     >
>     > This was mentioned
>     > in https://bugzilla.yoctoproject.org/show_bug.cgi?id=10954
>     <https://bugzilla.yoctoproject.org/show_bug.cgi?id=10954>. However
>     > Glibc only dlopen this in certain functions so it seems to not be
>     done
>     > to avoid bloating the image. It also says that the recipes shouldn't
>     > have to do this but for now it seems to be the only solution. The
>     link
>     > in the commit message is about btrfs-tools which faced the same issue
>     > and there it was solved by adding libgcc to RDEPENDS.
>     >
> 
>     I agree with Jeroen, and it is weird that an issue (or a missing
>     dependency) in another package should be fixed here. However, I see
>     this
>     as workaround not just in btrfs, but in many other ones (ntp, tpm2,
>     ..).
>     So I guess for now it is ok to merge this, but still open for a cleaner
>     solution in future, if any.
> 
>     Regards,
>     Stefano
> 
> 
> 
>     -- 
>     =====================================================================
>     DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
>     HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
>     Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email:
>     sba...@denx.de <javascript:>
>     =====================================================================
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "swupdate" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swupdate+unsubscribe@googlegroups.com
> <mailto:swupdate+unsubscribe@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/swupdate/08238887-d02e-477d-bf32-cef50272edc5%40googlegroups.com
> <https://groups.google.com/d/msgid/swupdate/08238887-d02e-477d-bf32-cef50272edc5%40googlegroups.com?utm_medium=email&utm_source=footer>.

Patch
diff mbox series

diff --git a/recipes-support/swupdate/swupdate.inc 
b/recipes-support/swupdate/swupdate.inc
index 700d5a1..6be7313 100644
--- a/recipes-support/swupdate/swupdate.inc
+++ b/recipes-support/swupdate/swupdate.inc
@@ -2,6 +2,7 @@  SUMMARY="Image updater for Yocto projects"
 DESCRIPTION = "Application for automatic software update from USB Pen"
 SECTION="swupdate"
 DEPENDS = "libconfig"
+RDEPENDS_${PN} = "libgcc"
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"