Sunday, September 7, 2008

The mystery of libgcc...

I've been playing with external-toolchain/SDK feature of OpenEmbedded for quite some time now. Apparently, the support is there, but in a less-than-perfect state, i.e. its broken in several places. Maybe some time later I will elaborate on other issues I faced and either fixed or worked around...

But for several hours today I was struggling with the problem of failing gcc-noemu, which shouldn't be even built, as nothing supposed to depend on it. While trying to trace down the dependency on this package, I noticed the following messages given by bitbake:
NOTE: multiple providers are available for runtime libgcc (gcc-noemu, gcc-cross);
NOTE: consider defining a PREFERRED_PROVIDER entry to match runtime libgcc
That's when I realized gcc-noemu is being built to satisfy runtime libgcc dependency. Unfortunately, the suggestion to define a PREFERRED_PROVIDER given by bitbake is misleading and I ended up wasting couple hours trying all possible combinations of that variable w/o success.

Long story short, external-toolchain.bb was missing definition of libgcc as one of the provided runtime libraries. Here is the fix for it:
diff --git a/packages/meta/external-toolchain.bb b/packages/meta/external-toolchain.bb
index ad30ff7..9c532fd 100644
--- a/packages/meta/external-toolchain.bb
+++ b/packages/meta/external-toolchain.bb
@@ -14,7 +14,7 @@ PROVIDES = "\
virtual/libiconv \
"

-RPROVIDES = "glibc-utils libsegfault glibc-thread-db libgcc-dev libstdc++-dev libstdc++"
+RPROVIDES = "glibc-utils libsegfault glibc-thread-db libgcc-dev libgcc libstdc++-dev libstdc++"
PACKAGES_DYNAMIC = "glibc-gconv-*"
PR = "r1"
Here is the corresponding bug report.

No comments: