[OE-core] [PATCH] tclibc-baremetal.inc: Remove BASEDEPENDS on compilerlibs

Nathan Rossi nathan at nathanrossi.com
Tue Sep 11 08:30:41 UTC 2018


On Tue, 11 Sep 2018 at 02:14, Khem Raj <raj.khem at gmail.com> wrote:
>
> On Mon, Sep 10, 2018 at 5:45 AM Nathan Rossi <nathan at nathanrossi.com> wrote:
> >
> > Without a libc the gcc-runtime provider of compilerlibs does not
> > compile. As such avoid the default dependence on the
> > virtual/${TARGET_PREFIX}compilerlibs provider.
> >
>
> compilerlibs is compiler runtime, do we not have crtstuff and libgcc
> for baremetal ?

At first I thought that might be an issue, but it turns out that the
libgcc code (and 'crt(begin|end|i|n).o') is built by the libgcc recipe
and populated into the sysroot from that recipe. 'compilerlibs' which
is provided by gcc-runtime only handles other libraries (libgomp,
libatomic, libstdc++v3, etc).

A larger problem that really prevents gcc-runtime from being used at
all is the lack of libc (by choice of course) and because of that the
lack of the crt[01].o objects which the compiler specs for "elfos".
Which means the tclibc-baremetal is only practically useful with
"-nostdlib" or equivalent being provided (otherwise by default it
attempts to use "-lc" and "crt0.o"). Even with -nostdlib none of the
gcc-runtime libraries compile (missing support for various libc
features). Setting "-nostdlib" in tclibc-baremetal via TARGET_CC_ARGS
might be worth adding as well?

Although I might be missing something? Since my use case for baremetal
is just a c compiler and linker without any start objects or library
code.

Thanks,
Nathan

>
> > Signed-off-by: Nathan Rossi <nathan at nathanrossi.com>
> > ---
> >  meta/conf/distro/include/tclibc-baremetal.inc | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/meta/conf/distro/include/tclibc-baremetal.inc b/meta/conf/distro/include/tclibc-baremetal.inc
> > index b00917913f..e04f8c8812 100644
> > --- a/meta/conf/distro/include/tclibc-baremetal.inc
> > +++ b/meta/conf/distro/include/tclibc-baremetal.inc
> > @@ -21,6 +21,9 @@ LIBC_DEPENDENCIES = ""
> >  EXTRA_OECONF_pn-gcc-cross-${TARGET_ARCH}_append = " --without-headers"
> >  DEPENDS_remove_pn-meta-toolchain = "virtual/libc virtual/${TARGET_PREFIX}compilerlibs"
> >
> > +# certain compiler libs cannot be used without libc, avoid the dependence on compilerlibs
> > +BASEDEPENDS_remove_class-target = "virtual/${TARGET_PREFIX}compilerlibs"
> > +
> >  TARGET_OS = "elf"
> >  TARGET_OS_arm = "eabi"
> >
> > ---
> > 2.18.0
> > --
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core at lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core



More information about the Openembedded-core mailing list