diff mbox series

linux-yocto: Add dependency on libgcc for ARC

Message ID 20190208153221.4335-1-abrodkin@synopsys.com
State New
Headers show
Series linux-yocto: Add dependency on libgcc for ARC | expand

Commit Message

Alexey Brodkin Feb. 8, 2019, 3:32 p.m. UTC
As of now in case of ARC there's no in-kernel implementation of basic libgcc
functions used for millicode, multiplication, division etc instead we simply
link with libgcc.a which provides everything used by the compiler.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
---
 meta/recipes-kernel/linux/linux-yocto.inc | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Bruce Ashfield Feb. 8, 2019, 3:42 p.m. UTC | #1
On Fri, Feb 8, 2019 at 10:32 AM Alexey Brodkin
<alexey.brodkin@synopsys.com> wrote:
>
> As of now in case of ARC there's no in-kernel implementation of basic libgcc
> functions used for millicode, multiplication, division etc instead we simply
> link with libgcc.a which provides everything used by the compiler.

I'll grab this for my queue.

Cheers,

Bruce

>
> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
> ---
>  meta/recipes-kernel/linux/linux-yocto.inc | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc
> index 1ebfb606da..f191946f2a 100644
> --- a/meta/recipes-kernel/linux/linux-yocto.inc
> +++ b/meta/recipes-kernel/linux/linux-yocto.inc
> @@ -26,6 +26,10 @@ DEPENDS_append_nios2 = " libgcc"
>  KERNEL_CC_append_nios2 = " ${TOOLCHAIN_OPTIONS}"
>  KERNEL_LD_append_nios2 = " ${TOOLCHAIN_OPTIONS}"
>
> +DEPENDS_append_arc = " libgcc"
> +KERNEL_CC_append_arc = " ${TOOLCHAIN_OPTIONS}"
> +KERNEL_LD_append_arc = " ${TOOLCHAIN_OPTIONS}"
> +
>  KERNEL_FEATURES_append_qemuall=" features/debug/printk.scc"
>
>  KERNEL_FEATURES_append = " ${@bb.utils.contains('MACHINE_FEATURES', 'numa', 'features/numa/numa.scc', '', d)}"
> --
> 2.16.2
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
Khem Raj Feb. 8, 2019, 5:28 p.m. UTC | #2
On Fri, Feb 8, 2019 at 7:32 AM Alexey Brodkin
<alexey.brodkin@synopsys.com> wrote:
>
> As of now in case of ARC there's no in-kernel implementation of basic libgcc
> functions used for millicode, multiplication, division etc instead we simply
> link with libgcc.a which provides everything used by the compiler.
>

this is something you would be fixing in kernel eventually?
we can carry this as a workaround until then but it really needs to be
fixed in kernel.

> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
> ---
>  meta/recipes-kernel/linux/linux-yocto.inc | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc
> index 1ebfb606da..f191946f2a 100644
> --- a/meta/recipes-kernel/linux/linux-yocto.inc
> +++ b/meta/recipes-kernel/linux/linux-yocto.inc
> @@ -26,6 +26,10 @@ DEPENDS_append_nios2 = " libgcc"
>  KERNEL_CC_append_nios2 = " ${TOOLCHAIN_OPTIONS}"
>  KERNEL_LD_append_nios2 = " ${TOOLCHAIN_OPTIONS}"
>
> +DEPENDS_append_arc = " libgcc"
> +KERNEL_CC_append_arc = " ${TOOLCHAIN_OPTIONS}"
> +KERNEL_LD_append_arc = " ${TOOLCHAIN_OPTIONS}"
> +
>  KERNEL_FEATURES_append_qemuall=" features/debug/printk.scc"
>
>  KERNEL_FEATURES_append = " ${@bb.utils.contains('MACHINE_FEATURES', 'numa', 'features/numa/numa.scc', '', d)}"
> --
> 2.16.2
>
Alexey Brodkin Feb. 8, 2019, 5:34 p.m. UTC | #3
Hi Khem,

