All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] external-arm-toolchain: un-break target compilation
@ 2020-06-04  0:24 Denys Dmytriyenko
  2020-06-04  6:13 ` [meta-arm] " Sumit Garg
  0 siblings, 1 reply; 5+ messages in thread
From: Denys Dmytriyenko @ 2020-06-04  0:24 UTC (permalink / raw)
  To: meta-arm; +Cc: Denys Dmytriyenko

From: Denys Dmytriyenko <denys@ti.com>

Compiling on the target using runtime libs from external-arm-toolchain
requires libgcc.a, as libgcc_s.so explains:

/* GNU ld script
   Use the shared library, but some functions are only in
   the static library.  */
GROUP ( libgcc_s.so.1 -lgcc )

Otherwise it results in errors like:
| /usr/lib/gcc/arm-linux-gnueabi/9.2.1/../../../../arm-linux-gnueabi/bin/ld: cannot find -lgcc
| /usr/lib/gcc/arm-linux-gnueabi/9.2.1/../../../../arm-linux-gnueabi/bin/ld: cannot find -lgcc
| collect2: error: ld returned 1 exit status

This already has been fixed before in this commit:
https://git.linaro.org/openembedded/meta-linaro.git/commit/?id=91ea4d017bf0598e49944e76c889e66d58c066ce

But then it got broken/undone here w/o due review:
https://git.linaro.org/openembedded/meta-linaro.git/commit/?id=b43d5f0ce431ba1e242504641266a63293ded5db

Even though it's a static library, we want it to be in libgcc-dev as it's
not optional, but rather required for development.

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
---
 .../recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb
index 04d8923..8cfc208 100644
--- a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb
+++ b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb
@@ -117,7 +117,7 @@ do_install() {
 	sed -i -e 's#/bin/bash#/bin/sh#' ${D}${bindir}/ldd
 
 	cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/crt*.o ${D}${libdir}/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
-
+	cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/libgcc* ${D}${libdir}/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
 	cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/libgcov* ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
 	cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/include ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
 	cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/finclude ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
@@ -310,6 +310,7 @@ INSANE_SKIP_${PN}-utils += "ldflags"
 INSANE_SKIP_libstdc++ += "ldflags"
 INSANE_SKIP_libgfortran += "ldflags"
 INSANE_SKIP_libgcc += "ldflags dev-deps"
+INSANE_SKIP_libgcc-dev += "staticdev"
 INSANE_SKIP_libgfortran += "ldflags dev-deps"
 INSANE_SKIP_libstdc++ += "ldflags dev-deps"
 INSANE_SKIP_libatomic += "ldflags"
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [meta-arm] [PATCH] external-arm-toolchain: un-break target compilation
  2020-06-04  0:24 [PATCH] external-arm-toolchain: un-break target compilation Denys Dmytriyenko
@ 2020-06-04  6:13 ` Sumit Garg
  2020-06-04 23:45   ` Denys Dmytriyenko
  0 siblings, 1 reply; 5+ messages in thread
From: Sumit Garg @ 2020-06-04  6:13 UTC (permalink / raw)
  To: Denys Dmytriyenko; +Cc: meta-arm, Denys Dmytriyenko

On Thu, 4 Jun 2020 at 05:54, Denys Dmytriyenko <denis@denix.org> wrote:
>
> From: Denys Dmytriyenko <denys@ti.com>
>
> Compiling on the target using runtime libs from external-arm-toolchain
> requires libgcc.a, as libgcc_s.so explains:
>
> /* GNU ld script
>    Use the shared library, but some functions are only in
>    the static library.  */
> GROUP ( libgcc_s.so.1 -lgcc )
>
> Otherwise it results in errors like:
> | /usr/lib/gcc/arm-linux-gnueabi/9.2.1/../../../../arm-linux-gnueabi/bin/ld: cannot find -lgcc
> | /usr/lib/gcc/arm-linux-gnueabi/9.2.1/../../../../arm-linux-gnueabi/bin/ld: cannot find -lgcc
> | collect2: error: ld returned 1 exit status
>

Ah I see, so libgcc.a is mandatory for aarch32 but that isn't the case
for aarch64 where only having a shared library seems to be sufficient.

> This already has been fixed before in this commit:
> https://git.linaro.org/openembedded/meta-linaro.git/commit/?id=91ea4d017bf0598e49944e76c889e66d58c066ce
>

There were mainly two reasons to revert libgcc static library packaging:

1. It was done improperly earlier leading to following QA issues:

ERROR: external-arm-toolchain-2019.12-r0 do_package_qa: QA Issue: non
-staticdev package contains static .a library: libgcc-dev path
'/work/aarch64-poky-linux/external-arm-toolchain/2019.12-r0/packages-split/libgcc-dev/usr/lib/aarch64-none-linux-gnu/9.2.1/libgcc_eh.a'
non -staticdev package contains static .a library: libgcc-dev path
'/work/aarch64-poky-linux/external-arm-toolchain/2019.12-r0/packages-split/libgcc-dev/usr/lib/aarch64-none-linux-gnu/9.2.1/libgcc.a'
[staticdev]
ERROR: external-arm-toolchain-2019.12-r0 do_package_qa: QA run found
fatal errors. Please consider fixing them.
ERROR: Logfile of failure stored in:
/home/sumit.garg/T2502/poky/build/tmp/work/aarch64-poky-linux/external-arm-toolchain/2019.12-r0/temp/log.do_package_qa.8281
ERROR: Task (/home/sumit.garg/T2502/poky/meta-arm/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb:do_package_qa)
failed with exit code '1'

2. There wasn't any motivation mentioned in your earlier commit
message like this commit does to include libgcc static library.

> But then it got broken/undone here w/o due review:
> https://git.linaro.org/openembedded/meta-linaro.git/commit/?id=b43d5f0ce431ba1e242504641266a63293ded5db
>
> Even though it's a static library, we want it to be in libgcc-dev as it's
> not optional, but rather required for development.

Yeah it's required for aarch32 but optional for aarch64.

So you could elaborate more in the commit message that this change is
specifically required for arm32.

With that, feel free to add:

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>

>
> Signed-off-by: Denys Dmytriyenko <denys@ti.com>
> ---
>  .../recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb  | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb
> index 04d8923..8cfc208 100644
> --- a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb
> +++ b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb
> @@ -117,7 +117,7 @@ do_install() {
>         sed -i -e 's#/bin/bash#/bin/sh#' ${D}${bindir}/ldd
>
>         cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/crt*.o ${D}${libdir}/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
> -
> +       cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/libgcc* ${D}${libdir}/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
>         cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/libgcov* ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
>         cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/include ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
>         cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/finclude ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
> @@ -310,6 +310,7 @@ INSANE_SKIP_${PN}-utils += "ldflags"
>  INSANE_SKIP_libstdc++ += "ldflags"
>  INSANE_SKIP_libgfortran += "ldflags"
>  INSANE_SKIP_libgcc += "ldflags dev-deps"
> +INSANE_SKIP_libgcc-dev += "staticdev"

This change was missing from your earlier commit.

-Sumit

>  INSANE_SKIP_libgfortran += "ldflags dev-deps"
>  INSANE_SKIP_libstdc++ += "ldflags dev-deps"
>  INSANE_SKIP_libatomic += "ldflags"
> --
> 2.7.4
>
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [meta-arm] [PATCH] external-arm-toolchain: un-break target compilation
  2020-06-04  6:13 ` [meta-arm] " Sumit Garg
