Bug 10954 - dynamically detect dependency on libgcc
Summary: dynamically detect dependency on libgcc
Status: NEW
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium enhancement
Target Milestone: 6.1
Assignee: Ross Burton
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2017-01-23 15:55 UTC by Patrick Ohly
Modified: 2026-02-26 16:01 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Ohly 2017-01-23 15:55:27 UTC
Some pthread functions in glibc, for example pthread_cancel, depend on glibc and open it dynamically at runtime. If not installed, applications calling those pthread functions fail with:

libgcc_s.so.1 must be installed for pthread_cancel to work

Adding RDEPENDS += "libgcc" to application recipes is the wrong solution, because they shouldn't have to know about this glibc-internal implementation detail, nor should they have to check whether they are linked against glibc in the first place.

Adding RDEPENDS += "libgcc" to glibc itself would be better, but some people are concerned about the wasted disk space when it is not actually needed by anything in the image.

The right solution therefore seems to be an enhancement of the automatic shlib analysis code. It needs to know which pthread functions need libgcc and if glibc is used and these functions are called, add the RDEPENDS for the calling application automatically.
Comment 1 Randy MacLeod 2023-04-21 18:45:44 UTC
Moved en masse from 4.2 to 4.3 by Randy.
Comment 2 Ross Burton 2024-10-10 16:35:32 UTC
libgcc_s.so is 130K.

I think we should just add RDEPENDS:${PN} += "libgcc" to glibc.
Comment 3 Richard Purdie 2024-11-19 13:28:21 UTC
We've come this far without doing that and we do have embedded users so I'd prefer to avoid doing that if we can...