Received: from mailout4.zoneedit.com (mailout4.zoneedit.com [64.68.198.64]) by mx.groups.io with SMTP id smtpd.web12.284.1591314346859720400 for ; Thu, 04 Jun 2020 16:45:47 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: denix.org, ip: 64.68.198.64, mailfrom: denis@denix.org) Received: from localhost (localhost [127.0.0.1]) by mailout4.zoneedit.com (Postfix) with ESMTP id 3375F40C2E; Thu, 4 Jun 2020 23:45:46 +0000 (UTC) Received: from mailout4.zoneedit.com ([127.0.0.1]) by localhost (zmo14-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id o1jVP0XCFkUZ; Thu, 4 Jun 2020 23:45:46 +0000 (UTC) Received: from mail.denix.org (pool-100-15-86-127.washdc.fios.verizon.net [100.15.86.127]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mailout4.zoneedit.com (Postfix) with ESMTPSA id 0AAB840B89; Thu, 4 Jun 2020 23:45:44 +0000 (UTC) Received: by mail.denix.org (Postfix, from userid 1000) id CD32217320C; Thu, 4 Jun 2020 19:45:43 -0400 (EDT) Date: Thu, 4 Jun 2020 19:45:43 -0400 From: "Denys Dmytriyenko" To: Sumit Garg Cc: meta-arm@lists.yoctoproject.org, Denys Dmytriyenko Subject: Re: [meta-arm] [PATCH] external-arm-toolchain: un-break target compilation Message-ID: <20200604234543.GJ17660@denix.org> References: <1591230242-20553-1-git-send-email-denis@denix.org> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jun 04, 2020 at 11:43:08AM +0530, Sumit Garg wrote: > On Thu, 4 Jun 2020 at 05:54, Denys Dmytriyenko wrote: > > > > From: Denys Dmytriyenko > > > > 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 > > > > > Signed-off-by: Denys Dmytriyenko > > --- > > .../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 > > > > >