@ 2020-06-04 23:45   ` Denys Dmytriyenko
  2020-06-08 10:09     ` Sumit Garg
  0 siblings, 1 reply; 5+ messages in thread
From: Denys Dmytriyenko @ 2020-06-04 23:45 UTC (permalink / raw)
  To: Sumit Garg; +Cc: meta-arm, Denys Dmytriyenko

On Thu, Jun 04, 2020 at 11:43:08AM +0530, Sumit Garg wrote:
> On Thu, 4 Jun 2020 at 05:54, Denys Dmytriyenko <denis@denix.org> wrote:
> >
> > From: Denys Dmytriyenko <denys@ti.com>
> >
> > Compiling on the target using runtime libs from external-arm-toolchain
> > requires libgcc.a, as libgcc_s.so explains:
> >
> > /* GNU ld script
> >    Use the shared library, but some functions are only in
> >    the static library.  */
> > GROUP ( libgcc_s.so.1 -lgcc )
> >
> > Otherwise it results in errors like:
> > | /usr/lib/gcc/arm-linux-gnueabi/9.2.1/../../../../arm-linux-gnueabi/bin/ld: cannot find -lgcc
> > | /usr/lib/gcc/arm-linux-gnueabi/9.2.1/../../../../arm-linux-gnueabi/bin/ld: cannot find -lgcc
> > | collect2: error: ld returned 1 exit status
> 
> Ah I see, so libgcc.a is mandatory for aarch32 but that isn't the case
> for aarch64 where only having a shared library seems to be sufficient.

