[OE-core] [PATCH v2] machine/arch-riscv: Fix newlib and baremetal builds

Khem Raj raj.khem at gmail.com
Tue Nov 5 23:06:27 UTC 2019


On Tue, Nov 5, 2019 at 2:48 PM Alistair Francis <alistair23 at gmail.com> wrote:
>
> On Tue, Nov 5, 2019 at 2:42 PM Khem Raj <raj.khem at gmail.com> wrote:
> >
> > On Tue, Nov 5, 2019 at 1:57 PM Alistair Francis
> > <alistair.francis at wdc.com> wrote:
> > >
> > > Fix the following errors for newlib and baremetal libcs:
> > >   ld: unrecognized option '--hash-style=sysv'
> > >   ld: unrecognized option '--hash-style=gnu'
> > >
> > > Setting LINKER_HASH_STYLE to empty for just newlib and baremetal doesn't
> > > work as GCC still ends up being built with --hash-style=gnu which causes
> > > failures when using a built newlib SDK.
> > >
> > > Signed-off-by: Alistair Francis <alistair.francis at wdc.com>
> > > ---
> > >  meta/conf/machine/include/riscv/arch-riscv.inc | 3 +++
> > >  1 file changed, 3 insertions(+)
> > >
> > > diff --git a/meta/conf/machine/include/riscv/arch-riscv.inc b/meta/conf/machine/include/riscv/arch-riscv.inc
> > > index 19f8f3e211..f3edcc39f7 100644
> > > --- a/meta/conf/machine/include/riscv/arch-riscv.inc
> > > +++ b/meta/conf/machine/include/riscv/arch-riscv.inc
> > > @@ -8,3 +8,6 @@ TUNE_CCARGS .= ""
> > >
> > >  # QEMU usermode fails with invalid instruction error (For riscv32)
> > >  MACHINE_FEATURES_BACKFILL_CONSIDERED_append = "${@bb.utils.contains('TUNE_FEATURES', 'riscv32', ' qemu-usermode', '', d)}"
> > > +
> > > +# --hash-style is unsupported
> > > +LINKER_HASH_STYLE = ""
> >
> > I think we still need to use newlib and baremetal overrides
>
> That produces a SDK that doesn't work though.
>

Generally, I am in favor of this change, what it does do is that now
it will depend on toolchain defaults
the selection which is gnu for riscv for Linux targets so it does not
change defaults for internal toolchain
however external toolchains might have different default behavior so
we won't be able to control that
anymore. I think sysv may not even be an option for riscv so that will
eliminate this completely.

> Alistair
>
> >
> > > --
> > > 2.23.0
> > >


More information about the Openembedded-core mailing list