All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Denys Dmytriyenko" <denis@denix.org>
To: Sumit Garg <sumit.garg@linaro.org>
Cc: meta-arm@lists.yoctoproject.org, Denys Dmytriyenko <denys@ti.com>
Subject: Re: [meta-arm] [PATCH] external-arm-toolchain: un-break target compilation
Date: Thu, 4 Jun 2020 19:45:43 -0400	[thread overview]
Message-ID: <20200604234543.GJ17660@denix.org> (raw)
In-Reply-To: <CAFA6WYPQFSvzh9S-vF0Ap2h4fzr0dnwDr8hCDdJ7CLXo2mX4=w@mail.gmail.com>

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
> >
> > 
> 

  reply	other threads:[~2020-06-04 23:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2020-06-08 10:09     ` Sumit Garg
2020-06-08 15:47       ` Jon Mason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200604234543.GJ17660@denix.org \
    --to=denis@denix.org \
    --cc=denys@ti.com \
    --cc=meta-arm@lists.yoctoproject.org \
    --cc=sumit.garg@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.