Well, I don't have all the old versions of the toolchain around to check, but 
yes, gcc9 and gcc8 both seem to be like that:

arm32 - libgcc_s.so is an ld script that requires libgcc.a
arm64 - libgcc_s.so is just a symlink to libgcc_s.so.1

Not sure why arm32 requires some functions from the static lib, while arm64 
doesn't. I would assume it depends on how the toolchain was built...


> > This already has been fixed before in this commit:
> > https://git.linaro.org/openembedded/meta-linaro.git/commit/?id=91ea4d017bf0598e49944e76c889e66d58c066ce
> >
> 
> There were mainly two reasons to revert libgcc static library packaging:
> 
> 1. It was done improperly earlier leading to following QA issues:
> 
> ERROR: external-arm-toolchain-2019.12-r0 do_package_qa: QA Issue: non
> -staticdev package contains static .a library: libgcc-dev path
> '/work/aarch64-poky-linux/external-arm-toolchain/2019.12-r0/packages-split/libgcc-dev/usr/lib/aarch64-none-linux-gnu/9.2.1/libgcc_eh.a'
> non -staticdev package contains static .a library: libgcc-dev path
> '/work/aarch64-poky-linux/external-arm-toolchain/2019.12-r0/packages-split/libgcc-dev/usr/lib/aarch64-none-linux-gnu/9.2.1/libgcc.a'
> [staticdev]
> ERROR: external-arm-toolchain-2019.12-r0 do_package_qa: QA run found
> fatal errors. Please consider fixing them.
> ERROR: Logfile of failure stored in:
> /home/sumit.garg/T2502/poky/build/tmp/work/aarch64-poky-linux/external-arm-toolchain/2019.12-r0/temp/log.do_package_qa.8281
> ERROR: Task (/home/sumit.garg/T2502/poky/meta-arm/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb:do_package_qa)
> failed with exit code '1'

That's what INSANE_SKIP_libgcc-dev += "staticdev" is for - back then it wasn't 
a fatal error, hence wasn't there.


> 2. There wasn't any motivation mentioned in your earlier commit
> message like this commit does to include libgcc static library.

Well, it may not have been 100% clear, but it did imply it was needed for 
development:

* Install additional static libs, stubs and header files
* Needed for -dev versions of libgcc, libgfortran and other packages
...


> > But then it got broken/undone here w/o due review:
> > https://git.linaro.org/openembedded/meta-linaro.git/commit/?id=b43d5f0ce431ba1e242504641266a63293ded5db
> >
> > Even though it's a static library, we want it to be in libgcc-dev as it's
> > not optional, but rather required for development.
> 
> Yeah it's required for aarch32 but optional for aarch64.
> 
> So you could elaborate more in the commit message that this change is
> specifically required for arm32.

Were there any tests done on arm32? How about arm64?