> -----Original Message-----
> From: Khem Raj <raj.khem@gmail.com>
> Sent: Friday, February 8, 2019 8:28 PM
> To: Alexey Brodkin <alexey.brodkin@synopsys.com>
> Cc: Patches and discussions about the oe-core layer <openembedded-core@lists.openembedded.org>; Ross
> Burton <ross.burton@intel.com>; linux-snps-arc@lists.infradead.org; Bruce Ashfield
> <bruce.ashfield@windriver.com>
> Subject: Re: [PATCH] linux-yocto: Add dependency on libgcc for ARC
> 
> On Fri, Feb 8, 2019 at 7:32 AM Alexey Brodkin
> <alexey.brodkin@synopsys.com> wrote:
> >
> > As of now in case of ARC there's no in-kernel implementation of basic libgcc
> > functions used for millicode, multiplication, division etc instead we simply
> > link with libgcc.a which provides everything used by the compiler.
> >
> 
> this is something you would be fixing in kernel eventually?
> we can carry this as a workaround until then but it really needs to be
> fixed in kernel.

Well we do have it in our plans but given this is more a nice feature
than something critical (as currently used approach with libgcc works
perfectly fine) it might not be done very soon.

Thus we'll need to keep this work-around for now.

BTW exporting of libgcc parts into kernel means we'll need to
keep it in sync with real libgcc later which is not optimal as well.

-Alexey
Khem Raj Feb. 8, 2019, 5:41 p.m. UTC | #4
On Fri, Feb 8, 2019 at 9:35 AM Alexey Brodkin
<alexey.brodkin@synopsys.com> wrote:
>
> Hi Khem,
>
> > -----Original Message-----
> > From: Khem Raj <raj.khem@gmail.com>
> > Sent: Friday, February 8, 2019 8:28 PM
> > To: Alexey Brodkin <alexey.brodkin@synopsys.com>
> > Cc: Patches and discussions about the oe-core layer <openembedded-core@lists.openembedded.org>; Ross
> > Burton <ross.burton@intel.com>; linux-snps-arc@lists.infradead.org; Bruce Ashfield
> > <bruce.ashfield@windriver.com>
> > Subject: Re: [PATCH] linux-yocto: Add dependency on libgcc for ARC
> >
> > On Fri, Feb 8, 2019 at 7:32 AM Alexey Brodkin
> > <alexey.brodkin@synopsys.com> wrote:
> > >
> > > As of now in case of ARC there's no in-kernel implementation of basic libgcc
> > > functions used for millicode, multiplication, division etc instead we simply
> > > link with libgcc.a which provides everything used by the compiler.
> > >
> >
> > this is something you would be fixing in kernel eventually?
> > we can carry this as a workaround until then but it really needs to be
> > fixed in kernel.
>
> Well we do have it in our plans but given this is more a nice feature
> than something critical (as currently used approach with libgcc works
> perfectly fine) it might not be done very soon.
>
> Thus we'll need to keep this work-around for now.
>
> BTW exporting of libgcc parts into kernel means we'll need to
> keep it in sync with real libgcc later which is not optimal as well.

aarch64 kernel also bootstrapped with lbgcc for quite a while and then
moved away
I can understand that there might be bigger fish to fry, but this is
not a insignificant issue
where you make kernel dependency on toolchain runtime go away.

>
> -Alexey
diff mbox series

Patch

diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc
index 1ebfb606da..f191946f2a 100644
--- a/meta/recipes-kernel/linux/linux-yocto.inc
+++ b/meta/recipes-kernel/linux/linux-yocto.inc
@@ -26,6 +26,10 @@  DEPENDS_append_nios2 = " libgcc"
 KERNEL_CC_append_nios2 = " ${TOOLCHAIN_OPTIONS}"
 KERNEL_LD_append_nios2 = " ${TOOLCHAIN_OPTIONS}"
 
+DEPENDS_append_arc = " libgcc"
+KERNEL_CC_append_arc = " ${TOOLCHAIN_OPTIONS}"
+KERNEL_LD_append_arc = " ${TOOLCHAIN_OPTIONS}"
+
 KERNEL_FEATURES_append_qemuall=" features/debug/printk.scc"
 
 KERNEL_FEATURES_append = " ${@bb.utils.contains('MACHINE_FEATURES', 'numa', 'features/numa/numa.scc', '', d)}"