> With that, feel free to add:
> 
> Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
> 
> >
> > Signed-off-by: Denys Dmytriyenko <denys@ti.com>
> > ---
> >  .../recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb  | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb
> > index 04d8923..8cfc208 100644
> > --- a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb
> > +++ b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb
> > @@ -117,7 +117,7 @@ do_install() {
> >         sed -i -e 's#/bin/bash#/bin/sh#' ${D}${bindir}/ldd
> >
> >         cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/crt*.o ${D}${libdir}/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
> > -
> > +       cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/libgcc* ${D}${libdir}/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
> >         cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/libgcov* ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
> >         cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/include ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
> >         cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/finclude ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
> > @@ -310,6 +310,7 @@ INSANE_SKIP_${PN}-utils += "ldflags"
> >  INSANE_SKIP_libstdc++ += "ldflags"
> >  INSANE_SKIP_libgfortran += "ldflags"
> >  INSANE_SKIP_libgcc += "ldflags dev-deps"
> > +INSANE_SKIP_libgcc-dev += "staticdev"
> 
> This change was missing from your earlier commit.
> 
> -Sumit
> 
> >  INSANE_SKIP_libgfortran += "ldflags dev-deps"
> >  INSANE_SKIP_libstdc++ += "ldflags dev-deps"
> >  INSANE_SKIP_libatomic += "ldflags"
> > --
> > 2.7.4
> >
> > 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [meta-arm] [PATCH] external-arm-toolchain: un-break target compilation
  2020-06-04 23:45   ` Denys Dmytriyenko
@ 2020-06-08 10:09     ` Sumit Garg
  2020-06-08 15:47       ` Jon Mason
  0 siblings, 1 reply; 5+ messages in thread
From: Sumit Garg @ 2020-06-08 10:09 UTC (permalink / raw)
  To: Denys Dmytriyenko; +Cc: meta-arm, Denys Dmytriyenko

On Fri, 5 Jun 2020 at 05:15, Denys Dmytriyenko <denis@denix.org> wrote:
>
> On Thu, Jun 04, 2020 at 11:43:08AM +0530, Sumit Garg wrote:
> > On Thu, 4 Jun 2020 at 05:54, Denys Dmytriyenko <denis@denix.org> wrote:
> > >
> > > From: Denys Dmytriyenko <denys@ti.com>
> > >
> > > Compiling on the target using runtime libs from external-arm-toolchain
> > > requires libgcc.a, as libgcc_s.so explains:
> > >
> > > /* GNU ld script
> > >    Use the shared library, but some functions are only in
> > >    the static library.  */
> > > GROUP ( libgcc_s.so.1 -lgcc )
> > >
> > > Otherwise it results in errors like:
> > > | /usr/lib/gcc/arm-linux-gnueabi/9.2.1/../../../../arm-linux-gnueabi/bin/ld: cannot find -lgcc
> > > | /usr/lib/gcc/arm-linux-gnueabi/9.2.1/../../../../arm-linux-gnueabi/bin/ld: cannot find -lgcc
> > > | collect2: error: ld returned 1 exit status
> >
> > Ah I see, so libgcc.a is mandatory for aarch32 but that isn't the case
> > for aarch64 where only having a shared library seems to be sufficient.
>
> Well, I don't have all the old versions of the toolchain around to check, but
> yes, gcc9 and gcc8 both seem to be like that:
>
> arm32 - libgcc_s.so is an ld script that requires libgcc.a
> arm64 - libgcc_s.so is just a symlink to libgcc_s.so.1
>
> Not sure why arm32 requires some functions from the static lib, while arm64
> doesn't. I would assume it depends on how the toolchain was built...
>
>
> > > This already has been fixed before in this commit:
> > > https://git.linaro.org/openembedded/meta-linaro.git/commit/?id=91ea4d017bf0598e49944e76c889e66d58c066ce
> > >
> >
> > There were mainly two reasons to revert libgcc static library packaging:
> >
> > 1. It was done improperly earlier leading to following QA issues:
> >
> > ERROR: external-arm-toolchain-2019.12-r0 do_package_qa: QA Issue: non
> > -staticdev package contains static .a library: libgcc-dev path
> > '/work/aarch64-poky-linux/external-arm-toolchain/2019.12-r0/packages-split/libgcc-dev/usr/lib/aarch64-none-linux-gnu/9.2.1/libgcc_eh.a'
> > non -staticdev package contains static .a library: libgcc-dev path
> > '/work/aarch64-poky-linux/external-arm-toolchain/2019.12-r0/packages-split/libgcc-dev/usr/lib/aarch64-none-linux-gnu/9.2.1/libgcc.a'
> > [staticdev]
> > ERROR: external-arm-toolchain-2019.12-r0 do_package_qa: QA run found
> > fatal errors. Please consider fixing them.
> > ERROR: Logfile of failure stored in:
> > /home/sumit.garg/T2502/poky/build/tmp/work/aarch64-poky-linux/external-arm-toolchain/2019.12-r0/temp/log.do_package_qa.8281
> > ERROR: Task (/home/sumit.garg/T2502/poky/meta-arm/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb:do_package_qa)
> > failed with exit code '1'
>
> That's what INSANE_SKIP_libgcc-dev += "staticdev" is for - back then it wasn't
> a fatal error, hence wasn't there.
>
>
> > 2. There wasn't any motivation mentioned in your earlier commit
> > message like this commit does to include libgcc static library.
>
> Well, it may not have been 100% clear, but it did imply it was needed for
> development:
>
> * Install additional static libs, stubs and header files
> * Needed for -dev versions of libgcc, libgfortran and other packages
> ...
>
>
> > > But then it got broken/undone here w/o due review:
> > > https://git.linaro.org/openembedded/meta-linaro.git/commit/?id=b43d5f0ce431ba1e242504641266a63293ded5db
> > >
> > > Even though it's a static library, we want it to be in libgcc-dev as it's
> > > not optional, but rather required for development.
> >
> > Yeah it's required for aarch32 but optional for aarch64.
> >
> > So you could elaborate more in the commit message that this change is
> > specifically required for arm32.
>
> Were there any tests done on arm32? How about arm64?
>

I think I was pretty explicit about testing here [1]. Native
compilation wasn't in scope as the native compiler is altogether
different from pre-built toolchain (cross-compilation).

Regarding libgcc for native compilation, I did explore a bit further
and it seems that you are correct, the compiler mandates "-lgcc" to
build executable files while "-lgcc_s" can be used optionally to build
dynamic objects.

So we can go ahead with this patch itself with:

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>

[1] https://lists.yoctoproject.org/g/yocto/message/48094

-Sumit

> >
> > >
> > > Signed-off-by: Denys Dmytriyenko <denys@ti.com>
> > > ---
> > >  .../recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb  | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb
> > > index 04d8923..8cfc208 100644
> > > --- a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb
> > > +++ b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb
> > > @@ -117,7 +117,7 @@ do_install() {
> > >         sed -i -e 's#/bin/bash#/bin/sh#' ${D}${bindir}/ldd
> > >
> > >         cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/crt*.o ${D}${libdir}/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
> > > -
> > > +       cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/libgcc* ${D}${libdir}/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
> > >         cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/libgcov* ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
> > >         cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/include ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
> > >         cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/finclude ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
> > > @@ -310,6 +310,7 @@ INSANE_SKIP_${PN}-utils += "ldflags"
> > >  INSANE_SKIP_libstdc++ += "ldflags"
> > >  INSANE_SKIP_libgfortran += "ldflags"
> > >  INSANE_SKIP_libgcc += "ldflags dev-deps"
> > > +INSANE_SKIP_libgcc-dev += "staticdev"
> >
> > This change was missing from your earlier commit.
> >
> > -Sumit
> >
> > >  INSANE_SKIP_libgfortran += "ldflags dev-deps"
> > >  INSANE_SKIP_libstdc++ += "ldflags dev-deps"
> > >  INSANE_SKIP_libatomic += "ldflags"
> > > --
> > > 2.7.4
> > >
> > > 
> >

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [meta-arm] [PATCH] external-arm-toolchain: un-break target compilation
  2020-06-08 10:09     ` Sumit Garg
@ 2020-06-08 15:47       ` Jon Mason
  0 siblings, 0 replies; 5+ messages in thread
From: Jon Mason @ 2020-06-08 15:47 UTC (permalink / raw)
  To: Sumit Garg; +Cc: Denys Dmytriyenko, meta-arm, Denys Dmytriyenko

On Mon, Jun 08, 2020 at 03:39:52PM +0530, Sumit Garg wrote:
> On Fri, 5 Jun 2020 at 05:15, Denys Dmytriyenko <denis@denix.org> wrote:
> >
> > On Thu, Jun 04, 2020 at 11:43:08AM +0530, Sumit Garg wrote:
> > > On Thu, 4 Jun 2020 at 05:54, Denys Dmytriyenko <denis@denix.org> wrote:
> > > >
> > > > From: Denys Dmytriyenko <denys@ti.com>
> > > >
> > > > Compiling on the target using runtime libs from external-arm-toolchain
> > > > requires libgcc.a, as libgcc_s.so explains:
> > > >
> > > > /* GNU ld script
> > > >    Use the shared library, but some functions are only in
> > > >    the static library.  */
> > > > GROUP ( libgcc_s.so.1 -lgcc )
> > > >
> > > > Otherwise it results in errors like:
> > > > | /usr/lib/gcc/arm-linux-gnueabi/9.2.1/../../../../arm-linux-gnueabi/bin/ld: cannot find -lgcc
> > > > | /usr/lib/gcc/arm-linux-gnueabi/9.2.1/../../../../arm-linux-gnueabi/bin/ld: cannot find -lgcc
> > > > | collect2: error: ld returned 1 exit status
> > >
> > > Ah I see, so libgcc.a is mandatory for aarch32 but that isn't the case
> > > for aarch64 where only having a shared library seems to be sufficient.
> >
> > Well, I don't have all the old versions of the toolchain around to check, but
> > yes, gcc9 and gcc8 both seem to be like that:
> >
> > arm32 - libgcc_s.so is an ld script that requires libgcc.a
> > arm64 - libgcc_s.so is just a symlink to libgcc_s.so.1
> >
> > Not sure why arm32 requires some functions from the static lib, while arm64
> > doesn't. I would assume it depends on how the toolchain was built...
> >
> >
> > > > This already has been fixed before in this commit:
> > > > https://git.linaro.org/openembedded/meta-linaro.git/commit/?id=91ea4d017bf0598e49944e76c889e66d58c066ce
> > > >
> > >
> > > There were mainly two reasons to revert libgcc static library packaging:
> > >
> > > 1. It was done improperly earlier leading to following QA issues:
> > >
> > > ERROR: external-arm-toolchain-2019.12-r0 do_package_qa: QA Issue: non
> > > -staticdev package contains static .a library: libgcc-dev path
> > > '/work/aarch64-poky-linux/external-arm-toolchain/2019.12-r0/packages-split/libgcc-dev/usr/lib/aarch64-none-linux-gnu/9.2.1/libgcc_eh.a'
> > > non -staticdev package contains static .a library: libgcc-dev path
> > > '/work/aarch64-poky-linux/external-arm-toolchain/2019.12-r0/packages-split/libgcc-dev/usr/lib/aarch64-none-linux-gnu/9.2.1/libgcc.a'
> > > [staticdev]
> > > ERROR: external-arm-toolchain-2019.12-r0 do_package_qa: QA run found
> > > fatal errors. Please consider fixing them.
> > > ERROR: Logfile of failure stored in:
> > > /home/sumit.garg/T2502/poky/build/tmp/work/aarch64-poky-linux/external-arm-toolchain/2019.12-r0/temp/log.do_package_qa.8281
> > > ERROR: Task (/home/sumit.garg/T2502/poky/meta-arm/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb:do_package_qa)
> > > failed with exit code '1'
> >
> > That's what INSANE_SKIP_libgcc-dev += "staticdev" is for - back then it wasn't
> > a fatal error, hence wasn't there.
> >
> >
> > > 2. There wasn't any motivation mentioned in your earlier commit
> > > message like this commit does to include libgcc static library.
> >
> > Well, it may not have been 100% clear, but it did imply it was needed for
> > development:
> >
> > * Install additional static libs, stubs and header files
> > * Needed for -dev versions of libgcc, libgfortran and other packages
> > ...
> >
> >
> > > > But then it got broken/undone here w/o due review:
> > > > https://git.linaro.org/openembedded/meta-linaro.git/commit/?id=b43d5f0ce431ba1e242504641266a63293ded5db
> > > >
> > > > Even though it's a static library, we want it to be in libgcc-dev as it's
> > > > not optional, but rather required for development.
> > >
> > > Yeah it's required for aarch32 but optional for aarch64.
> > >
> > > So you could elaborate more in the commit message that this change is
> > > specifically required for arm32.
> >
> > Were there any tests done on arm32? How about arm64?
> >
> 
> I think I was pretty explicit about testing here [1]. Native
> compilation wasn't in scope as the native compiler is altogether
> different from pre-built toolchain (cross-compilation).
> 
> Regarding libgcc for native compilation, I did explore a bit further
> and it seems that you are correct, the compiler mandates "-lgcc" to
> build executable files while "-lgcc_s" can be used optionally to build
> dynamic objects.
> 
> So we can go ahead with this patch itself with:
> 
> Reviewed-by: Sumit Garg <sumit.garg@linaro.org>

Pulled into master.

Thanks,
Jon

> 
> [1] https://lists.yoctoproject.org/g/yocto/message/48094
> 
> -Sumit
> 
> > >
> > > >
> > > > Signed-off-by: Denys Dmytriyenko <denys@ti.com>
> > > > ---
> > > >  .../recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb  | 3 ++-
> > > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb
> > > > index 04d8923..8cfc208 100644
> > > > --- a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb
> > > > +++ b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb
> > > > @@ -117,7 +117,7 @@ do_install() {
> > > >         sed -i -e 's#/bin/bash#/bin/sh#' ${D}${bindir}/ldd
> > > >
> > > >         cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/crt*.o ${D}${libdir}/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
> > > > -
> > > > +       cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/libgcc* ${D}${libdir}/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
> > > >         cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/libgcov* ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
> > > >         cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/include ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
> > > >         cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/finclude ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
> > > > @@ -310,6 +310,7 @@ INSANE_SKIP_${PN}-utils += "ldflags"
> > > >  INSANE_SKIP_libstdc++ += "ldflags"
> > > >  INSANE_SKIP_libgfortran += "ldflags"
> > > >  INSANE_SKIP_libgcc += "ldflags dev-deps"
> > > > +INSANE_SKIP_libgcc-dev += "staticdev"
> > >
> > > This change was missing from your earlier commit.
> > >
> > > -Sumit
> > >
> > > >  INSANE_SKIP_libgfortran += "ldflags dev-deps"
> > > >  INSANE_SKIP_libstdc++ += "ldflags dev-deps"
> > > >  INSANE_SKIP_libatomic += "ldflags"
> > > > --
> > > > 2.7.4
> > > >
> > > > 
> > >

> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-06-08 15:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-04  0:24 [PATCH] external-arm-toolchain: un-break target compilation Denys Dmytriyenko
2020-06-04  6:13 ` [meta-arm] " Sumit Garg
2020-06-04 23:45   ` Denys Dmytriyenko
2020-06-08 10:09     ` Sumit Garg
2020-06-08 15:47       ` Jon Mason

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.