external-arm-toolchain: Add support for SDK generation
v2 cover external-arm-toolchain: Add support for SDK generation
Patch #1 #2 and #3 adds impprovements in external-arm-toolchain recipe in order to support SDK generation. SDK generation has been tested using:
$ bitbake core-image-base -c populate_sdk
Currently generated SDK only uses glibc provided by pre-built toolchain. The cross compiler, binutils, gdb/gdbserver etc. are built from source. This is something we would like to improve in future to package most of the components from pre-built toolchain instead.
Generated SDK has been tested using testsdk as follows:
$ bitbake core-image-base -c testsdk
Results:
SDK testing environment: aarch64-poky-linux
GalculatorTest class: SDK doesn't contain gettext
No python package in the SDK
RESULTS:
RESULTS - assimp.BuildAssimp.test_assimp: PASSED (97.93s)
RESULTS - buildcpio.BuildCpioTest.test_cpio: PASSED (22.51s)
RESULTS - buildepoxy.EpoxyTest.test_epoxy: PASSED (17.40s)
RESULTS - buildlzip.BuildLzipTest.test_lzip: PASSED (2.52s)
RESULTS - gcc.GccCompileTest.test_gcc_compile: PASSED (0.06s)
RESULTS - gcc.GccCompileTest.test_gpp2_compile: PASSED (0.08s)
RESULTS - gcc.GccCompileTest.test_gpp_compile: PASSED (0.10s)
RESULTS - gcc.GccCompileTest.test_make: PASSED (0.06s)
RESULTS - perl.PerlTest.test_perl: PASSED (0.23s)
RESULTS - python.Python3Test.test_python3: PASSED (0.03s)
RESULTS - buildgalculator.GalculatorTest.test_galculator: SKIPPED (0.00s)
RESULTS - python.Python2Test.test_python2: SKIPPED (0.00s)
SUMMARY:
core-image-base sdk (poky-glibc-x86_64-core-image-base-aarch64-qemuarm64-toolchain-3.1+snapshot.sh:environment-setup-aarch64-poky-linux) - Ran 12 tests in 140.936s core-image-base sdk - OK - All required tests passed (successes=10, skipped=2, failures=0, errors=0)
Patch #4 adds a README for meta-arm-toolchain layer.
Patch #5 adds package specific licences for external-arm-toolchain recipe.
Changes in v2:
- Adds a new patch #3 which fixes issues reported by testsdk.
- Define FILES_${PN}-dev from scratch which additionally refines packaging for dev headers as well.
- Make README common for whole meta-arm-toolchain layer rather than specific to pre-built toolchain. Add myself as layer maintainer although I would be happy to add another co-maintainer if someone is willing to volunteer.
- Update README with testing info for external-arm-toolchain.
- Misc. fixups.
Sumit Garg (5):
external-arm-toolchain: Remove glibc locale dependency
external-arm-toolchain: Refine dev libraries/headers packaging
external-arm-toolchain: Align glibc packaging to OE TARGET_SYS
meta-arm-toolchain: Add README
external-arm-toolchain: Add package specific licenses
meta-arm-toolchain/README.md | 113 +++++++++++++++++++++ .../conf/distro/include/tcmode-external-arm.inc | 1 + .../external-arm-toolchain.bb | 70 +++++++++++-- .../external-arm-toolchain/license.inc | 76 ++++++++++++++ .../recipes-devtools/gcc/gcc-arm-common.inc | 2 +- 5 files changed, 251 insertions(+), 11 deletions(-) create mode 100644 meta-arm-toolchain/README.md create mode 100644 meta-arm-toolchain/recipes-devtools/external-arm-toolchain/license.inc
Signature · 1 line
2.7.4
PATCH v2 1/5 external-arm-toolchain: Remove glibc locale dependency
Currently external Arm toolchain recipe doesn't provide packages corresponding to OE glibc locale recipe. So explicitly remove corresponding libc dependencies until we sort out glibc locale packaging rather than blocking OE SDK generation which is still useful without glibc locale packaging.
--- meta-arm-toolchain/conf/distro/include/tcmode-external-arm.inc | 1 + 1 file changed, 1 insertion(+)
meta-arm-toolchain/conf/distro/include/tcmode-external-arm.inc +1 -0
@@ -58,6 +58,7 @@ DISTRO_FEATURES_LIBC = "ipv4 ipv6 libc-backtrace libc-big-macros libc-bsd libc-c ENABLE_BINARY_LOCALE_GENERATION = "0" GLIBC_INTERNAL_USE_BINARY_LOCALE = "precompiled" LIBCOVERRIDE = ":libc-glibc" +LIBC_DEPENDENCIES_remove = "glibc-gconv-cp1252 glibc-gconv-ibm850 glibc-gconv-iso8859-1 glibc-gconv-iso8859-15 glibc-localedata-i18n" ERROR_QA[type] ?= "list" python toolchain_metadata_setup () {
Signature · 1 line
2.7.4
PATCH v2 2/5 external-arm-toolchain: Refine dev libraries/headers packaging
In reply to Sumit GargOE core by default package all libraries/headers installed as "${libdir}/lib*.so", "${libdir}/*.la" and {includedir} as part of FILES_${PN}-dev" but in case of external Arm toolchain recipe, multiple packages are provided which needs to include specific libraries and headers. So define "FILES_${PN}-dev" from scratch in order to package dev libraries/headers as part of intended packages and only package remaining libraries/headers as part of "FILES_${PN}-dev".
--- .../external-arm-toolchain.bb | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+)
meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb +48 -0
@@ -546,6 +546,54 @@ FILES_${PN} += "\ ${base_libdir}/libpcprofile.so \ " +FILES_${PN}-dev = "\ + ${includedir}/*.h \ + ${includedir}/netatalk/ \ + ${includedir}/netiucv/ \ + ${includedir}/neteconet/ \ + ${includedir}/nfs/ \ + ${includedir}/rpcsvc/ \ + ${includedir}/netipx/ \ + ${includedir}/misc/ \ + ${includedir}/rpc/ \ + ${includedir}/sys/ \ + ${includedir}/netrose/ \ + ${includedir}/arpa/ \ + ${includedir}/netinet/ \ + ${includedir}/netrom/ \ + ${includedir}/finclude/ \ + ${includedir}/netax25/ \ + ${includedir}/netash/ \ + ${includedir}/bits/ \ + ${includedir}/xen/ \ + ${includedir}/netpacket/ \ + ${includedir}/drm/ \ + ${includedir}/net/ \ + ${includedir}/protocols/ \ + ${includedir}/gnu/ \ + ${base_libdir}/*_nonshared.a \ + ${base_libdir}/*.o \ + ${datadir}/aclocal \ + ${libdir}/*.o \ + ${libdir}/*_nonshared.a \ + ${libdir}/libcrypt.so \ + ${libdir}/libc.so \ + ${libdir}/libm.so \ + ${libdir}/libpthread.so \ + ${libdir}/libresolv.so \ + ${libdir}/librt.so \ + ${libdir}/libutil.so \ + ${libdir}/libnss_files.so \ + ${libdir}/libnss_compat.so \ + ${libdir}/libnss_dns.so \ + ${libdir}/libnss_hesiod.so \ + ${libdir}/libnss_db.so \ + ${libdir}/libdl.so \ + ${libdir}/libanl.so \ + ${libdir}/libBrokenLocale.so \ + ${libdir}/libthread_db.so \ + " + FILES_${PN}-dbg += "${base_libdir}/debug" # From gcc-runtime.inc
Signature · 1 line
2.7.4
PATCH v2 3/5 external-arm-toolchain: Align glibc packaging to OE TARGET_SYS
In reply to Sumit GargOE native and cross compilers (in case of SDK) uses OE TARGET_SYS to create standard paths to search for libraries and headers during compilation.
Currently external-arm-toolchain recipe temporarily override TARGET_SYS with EAT_TARGET_SYS and packages libraries and headers corresponding to EAT_TARGET_SYS which leads to failures during native and cross compilation (in case of SDK) such as:
$ $CXX -o hello++ hello.cpp
In file included from hello.cpp:1:
/tmp/armsdk/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/c++/9.2.1/iostream:38:10: fatal error: bits/c++config.h: No such file or directory
38 | #include <bits/c++config.h>
| ^~~~~~~~~~~~~~~~~~
compilation terminated.$ $CC hello.c real-ld: cannot find crtbeginS.o: No such file or directory
So remove temp override of TARGET_SYS and rather package libraries and headers corresponding to OE TARGET_SYS.
This fixes changes added in commit:
https://git.linaro.org/openembedded/meta-linaro.git/commit/?id=91ea4d017bf0598e49944e76c889e66d58c066ce
Also, update location for unwind.h gcc-arm-common.inc accordingly.
--- .../external-arm-toolchain/external-arm-toolchain.bb | 18 ++++++++++-------- .../recipes-devtools/gcc/gcc-arm-common.inc | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-)
meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb +10 -8
@@ -54,7 +54,6 @@ PROVIDES += "\ PV = "${EAT_VER_MAIN}" BINV = "${EAT_VER_GCC}" -TARGET_SYS = "${EAT_TARGET_SYS}" SRC_URI = "file://SUPPORTED"
@@ -75,8 +74,8 @@ do_install() { install -d ${D}${datadir} install -d ${D}${includedir} install -d ${D}/include - install -d ${D}${libdir}/${EAT_TARGET_SYS}/${EAT_VER_GCC} - install -d ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC} + install -d ${D}${libdir}/${TARGET_SYS}/${EAT_VER_GCC} + install -d ${D}${libdir}/gcc/${TARGET_SYS}/${EAT_VER_GCC} CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership" cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/${EAT_LIBDIR}/* ${D}${base_libdir}
@@ -105,6 +104,9 @@ do_install() { fi cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/include/* ${D}${includedir} + if [ -d ${D}${includedir}/c++/${EAT_VER_GCC}/${EAT_TARGET_SYS} ]; then + mv ${D}${includedir}/c++/${EAT_VER_GCC}/${EAT_TARGET_SYS} ${D}${includedir}/c++/${EAT_VER_GCC}/${TARGET_SYS} + fi ln -sf ../usr/include/c++ ${D}/include/c++ cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/bin/* ${D}${bindir}
@@ -116,11 +118,11 @@ do_install() { sed -i -e 's#/bin/bash#/bin/sh#' ${D}${bindir}/tzselect 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}/ + cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/crt*.o ${D}${libdir}/${TARGET_SYS}/${EAT_VER_GCC}/ + cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/libgcc* ${D}${libdir}/${TARGET_SYS}/${EAT_VER_GCC}/ + cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/libgcov* ${D}${libdir}/gcc/${TARGET_SYS}/${EAT_VER_GCC}/ + cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/include ${D}${libdir}/gcc/${TARGET_SYS}/${EAT_VER_GCC}/ + cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/finclude ${D}${libdir}/gcc/${TARGET_SYS}/${EAT_VER_GCC}/ # fix up the copied symlinks (they are still pointing to the multiarch directory) linker_name="${@bb.utils.contains("TUNE_FEATURES", "aarch64", "ld-linux-aarch64.so.1", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "ld-linux-armhf.so.3", "ld-linux.so.3",d), d)}"
meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc +1 -1
@@ -12,7 +12,7 @@ do_install_prepend_class-target () { if [ "${TCMODE}" = "external-arm" -a ! -f ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/unwind.h ]; then install -d ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/ - install ${STAGING_LIBDIR}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/include/unwind.h ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/ + install ${STAGING_LIBDIR}/gcc/${TARGET_SYS}/${EAT_VER_GCC}/include/unwind.h ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/ fi }
Signature · 1 line
2.7.4
PATCH v2 4/5 meta-arm-toolchain: Add README
In reply to Sumit GargDocument usage details for GNU Arm toolchains which could either be built from source or pre-built.
--- meta-arm-toolchain/README.md | 113 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 meta-arm-toolchain/README.md
meta-arm-toolchain/README.md new file +113 -0
@@ -0,0 +1,113 @@ +meta-arm-toolchain Yocto Layer +============================== + +This layer contains recipes for GNU Arm toolchains which could either be built +from source or pre-built toolchain binaries. + +Information regarding contributing, reporting bugs, etc can be found in the +top-level meta-arm readme file. + +Source Arm toolchain for Linux development +------------------------------------------ + +Recipes for GNU Arm toolchain built from source are provided under +``recipes-devtools/gcc/``. In order to use Arm toolchain instead of OE core +toolchain, one just needs to override ``GCCVERSION`` in corresponding distro +conf file. + +- Eg. to use GNU Arm toolchain version ``9.2`` + GCCVERSION = "arm-9.2" + +Pre-built Arm toolchain for Linux development +--------------------------------------------- + +Recipes for pre-built GNU Arm toolchain for Linux development are provided under +``recipes-devtools/external-arm-toolchain/``. + +external-arm-toolchain.bb +~~~~~~~~~~~~~~~~~~~~~~~~~ + +This recipe provides support for pre-built GNU toolchains targeting processors +from the Arm Cortex-A family and implementing the Arm A-profile architecture. + +Usage +^^^^^ + +In order to use any of pre-built Arm toolchain versions (8.2, 8.3, 9.2 and so +on), a user needs to download and untar tool-set on host machine at a particular +installation path eg: ``/opt/toolchain/``. Then user needs to specify following +in ``conf/local.conf`` in order to replace OE toolchain with pre-built GNU-A +toolchain: + +TCMODE = "external-arm" +EXTERNAL_TOOLCHAIN = "<path-to-the-toolchain>" + +- Eg. for AArch64 (eg. qemuarm64 machine in poky distro) + EXTERNAL_TOOLCHAIN = "\ + <installation-path>/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu \ + " + +- Eg. for AArch32 (eg. qemuarm machine in poky distro) + EXTERNAL_TOOLCHAIN = "\ + <installation-path>/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf \ + " + +Supported distros and machines +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Since this pre-built GNU-A tool-set simply replaces OE toolchain, so it is +meant to be distro and machine agnostic as long as one is cross-compiling for +Arm A-profile architecture. + +Tested distro and machines (for zeus stable release): +1. Distro: poky; machines: qemuarm and qemuarm64 (build and boot tested) +2. Distro: RPB; machines: dragonboard-410c (build and boot tested) +3. Distro: world; machines: qemuarm and qemuarm64. Build tested for following + layers: + - poky/meta + - poky/meta-poky + - poky/meta-yocto-bsp + - meta-openembedded/meta-oe + - meta-openembedded/meta-python + - meta-openembedded/meta-networking + +SDK support +^^^^^^^^^^^ + +Pre-built toochain provides support to build OE SDK which has been tested using +following commands: + +$ bitbake core-image-base -c populate_sdk +$ bitbake core-image-base -c testsdk + +Note: Currently generated SDK only uses glibc provided by pre-built toolchain. + The cross compiler, binutils, gdb/gdbserver etc. are built from source. + This is something we would like to improve in future in order to package + most of the components from pre-built toolchain instead. + +Pre-built Arm toolchain for bare-metal development +-------------------------------------------------- + +Recipes for pre-built GNU Arm toolchain for bare-metal development are provided +under ``recipes-devtools/external-arm-toolchain/``. + +gcc-arm-none-eabi_<version>.bb +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This recipe provides support for pre-built GNU Arm Embedded toolchain for +bare-metal software development on devices based on 32-bit Arm Cortex-A, +Cortex-R and Cortex-M processors. + +Supported version: 9-2019-q4-major + +gcc-aarch64-none-elf_<version>.bb +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This recipe provides support for pre-built GNU Arm toolchain for bare-metal +software development on devices based on 64-bit Arm Cortex-A processors. + +Supported version: 9.2-2019.12 + +Layer maintainer(s) +------------------- +* Sumit Garg <[email protected]>
Signature · 1 line
2.7.4
PATCH v2 5/5 external-arm-toolchain: Add package specific licenses
In reply to Sumit GargAdd license.inc file to state license of various packages provided by pre-built Arm tool-set.
--- .../external-arm-toolchain.bb | 4 +- .../external-arm-toolchain/license.inc | 76 ++++++++++++++++++++++ 2 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 meta-arm-toolchain/recipes-devtools/external-arm-toolchain/license.inc
meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb +2 -2
@@ -1,9 +1,9 @@ require recipes-core/glibc/glibc-package.inc +require license.inc + INHIBIT_DEFAULT_DEPS = "1" -# License applies to this recipe code, not the toolchain itself -LICENSE = "MIT" LIC_FILES_CHKSUM = "\ file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302 \ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420 \
meta-arm-toolchain/recipes-devtools/external-arm-toolchain/license.inc new file +76 -0
76 lines not on this page · raw message
Signature · 1 line
2.7.4
Quoted 40 lines · Sumit Garg
Patch #1 #2 and #3 adds impprovements in external-arm-toolchain recipe in order to support SDK generation. SDK generation has been tested using:
$ bitbake core-image-base -c populate_sdkCurrently generated SDK only uses glibc provided by pre-built toolchain. The cross compiler, binutils, gdb/gdbserver etc. are built from source. This is something we would like to improve in future to package most of the components from pre-built toolchain instead.
Generated SDK has been tested using testsdk as follows:
$ bitbake core-image-base -c testsdkResults:
SDK testing environment: aarch64-poky-linux
GalculatorTest class: SDK doesn't contain gettext
No python package in the SDK
RESULTS:
RESULTS - assimp.BuildAssimp.test_assimp: PASSED (97.93s)
RESULTS - buildcpio.BuildCpioTest.test_cpio: PASSED (22.51s)
RESULTS - buildepoxy.EpoxyTest.test_epoxy: PASSED (17.40s)
RESULTS - buildlzip.BuildLzipTest.test_lzip: PASSED (2.52s)
RESULTS - gcc.GccCompileTest.test_gcc_compile: PASSED (0.06s)
RESULTS - gcc.GccCompileTest.test_gpp2_compile: PASSED (0.08s)
RESULTS - gcc.GccCompileTest.test_gpp_compile: PASSED (0.10s)
RESULTS - gcc.GccCompileTest.test_make: PASSED (0.06s)
RESULTS - perl.PerlTest.test_perl: PASSED (0.23s)
RESULTS - python.Python3Test.test_python3: PASSED (0.03s)
RESULTS - buildgalculator.GalculatorTest.test_galculator: SKIPPED (0.00s)
RESULTS - python.Python2Test.test_python2: SKIPPED (0.00s)
SUMMARY:
core-image-base sdk (poky-glibc-x86_64-core-image-base-aarch64-qemuarm64-toolchain-3.1+snapshot.sh:environment-setup-aarch64-poky-linux) - Ran 12 tests in 140.936s core-image-base sdk - OK - All required tests passed (successes=10, skipped=2, failures=0, errors=0)Patch #4 adds a README for meta-arm-toolchain layer.
Patch #5 adds package specific licences for external-arm-toolchain recipe.
Quoted 9 lines
Changes in v2:
- Adds a new patch #3 which fixes issues reported by testsdk.
- Define FILES_${PN}-dev from scratch which additionally refines packaging for dev headers as well.
- Make README common for whole meta-arm-toolchain layer rather than specific to pre-built toolchain. Add myself as layer maintainer although I would be happy to add another co-maintainer if someone is willing to volunteer.
- Update README with testing info for external-arm-toolchain.
- Misc. fixups.
Given Denys and Paul's comments on the previous series, I would like their ack/nack before pulling in.
Thanks,
Jon
Quoted 22 lines
Sumit Garg (5):
external-arm-toolchain: Remove glibc locale dependency
external-arm-toolchain: Refine dev libraries/headers packaging
external-arm-toolchain: Align glibc packaging to OETARGET_SYS
meta-arm-toolchain: Add README
external-arm-toolchain: Add package specific licensesmeta-arm-toolchain/README.md | 113 +++++++++++++++++++++ .../conf/distro/include/tcmode-external-arm.inc | 1 + .../external-arm-toolchain.bb | 70 +++++++++++-- .../external-arm-toolchain/license.inc | 76 ++++++++++++++ .../recipes-devtools/gcc/gcc-arm-common.inc | 2 +- 5 files changed, 251 insertions(+), 11 deletions(-) create mode 100644 meta-arm-toolchain/README.md create mode 100644 meta-arm-toolchain/recipes-devtools/external-arm-toolchain/license.incSignature · 1 line
2.7.4
Re: [PATCH v2 3/5] external-arm-toolchain: Align glibc packaging to OE TARGET_SYS
In reply to Sumit GargQuoted 16 lines · Sumit Garg
OE native and cross compilers (in case of SDK) uses OE
TARGET_SYSto create standard paths to search for libraries and headers during compilation.Currently external-arm-toolchain recipe temporarily override
TARGET_SYSwithEAT_TARGET_SYSand packages libraries and headers corresponding toEAT_TARGET_SYSwhich leads to failures during native and cross compilation (in case of SDK) such as:$ $CXX -o hello++ hello.cpp In file included from hello.cpp:1: /tmp/armsdk/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/c++/9.2.1/iostream:38:10: fatal error: bits/c++config.h: No such file or directory 38 | #include <bits/c++config.h> | ^~~~~~~~~~~~~~~~~~ compilation terminated.
Quoted 5 lines
$ $CC hello.c real-ld: cannot find crtbeginS.o: No such file or directorySo remove temp override of
TARGET_SYSand rather package libraries and headers corresponding to OETARGET_SYS.
Yeah, I tried this before some time ago... It didn't work for me for all the use cases. It works for you for SDK because you build an OE compiler from sources for that case. If you try to use EAT (external ARM toolchain) with OE SDK, it would fail.
TARGET_SYS != EAT_TARGET_SYS is indeed inconvenient, but has been there for long time. There are other assumptions and limitations in some places of OE and those are not restricted to external-arm-toolchain, e.g. you can see similar workarounds for musl toolchain:
/usr/lib:
arm-oe-linux-musleabi/
arm-oe-linux-gnueabi -> arm-oe-linux-musleabi
arm-oe-linux-musleabihf -> arm-oe-linux-musleabi
Similar to that, I've been fixing it in many places like:
/usr/lib:
arm-linux-gnueabihf/
arm-linux-gnueabi -> arm-linux-gnueabihf
/usr/include/c++/<version>/:
arm-linux-gnueabihf/
arm-linux-gnueabi -> arm-linux-gnueabihf
BTW, arm-linux-gnueabihf is EAT gcc8, EAT gcc9 uses arm-none-linux-gnueabihf:
/usr/lib:
arm-none-linux-gnueabihf/
arm-linux-gnueabi -> arm-none-linux-gnueabihf
So, using such symlinks allows both OE compiler and EAT cross-compiler to find runtime libraries and headers correctly, both on-target and in SDK sysroot.
So, in general, I would welcome this simplification if TARGET_SYS was the same as EAT_TARGET_SYS, but I don't believe it's that easy to pull it off...
Signature · 1 line
Denys
Quoted 77 lines
This fixes changes added in commit:
https://git.linaro.org/openembedded/meta-linaro.git/commit/?id=91ea4d017bf0598e49944e76c889e66d58c066ceAlso, update location for
unwind.hgcc-arm-common.inc accordingly.Signed-off-by Sumit Garg <[email protected]>--- .../external-arm-toolchain/external-arm-toolchain.bb | 18 ++++++++++-------- .../recipes-devtools/gcc/gcc-arm-common.inc | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-)meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb +10
-8@@ -54,7 +54,6 @@ PROVIDES += "\ PV = "${EAT_VER_MAIN}" BINV = "${EAT_VER_GCC}" -TARGET_SYS = "${EAT_TARGET_SYS}" SRC_URI = "file://SUPPORTED"@@ -75,8 +74,8 @@ do_install() { install -d ${D}${datadir} install -d ${D}${includedir} install -d ${D}/include - install -d ${D}${libdir}/${EAT_TARGET_SYS}/${EAT_VER_GCC} - install -d ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC} + install -d ${D}${libdir}/${TARGET_SYS}/${EAT_VER_GCC} + install -d ${D}${libdir}/gcc/${TARGET_SYS}/${EAT_VER_GCC} CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership" cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/${EAT_LIBDIR}/* ${D}${base_libdir}@@ -105,6 +104,9 @@ do_install() { fi cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/include/* ${D}${includedir} + if [ -d ${D}${includedir}/c++/${EAT_VER_GCC}/${EAT_TARGET_SYS} ]; then + mv ${D}${includedir}/c++/${EAT_VER_GCC}/${EAT_TARGET_SYS} ${D}${includedir}/c++/${EAT_VER_GCC}/${TARGET_SYS} + fi ln -sf ../usr/include/c++ ${D}/include/c++ cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/bin/* ${D}${bindir}@@ -116,11 +118,11 @@ do_install() { sed -i -e 's#/bin/bash#/bin/sh#' ${D}${bindir}/tzselect 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}/ + cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/crt*.o ${D}${libdir}/${TARGET_SYS}/${EAT_VER_GCC}/ + cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/libgcc* ${D}${libdir}/${TARGET_SYS}/${EAT_VER_GCC}/ + cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/libgcov* ${D}${libdir}/gcc/${TARGET_SYS}/${EAT_VER_GCC}/ + cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/include ${D}${libdir}/gcc/${TARGET_SYS}/${EAT_VER_GCC}/ + cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/finclude ${D}${libdir}/gcc/${TARGET_SYS}/${EAT_VER_GCC}/ # fix up the copied symlinks (they are still pointing to the multiarch directory) linker_name="${@bb.utils.contains("TUNE_FEATURES", "aarch64", "ld-linux-aarch64.so.1", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "ld-linux-armhf.so.3", "ld-linux.so.3",d), d)}"meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc +1
-1@@ -12,7 +12,7 @@ do_install_prepend_class-target () { if [ "${TCMODE}" = "external-arm" -a ! -f ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/unwind.h ]; then install -d ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/ - install ${STAGING_LIBDIR}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/include/unwind.h ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/ + install ${STAGING_LIBDIR}/gcc/${TARGET_SYS}/${EAT_VER_GCC}/include/unwind.h ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/ fi }Signature · 1 line
2.7.4
Quoted 27 lines · Sumit Garg
Patch #1 #2 and #3 adds impprovements in external-arm-toolchain recipe in order to support SDK generation. SDK generation has been tested using:
$ bitbake core-image-base -c populate_sdkCurrently generated SDK only uses glibc provided by pre-built toolchain. The cross compiler, binutils, gdb/gdbserver etc. are built from source. This is something we would like to improve in future to package most of the components from pre-built toolchain instead.
Generated SDK has been tested using testsdk as follows:
$ bitbake core-image-base -c testsdkResults:
SDK testing environment: aarch64-poky-linux GalculatorTest class: SDK doesn't contain gettext
No python package in the SDK
RESULTS:
RESULTS - assimp.BuildAssimp.test_assimp: PASSED (97.93s) RESULTS - buildcpio.BuildCpioTest.test_cpio: PASSED (22.51s) RESULTS - buildepoxy.EpoxyTest.test_epoxy: PASSED (17.40s) RESULTS - buildlzip.BuildLzipTest.test_lzip: PASSED (2.52s) RESULTS - gcc.GccCompileTest.test_gcc_compile: PASSED (0.06s) RESULTS - gcc.GccCompileTest.test_gpp2_compile: PASSED (0.08s) RESULTS - gcc.GccCompileTest.test_gpp_compile: PASSED (0.10s)
Quoted 8 lines
RESULTS - gcc.GccCompileTest.test_make: PASSED (0.06s)
RESULTS - perl.PerlTest.test_perl: PASSED (0.23s)
RESULTS - python.Python3Test.test_python3: PASSED (0.03s)
RESULTS - buildgalculator.GalculatorTest.test_galculator: SKIPPED (0.00s)
RESULTS - python.Python2Test.test_python2: SKIPPED (0.00s)
SUMMARY:
core-image-base sdk (poky-glibc-x86_64-core-image-base-aarch64-qemuarm64-toolchain-3.1+snapshot.sh:environment-setup-aarch64-poky-linux) - Ran 12 tests in 140.936s core-image-base sdk - OK - All required tests passed (successes=10, skipped=2, failures=0, errors=0)
Thank you very much for publishing test results! This is a huge improvement! We should definitely do this more often for our patch submissions.
Quoted 33 lines
Patch #4 adds a README for meta-arm-toolchain layer.
Patch #5 adds package specific licences for external-arm-toolchain recipe.
Changes in v2:
- Adds a new patch #3 which fixes issues reported by testsdk.
- Define FILES_${PN}-dev from scratch which additionally refines packaging for dev headers as well.
- Make README common for whole meta-arm-toolchain layer rather than specific to pre-built toolchain. Add myself as layer maintainer although I would be happy to add another co-maintainer if someone is willing to volunteer.
- Update README with testing info for external-arm-toolchain.
- Misc. fixups.Sumit Garg (5):
external-arm-toolchain: Remove glibc locale dependency
external-arm-toolchain: Refine dev libraries/headers packaging
external-arm-toolchain: Align glibc packaging to OETARGET_SYS
meta-arm-toolchain: Add README
external-arm-toolchain: Add package specific licensesmeta-arm-toolchain/README.md | 113 +++++++++++++++++++++ .../conf/distro/include/tcmode-external-arm.inc | 1 + .../external-arm-toolchain.bb | 70 +++++++++++-- .../external-arm-toolchain/license.inc | 76 ++++++++++++++ .../recipes-devtools/gcc/gcc-arm-common.inc | 2 +- 5 files changed, 251 insertions(+), 11 deletions(-) create mode 100644 meta-arm-toolchain/README.md create mode 100644 meta-arm-toolchain/recipes-devtools/external-arm-toolchain/license.incSignature · 1 line
2.7.4
Re: [meta-arm] [PATCH v2 1/5] external-arm-toolchain: Remove glibc locale dependency
In reply to Sumit GargQuoted 5 lines · Sumit Garg
Currently external Arm toolchain recipe doesn't provide packages corresponding to OE glibc locale recipe. So explicitly remove corresponding libc dependencies until we sort out glibc locale packaging rather than blocking OE SDK generation which is still useful without glibc locale packaging.
I guess we can merge this one for now with the idea of getting back to it later and trying to properly package gconv libs and locales.
Quoted 1 line
Signed-off-by Sumit Garg <[email protected]>
meta-arm-toolchain/conf/distro/include/tcmode-external-arm.inc DISTRO_FEATURES_LIBC = "ipv4 ipv6 libc-backtrace libc-big-macros libc-bsd libc-c · line 61
Quoted 13 lines
--- meta-arm-toolchain/conf/distro/include/tcmode-external-arm.inc | 1 + 1 file changed, 1 insertion(+)meta-arm-toolchain/conf/distro/include/tcmode-external-arm.inc +1
-0@@ -58,6 +58,7 @@ DISTRO_FEATURES_LIBC = "ipv4 ipv6 libc-backtrace libc-big-macros libc-bsd libc-c ENABLE_BINARY_LOCALE_GENERATION = "0" GLIBC_INTERNAL_USE_BINARY_LOCALE = "precompiled" LIBCOVERRIDE = ":libc-glibc" +LIBC_DEPENDENCIES_remove = "glibc-gconv-cp1252 glibc-gconv-ibm850 glibc-gconv-iso8859-1 glibc-gconv-iso8859-15 glibc-localedata-i18n"
BTW, avoiding _remove would require adding intermediary variable to OE-Core just for this sub-list in order to clear it out downstream...
Quoted 7 lines
meta-arm-toolchain/conf/distro/include/tcmode-external-arm.inc +0
-0ERROR_QA[type] ?= "list" python toolchain_metadata_setup () {Signature · 1 line
2.7.4
Re: [PATCH v2 2/5] external-arm-toolchain: Refine dev libraries/headers packaging
In reply to Sumit GargQuoted 7 lines · Sumit Garg
OE core by default package all libraries/headers installed as "${libdir}/lib*.so", "${libdir}/*.la" and {includedir} as part of FILES_${PN}-dev" but in case of external Arm toolchain recipe, multiple packages are provided which needs to include specific libraries and headers. So define "FILES_${PN}-dev" from scratch in order to package dev libraries/headers as part of intended packages and only package remaining libraries/headers as part of "FILES_${PN}-dev".
This is probably fine, but have you considered/tried re-ordering list of PACKAGES, moving ${PN}-dev to the end? That way it would let other packages to pick up their files before collecting the remainder. Not sure, but I wonder if that would be any cleaner...
Quoted 67 lines
Signed-off-by Sumit Garg <[email protected]>--- .../external-arm-toolchain.bb | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+)meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb +48
-0@@ -546,6 +546,54 @@ FILES_${PN} += "\ ${base_libdir}/libpcprofile.so \ " +FILES_${PN}-dev = "\ + ${includedir}/*.h \ + ${includedir}/netatalk/ \ + ${includedir}/netiucv/ \ + ${includedir}/neteconet/ \ + ${includedir}/nfs/ \ + ${includedir}/rpcsvc/ \ + ${includedir}/netipx/ \ + ${includedir}/misc/ \ + ${includedir}/rpc/ \ + ${includedir}/sys/ \ + ${includedir}/netrose/ \ + ${includedir}/arpa/ \ + ${includedir}/netinet/ \ + ${includedir}/netrom/ \ + ${includedir}/finclude/ \ + ${includedir}/netax25/ \ + ${includedir}/netash/ \ + ${includedir}/bits/ \ + ${includedir}/xen/ \ + ${includedir}/netpacket/ \ + ${includedir}/drm/ \ + ${includedir}/net/ \ + ${includedir}/protocols/ \ + ${includedir}/gnu/ \ + ${base_libdir}/*_nonshared.a \ + ${base_libdir}/*.o \ + ${datadir}/aclocal \ + ${libdir}/*.o \ + ${libdir}/*_nonshared.a \ + ${libdir}/libcrypt.so \ + ${libdir}/libc.so \ + ${libdir}/libm.so \ + ${libdir}/libpthread.so \ + ${libdir}/libresolv.so \ + ${libdir}/librt.so \ + ${libdir}/libutil.so \ + ${libdir}/libnss_files.so \ + ${libdir}/libnss_compat.so \ + ${libdir}/libnss_dns.so \ + ${libdir}/libnss_hesiod.so \ + ${libdir}/libnss_db.so \ + ${libdir}/libdl.so \ + ${libdir}/libanl.so \ + ${libdir}/libBrokenLocale.so \ + ${libdir}/libthread_db.so \ + " + FILES_${PN}-dbg += "${base_libdir}/debug" # From gcc-runtime.incSignature · 1 line
2.7.4
Re: [PATCH v2 5/5] external-arm-toolchain: Add package specific licenses
In reply to Sumit GargQuoted 4 lines · Sumit Garg
Add license.inc file to state license of various packages provided by pre-built Arm tool-set.
Signed-off-by Sumit Garg <[email protected]>
Quoted 107 lines
--- .../external-arm-toolchain.bb | 4 +- .../external-arm-toolchain/license.inc | 76 ++++++++++++++++++++++ 2 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 meta-arm-toolchain/recipes-devtools/external-arm-toolchain/license.incmeta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb +2
-2@@ -1,9 +1,9 @@ require recipes-core/glibc/glibc-package.inc +require license.inc + INHIBIT_DEFAULT_DEPS = "1" -# License applies to this recipe code, not the toolchain itself -LICENSE = "MIT" LIC_FILES_CHKSUM = "\ file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302 \ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420 \meta-arm-toolchain/recipes-devtools/external-arm-toolchain/license.inc new file +76
-0@@ -0,0 +1,76 @@ +LICENSE = "GPL-3.0-with-GCC-exception & GPLv3 & GPLv2 & LGPLv3 & LGPLv2.1 & LGPLv2" + +EAT_GCC_LICENSE = "GPL-3.0-with-GCC-exception & GPLv3" +EAT_LIBC_LICENSE = "GPLv2 & LGPLv2.1" + +LICENSE_${PN} = "${EAT_LIBC_LICENSE}" +LICENSE_${PN}-dev = "${EAT_LIBC_LICENSE}" +LICENSE_${PN}-doc = "${EAT_LIBC_LICENSE}" +LICENSE_${PN}-dbg = "${EAT_LIBC_LICENSE}" +LICENSE_${PN}-pic = "${EAT_LIBC_LICENSE}" +LICENSE_${PN}-utils = "${EAT_LIBC_LICENSE}" +LICENSE_${PN}-mtrace = "${EAT_LIBC_LICENSE}" +LICENSE_${PN}-gconv = "${EAT_LIBC_LICENSE}" +LICENSE_${PN}-extra-nss = "${EAT_LIBC_LICENSE}" +LICENSE_${PN}-thread-db = "${EAT_LIBC_LICENSE}" +LICENSE_${PN}-pcprofile = "${EAT_LIBC_LICENSE}" +LICENSE_${PN}-staticdev = "${EAT_LIBC_LICENSE}" +LICENSE_catchsegv = "${EAT_LIBC_LICENSE}" +LICENSE_glibc-extra-nss = "${EAT_LIBC_LICENSE}" +LICENSE_glibc-thread-db = "${EAT_LIBC_LICENSE}" + +LICENSE_libmemusage = "${EAT_LIBC_LICENSE}" +LICENSE_libsegfault = "${EAT_LIBC_LICENSE}" +LICENSE_libsotruss = "${EAT_LIBC_LICENSE}" +LICENSE_sln = "${EAT_LIBC_LICENSE}" +LICENSE_nscd = "${EAT_LIBC_LICENSE}" +LICENSE_ldd = "${EAT_LIBC_LICENSE}" + +LICENSE_libasan-dev = "${EAT_GCC_LICENSE}" +LICENSE_libasan = "${EAT_GCC_LICENSE}" +LICENSE_libasan-staticdev = "${EAT_GCC_LICENSE}" +LICENSE_libatomic-dev = "${EAT_GCC_LICENSE}" +LICENSE_libatomic = "${EAT_GCC_LICENSE}" +LICENSE_libatomic-staticdev = "${EAT_GCC_LICENSE}" +LICENSE_libg2c-dev = "${EAT_GCC_LICENSE}" +LICENSE_libg2c = "${EAT_GCC_LICENSE}" +LICENSE_libgcc-dev = "${EAT_GCC_LICENSE}" +LICENSE_libgcc = "${EAT_GCC_LICENSE}" +LICENSE_libgfortran-dbg = "${EAT_GCC_LICENSE}" +LICENSE_libgfortran-dev = "${EAT_GCC_LICENSE}" +LICENSE_libgfortran = "${EAT_GCC_LICENSE}" +LICENSE_libgfortran-staticdev = "${EAT_GCC_LICENSE}" +LICENSE_libgomp-dev = "${EAT_GCC_LICENSE}" +LICENSE_libgomp = "${EAT_GCC_LICENSE}" +LICENSE_libgomp-staticdev = "${EAT_GCC_LICENSE}" +LICENSE_libitm-dev = "${EAT_GCC_LICENSE}" +LICENSE_libitm = "${EAT_GCC_LICENSE}" +LICENSE_libitm-staticdev = "${EAT_GCC_LICENSE}" +LICENSE_liblsan-dev = "${EAT_GCC_LICENSE}" +LICENSE_liblsan = "${EAT_GCC_LICENSE}" +LICENSE_liblsan-staticdev = "${EAT_GCC_LICENSE}" +LICENSE_libmudflap-dev = "${EAT_GCC_LICENSE}" +LICENSE_libmudflap = "${EAT_GCC_LICENSE}" +LICENSE_libmudflap-staticdev = "${EAT_GCC_LICENSE}" +LICENSE_libquadmath-dev = "${EAT_GCC_LICENSE}" +LICENSE_libquadmath = "${EAT_GCC_LICENSE}" +LICENSE_libquadmath-staticdev = "${EAT_GCC_LICENSE}" +LICENSE_libssp-dev = "${EAT_GCC_LICENSE}" +LICENSE_libssp = "${EAT_GCC_LICENSE}" +LICENSE_libssp-staticdev = "${EAT_GCC_LICENSE}" +LICENSE_libstdc++-dbg = "${EAT_GCC_LICENSE}" +LICENSE_libstdc++-dev = "${EAT_GCC_LICENSE}" +LICENSE_libstdc++ = "${EAT_GCC_LICENSE}" +LICENSE_libstdc++-precompile-dev = "${EAT_GCC_LICENSE}" +LICENSE_libstdc++-staticdev = "${EAT_GCC_LICENSE}" +LICENSE_libtsan-dev = "${EAT_GCC_LICENSE}" +LICENSE_libtsan = "${EAT_GCC_LICENSE}" +LICENSE_libtsan-staticdev = "${EAT_GCC_LICENSE}" +LICENSE_libubsan-dev = "${EAT_GCC_LICENSE}" +LICENSE_libubsan = "${EAT_GCC_LICENSE}" +LICENSE_libubsan-staticdev = "${EAT_GCC_LICENSE}" + +LICENSE_linux-libc-headers-dev = "GPLv2" +LICENSE_linux-libc-headers = "GPLv2" + +LICENSE_gdbserver = "GPLv2 & GPLv3 & LGPLv2 & LGPLv3"Signature · 1 line
2.7.4
Re: [PATCH v2 3/5] external-arm-toolchain: Align glibc packaging to OE TARGET_SYS
In reply to Denys DmytriyenkoQuoted 21 lines · Denys Dmytriyenko
Quoted 19 lines · Sumit Garg
OE native and cross compilers (in case of SDK) uses OE
TARGET_SYSto create standard paths to search for libraries and headers during compilation.Currently external-arm-toolchain recipe temporarily override
TARGET_SYSwithEAT_TARGET_SYSand packages libraries and headers corresponding toEAT_TARGET_SYSwhich leads to failures during native and cross compilation (in case of SDK) such as:$ $CXX -o hello++ hello.cpp In file included from hello.cpp:1: /tmp/armsdk/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/c++/9.2.1/iostream:38:10: fatal error: bits/c++config.h: No such file or directory 38 | #include <bits/c++config.h> | ^~~~~~~~~~~~~~~~~~ compilation terminated.$ $CC hello.c real-ld: cannot find crtbeginS.o: No such file or directory
Quoted 7 lines
Quoted 2 lines
So remove temp override of
TARGET_SYSand rather package libraries and headers corresponding to OETARGET_SYS.Yeah, I tried this before some time ago... It didn't work for me for all the use cases. It works for you for SDK because you build an OE compiler from sources for that case. If you try to use EAT (external ARM toolchain) with OE SDK, it would fail.
Agree, I guess this is one of your downstream use-case which is something we would like to be supported in upstream as well in future.
Quoted 21 lines
TARGET_SYS!=EAT_TARGET_SYSis indeed inconvenient, but has been there for long time. There are other assumptions and limitations in some places of OE and those are not restricted to external-arm-toolchain, e.g. you can see similar workarounds for musl toolchain:
/usr/lib:
arm-oe-linux-musleabi/
arm-oe-linux-gnueabi -> arm-oe-linux-musleabi
arm-oe-linux-musleabihf -> arm-oe-linux-musleabiSimilar to that, I've been fixing it in many places like:
/usr/lib:
arm-linux-gnueabihf/
arm-linux-gnueabi -> arm-linux-gnueabihf/usr/include/c++/<version>/:
arm-linux-gnueabihf/
arm-linux-gnueabi -> arm-linux-gnueabihf
Quoted 8 lines
BTW, arm-linux-gnueabihf is EAT gcc8, EAT gcc9 uses arm-none-linux-gnueabihf:
/usr/lib:
arm-none-linux-gnueabihf/
arm-linux-gnueabi -> arm-none-linux-gnueabihfSo, using such symlinks allows both OE compiler and EAT cross-compiler to find runtime libraries and headers correctly, both on-target and in SDK sysroot.
Makes sense, will add symlinks for EAT_TARGET_SYS in order to continue supporting your downstream use-cases.
Quoted 3 lines
So, in general, I would welcome this simplification if
TARGET_SYSwas the same asEAT_TARGET_SYS, but I don't believe it's that easy to pull it off...
Yeah, this is the first thing I did to override TARGET_SYS with EAT_TARGET_SYS but it led to OE recipes to fail.
-Sumit
Quoted 82 lines
--
DenysQuoted 77 lines
This fixes changes added in commit:
https://git.linaro.org/openembedded/meta-linaro.git/commit/?id=91ea4d017bf0598e49944e76c889e66d58c066ceAlso, update location for
unwind.hgcc-arm-common.inc accordingly.Signed-off-by Sumit Garg <[email protected]>--- .../external-arm-toolchain/external-arm-toolchain.bb | 18 ++++++++++-------- .../recipes-devtools/gcc/gcc-arm-common.inc | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-)meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb +10
-8@@ -54,7 +54,6 @@ PROVIDES += "\ PV = "${EAT_VER_MAIN}" BINV = "${EAT_VER_GCC}" -TARGET_SYS = "${EAT_TARGET_SYS}" SRC_URI = "file://SUPPORTED"@@ -75,8 +74,8 @@ do_install() { install -d ${D}${datadir} install -d ${D}${includedir} install -d ${D}/include - install -d ${D}${libdir}/${EAT_TARGET_SYS}/${EAT_VER_GCC} - install -d ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC} + install -d ${D}${libdir}/${TARGET_SYS}/${EAT_VER_GCC} + install -d ${D}${libdir}/gcc/${TARGET_SYS}/${EAT_VER_GCC} CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership" cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/${EAT_LIBDIR}/* ${D}${base_libdir}@@ -105,6 +104,9 @@ do_install() { fi cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/include/* ${D}${includedir} + if [ -d ${D}${includedir}/c++/${EAT_VER_GCC}/${EAT_TARGET_SYS} ]; then + mv ${D}${includedir}/c++/${EAT_VER_GCC}/${EAT_TARGET_SYS} ${D}${includedir}/c++/${EAT_VER_GCC}/${TARGET_SYS} + fi ln -sf ../usr/include/c++ ${D}/include/c++ cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/bin/* ${D}${bindir}@@ -116,11 +118,11 @@ do_install() { sed -i -e 's#/bin/bash#/bin/sh#' ${D}${bindir}/tzselect 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}/ + cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/crt*.o ${D}${libdir}/${TARGET_SYS}/${EAT_VER_GCC}/ + cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/libgcc* ${D}${libdir}/${TARGET_SYS}/${EAT_VER_GCC}/ + cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/libgcov* ${D}${libdir}/gcc/${TARGET_SYS}/${EAT_VER_GCC}/ + cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/include ${D}${libdir}/gcc/${TARGET_SYS}/${EAT_VER_GCC}/ + cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/finclude ${D}${libdir}/gcc/${TARGET_SYS}/${EAT_VER_GCC}/ # fix up the copied symlinks (they are still pointing to the multiarch directory) linker_name="${@bb.utils.contains("TUNE_FEATURES", "aarch64", "ld-linux-aarch64.so.1", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "ld-linux-armhf.so.3", "ld-linux.so.3",d), d)}"meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc +1
-2@@ -12,7 +12,7 @@ do_install_prepend_class-target () { if [ "${TCMODE}" = "external-arm" -a ! -f ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/unwind.h ]; then install -d ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/ - install ${STAGING_LIBDIR}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/include/unwind.h ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/ + install ${STAGING_LIBDIR}/gcc/${TARGET_SYS}/${EAT_VER_GCC}/include/unwind.h ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/ fi } --2.7.4
Re: [PATCH v2 3/5] external-arm-toolchain: Align glibc packaging to OE TARGET_SYS
Quoted 60 lines · Sumit Garg
Quoted 21 lines · Denys Dmytriyenko
Quoted 19 lines · Sumit Garg
OE native and cross compilers (in case of SDK) uses OE
TARGET_SYSto create standard paths to search for libraries and headers during compilation.Currently external-arm-toolchain recipe temporarily override
TARGET_SYSwithEAT_TARGET_SYSand packages libraries and headers corresponding toEAT_TARGET_SYSwhich leads to failures during native and cross compilation (in case of SDK) such as:$ $CXX -o hello++ hello.cpp In file included from hello.cpp:1: /tmp/armsdk/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/c++/9.2.1/iostream:38:10: fatal error: bits/c++config.h: No such file or directory 38 | #include <bits/c++config.h> | ^~~~~~~~~~~~~~~~~~ compilation terminated.$ $CC hello.c real-ld: cannot find crtbeginS.o: No such file or directoryQuoted 7 lines
Quoted 2 lines
So remove temp override of
TARGET_SYSand rather package libraries and headers corresponding to OETARGET_SYS.Yeah, I tried this before some time ago... It didn't work for me for all the use cases. It works for you for SDK because you build an OE compiler from sources for that case. If you try to use EAT (external ARM toolchain) with OE SDK, it would fail.
Agree, I guess this is one of your downstream use-case which is something we would like to be supported in upstream as well in future.
Quoted 27 lines
TARGET_SYS!=EAT_TARGET_SYSis indeed inconvenient, but has been there for long time. There are other assumptions and limitations in some places of OE and those are not restricted to external-arm-toolchain, e.g. you can see similar workarounds for musl toolchain:
/usr/lib:
arm-oe-linux-musleabi/
arm-oe-linux-gnueabi -> arm-oe-linux-musleabi
arm-oe-linux-musleabihf -> arm-oe-linux-musleabiSimilar to that, I've been fixing it in many places like:
/usr/lib:
arm-linux-gnueabihf/
arm-linux-gnueabi -> arm-linux-gnueabihf/usr/include/c++/<version>/:
arm-linux-gnueabihf/
arm-linux-gnueabi -> arm-linux-gnueabihfBTW, arm-linux-gnueabihf is EAT gcc8, EAT gcc9 uses arm-none-linux-gnueabihf:
/usr/lib:
arm-none-linux-gnueabihf/
arm-linux-gnueabi -> arm-none-linux-gnueabihf
Quoted 5 lines
Quoted 2 lines
So, using such symlinks allows both OE compiler and EAT cross-compiler to find runtime libraries and headers correctly, both on-target and in SDK sysroot.
Makes sense, will add symlinks for
EAT_TARGET_SYSin order to continue supporting your downstream use-cases.
You don't have to do everything by yourself - I'm more than happy to contribute! Let me dust off some of my code... :)
Quoted 91 lines
Quoted 2 lines
So, in general, I would welcome this simplification if
TARGET_SYSwas the same asEAT_TARGET_SYS, but I don't believe it's that easy to pull it off...Yeah, this is the first thing I did to override
TARGET_SYSwithEAT_TARGET_SYSbut it led to OE recipes to fail.-Sumit
Quoted 82 lines
--
DenysQuoted 77 lines
This fixes changes added in commit:
https://git.linaro.org/openembedded/meta-linaro.git/commit/?id=91ea4d017bf0598e49944e76c889e66d58c066ceAlso, update location for
unwind.hgcc-arm-common.inc accordingly.Signed-off-by Sumit Garg <[email protected]>--- .../external-arm-toolchain/external-arm-toolchain.bb | 18 ++++++++++-------- .../recipes-devtools/gcc/gcc-arm-common.inc | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-)meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb +10
-8@@ -54,7 +54,6 @@ PROVIDES += "\ PV = "${EAT_VER_MAIN}" BINV = "${EAT_VER_GCC}" -TARGET_SYS = "${EAT_TARGET_SYS}" SRC_URI = "file://SUPPORTED"@@ -75,8 +74,8 @@ do_install() { install -d ${D}${datadir} install -d ${D}${includedir} install -d ${D}/include - install -d ${D}${libdir}/${EAT_TARGET_SYS}/${EAT_VER_GCC} - install -d ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC} + install -d ${D}${libdir}/${TARGET_SYS}/${EAT_VER_GCC} + install -d ${D}${libdir}/gcc/${TARGET_SYS}/${EAT_VER_GCC} CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership" cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/${EAT_LIBDIR}/* ${D}${base_libdir}@@ -105,6 +104,9 @@ do_install() { fi cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/include/* ${D}${includedir} + if [ -d ${D}${includedir}/c++/${EAT_VER_GCC}/${EAT_TARGET_SYS} ]; then + mv ${D}${includedir}/c++/${EAT_VER_GCC}/${EAT_TARGET_SYS} ${D}${includedir}/c++/${EAT_VER_GCC}/${TARGET_SYS} + fi ln -sf ../usr/include/c++ ${D}/include/c++ cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/bin/* ${D}${bindir}@@ -116,11 +118,11 @@ do_install() { sed -i -e 's#/bin/bash#/bin/sh#' ${D}${bindir}/tzselect 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}/ + cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/crt*.o ${D}${libdir}/${TARGET_SYS}/${EAT_VER_GCC}/ + cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/libgcc* ${D}${libdir}/${TARGET_SYS}/${EAT_VER_GCC}/ + cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/libgcov* ${D}${libdir}/gcc/${TARGET_SYS}/${EAT_VER_GCC}/ + cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/include ${D}${libdir}/gcc/${TARGET_SYS}/${EAT_VER_GCC}/ + cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/finclude ${D}${libdir}/gcc/${TARGET_SYS}/${EAT_VER_GCC}/ # fix up the copied symlinks (they are still pointing to the multiarch directory) linker_name="${@bb.utils.contains("TUNE_FEATURES", "aarch64", "ld-linux-aarch64.so.1", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "ld-linux-armhf.so.3", "ld-linux.so.3",d), d)}"meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc +1
-2@@ -12,7 +12,7 @@ do_install_prepend_class-target () { if [ "${TCMODE}" = "external-arm" -a ! -f ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/unwind.h ]; then install -d ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/ - install ${STAGING_LIBDIR}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/include/unwind.h ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/ + install ${STAGING_LIBDIR}/gcc/${TARGET_SYS}/${EAT_VER_GCC}/include/unwind.h ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/ fi } --2.7.4
Re: [PATCH v2 2/5] external-arm-toolchain: Refine dev libraries/headers packaging
In reply to Denys DmytriyenkoQuoted 10 lines · Denys Dmytriyenko
Quoted 7 lines · Sumit Garg
OE core by default package all libraries/headers installed as "${libdir}/lib*.so", "${libdir}/*.la" and {includedir} as part of FILES_${PN}-dev" but in case of external Arm toolchain recipe, multiple packages are provided which needs to include specific libraries and headers. So define "FILES_${PN}-dev" from scratch in order to package dev libraries/headers as part of intended packages and only package remaining libraries/headers as part of "FILES_${PN}-dev".
Quoted 5 lines
This is probably fine, but have you considered/tried re-ordering list of PACKAGES, moving ${PN}-dev to the end? That way it would let other packages to pick up their files before collecting the remainder. Not sure, but I wonder if that would be any cleaner...
Your suggestion sounded useful, so I gave it a try but unfortunately OE core still prefers to package libraries and headers as part of "FILES_${PN}-dev" rather than other intended packages.
Fyi, I just did following change instead of this patch which wasn't successful:
@@ -703,6 +655,17 @@ SUMMARY_libitm-dev = "GNU transactional memory support library - development fil
FILES_libitm-staticdev = "${libdir}/libitm.a" SUMMARY_libitm-staticdev = "GNU transactional memory support library
- static development files"
+# Package remaining dev libraries and headers
+FILES_${PN}-dev = "\
+ ${includedir} \
+ ${base_libdir}/*_nonshared.a \
+ ${base_libdir}/*.o \
+ ${datadir}/aclocal \
+ ${libdir}/*.o \
+ ${libdir}/*_nonshared.a \
+ ${libdir}/*.so \+ "
+
EAT_VER_MAIN ??= ""
-Sumit
Quoted 68 lines
Quoted 68 lines
Signed-off-by Sumit Garg <[email protected]>--- .../external-arm-toolchain.bb | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+)meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb +48
-1@@ -546,6 +546,54 @@ FILES_${PN} += "\ ${base_libdir}/libpcprofile.so \ " +FILES_${PN}-dev = "\ + ${includedir}/*.h \ + ${includedir}/netatalk/ \ + ${includedir}/netiucv/ \ + ${includedir}/neteconet/ \ + ${includedir}/nfs/ \ + ${includedir}/rpcsvc/ \ + ${includedir}/netipx/ \ + ${includedir}/misc/ \ + ${includedir}/rpc/ \ + ${includedir}/sys/ \ + ${includedir}/netrose/ \ + ${includedir}/arpa/ \ + ${includedir}/netinet/ \ + ${includedir}/netrom/ \ + ${includedir}/finclude/ \ + ${includedir}/netax25/ \ + ${includedir}/netash/ \ + ${includedir}/bits/ \ + ${includedir}/xen/ \ + ${includedir}/netpacket/ \ + ${includedir}/drm/ \ + ${includedir}/net/ \ + ${includedir}/protocols/ \ + ${includedir}/gnu/ \ + ${base_libdir}/*_nonshared.a \ + ${base_libdir}/*.o \ + ${datadir}/aclocal \ + ${libdir}/*.o \ + ${libdir}/*_nonshared.a \ + ${libdir}/libcrypt.so \ + ${libdir}/libc.so \ + ${libdir}/libm.so \ + ${libdir}/libpthread.so \ + ${libdir}/libresolv.so \ + ${libdir}/librt.so \ + ${libdir}/libutil.so \ + ${libdir}/libnss_files.so \ + ${libdir}/libnss_compat.so \ + ${libdir}/libnss_dns.so \ + ${libdir}/libnss_hesiod.so \ + ${libdir}/libnss_db.so \ + ${libdir}/libdl.so \ + ${libdir}/libanl.so \ + ${libdir}/libBrokenLocale.so \ + ${libdir}/libthread_db.so \ + " + FILES_${PN}-dbg += "${base_libdir}/debug" # From gcc-runtime.inc --2.7.4
Re: [PATCH v2 3/5] external-arm-toolchain: Align glibc packaging to OE TARGET_SYS
In reply to Denys DmytriyenkoQuoted 62 lines · Denys Dmytriyenko
Quoted 60 lines · Sumit Garg
Quoted 21 lines · Denys Dmytriyenko
Quoted 19 lines · Sumit Garg
OE native and cross compilers (in case of SDK) uses OE
TARGET_SYSto create standard paths to search for libraries and headers during compilation.Currently external-arm-toolchain recipe temporarily override
TARGET_SYSwithEAT_TARGET_SYSand packages libraries and headers corresponding toEAT_TARGET_SYSwhich leads to failures during native and cross compilation (in case of SDK) such as:$ $CXX -o hello++ hello.cpp In file included from hello.cpp:1: /tmp/armsdk/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/c++/9.2.1/iostream:38:10: fatal error: bits/c++config.h: No such file or directory 38 | #include <bits/c++config.h> | ^~~~~~~~~~~~~~~~~~ compilation terminated.$ $CC hello.c real-ld: cannot find crtbeginS.o: No such file or directoryQuoted 7 lines
Quoted 2 lines
So remove temp override of
TARGET_SYSand rather package libraries and headers corresponding to OETARGET_SYS.Yeah, I tried this before some time ago... It didn't work for me for all the use cases. It works for you for SDK because you build an OE compiler from sources for that case. If you try to use EAT (external ARM toolchain) with OE SDK, it would fail.
Agree, I guess this is one of your downstream use-case which is something we would like to be supported in upstream as well in future.
Quoted 27 lines
TARGET_SYS!=EAT_TARGET_SYSis indeed inconvenient, but has been there for long time. There are other assumptions and limitations in some places of OE and those are not restricted to external-arm-toolchain, e.g. you can see similar workarounds for musl toolchain:
/usr/lib:
arm-oe-linux-musleabi/
arm-oe-linux-gnueabi -> arm-oe-linux-musleabi
arm-oe-linux-musleabihf -> arm-oe-linux-musleabiSimilar to that, I've been fixing it in many places like:
/usr/lib:
arm-linux-gnueabihf/
arm-linux-gnueabi -> arm-linux-gnueabihf/usr/include/c++/<version>/:
arm-linux-gnueabihf/
arm-linux-gnueabi -> arm-linux-gnueabihfBTW, arm-linux-gnueabihf is EAT gcc8, EAT gcc9 uses arm-none-linux-gnueabihf:
/usr/lib:
arm-none-linux-gnueabihf/
arm-linux-gnueabi -> arm-none-linux-gnueabihf
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
So, using such symlinks allows both OE compiler and EAT cross-compiler to find runtime libraries and headers correctly, both on-target and in SDK sysroot.
Makes sense, will add symlinks for
EAT_TARGET_SYSin order to continue supporting your downstream use-cases.You don't have to do everything by yourself - I'm more than happy to contribute! Let me dust off some of my code... :)
Sure, I would be happy for you to contribute this change. So is it fine that we go ahead with this patch-set with you contributing additional patch based on this patch-set?
-Sumit
Quoted 93 lines
Quoted 93 lines
Quoted 4 lines
So, in general, I would welcome this simplification if
TARGET_SYSwas the same asEAT_TARGET_SYS, but I don't believe it's that easy to pull it off...Yeah, this is the first thing I did to override
TARGET_SYSwithEAT_TARGET_SYSbut it led to OE recipes to fail.-Sumit
Quoted 82 lines
--
DenysQuoted 77 lines
This fixes changes added in commit:
https://git.linaro.org/openembedded/meta-linaro.git/commit/?id=91ea4d017bf0598e49944e76c889e66d58c066ceAlso, update location for
unwind.hgcc-arm-common.inc accordingly.Signed-off-by Sumit Garg <[email protected]>--- .../external-arm-toolchain/external-arm-toolchain.bb | 18 ++++++++++-------- .../recipes-devtools/gcc/gcc-arm-common.inc | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-)meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb +10
-8@@ -54,7 +54,6 @@ PROVIDES += "\ PV = "${EAT_VER_MAIN}" BINV = "${EAT_VER_GCC}" -TARGET_SYS = "${EAT_TARGET_SYS}" SRC_URI = "file://SUPPORTED"@@ -75,8 +74,8 @@ do_install() { install -d ${D}${datadir} install -d ${D}${includedir} install -d ${D}/include - install -d ${D}${libdir}/${EAT_TARGET_SYS}/${EAT_VER_GCC} - install -d ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC} + install -d ${D}${libdir}/${TARGET_SYS}/${EAT_VER_GCC} + install -d ${D}${libdir}/gcc/${TARGET_SYS}/${EAT_VER_GCC} CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership" cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/${EAT_LIBDIR}/* ${D}${base_libdir}@@ -105,6 +104,9 @@ do_install() { fi cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/include/* ${D}${includedir} + if [ -d ${D}${includedir}/c++/${EAT_VER_GCC}/${EAT_TARGET_SYS} ]; then + mv ${D}${includedir}/c++/${EAT_VER_GCC}/${EAT_TARGET_SYS} ${D}${includedir}/c++/${EAT_VER_GCC}/${TARGET_SYS} + fi ln -sf ../usr/include/c++ ${D}/include/c++ cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/bin/* ${D}${bindir}@@ -116,11 +118,11 @@ do_install() { sed -i -e 's#/bin/bash#/bin/sh#' ${D}${bindir}/tzselect 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}/ + cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/crt*.o ${D}${libdir}/${TARGET_SYS}/${EAT_VER_GCC}/ + cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/libgcc* ${D}${libdir}/${TARGET_SYS}/${EAT_VER_GCC}/ + cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/libgcov* ${D}${libdir}/gcc/${TARGET_SYS}/${EAT_VER_GCC}/ + cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/include ${D}${libdir}/gcc/${TARGET_SYS}/${EAT_VER_GCC}/ + cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/finclude ${D}${libdir}/gcc/${TARGET_SYS}/${EAT_VER_GCC}/ # fix up the copied symlinks (they are still pointing to the multiarch directory) linker_name="${@bb.utils.contains("TUNE_FEATURES", "aarch64", "ld-linux-aarch64.so.1", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "ld-linux-armhf.so.3", "ld-linux.so.3",d), d)}"meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc +1
-2@@ -12,7 +12,7 @@ do_install_prepend_class-target () { if [ "${TCMODE}" = "external-arm" -a ! -f ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/unwind.h ]; then install -d ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/ - install ${STAGING_LIBDIR}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/include/unwind.h ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/ + install ${STAGING_LIBDIR}/gcc/${TARGET_SYS}/${EAT_VER_GCC}/include/unwind.h ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/ fi } --2.7.4
Re: [PATCH v2 2/5] external-arm-toolchain: Refine dev libraries/headers packaging
In reply to Sumit GargQuoted 17 lines · Sumit Garg
Quoted 10 lines · Denys Dmytriyenko
Quoted 7 lines · Sumit Garg
OE core by default package all libraries/headers installed as "${libdir}/lib*.so", "${libdir}/*.la" and {includedir} as part of FILES_${PN}-dev" but in case of external Arm toolchain recipe, multiple packages are provided which needs to include specific libraries and headers. So define "FILES_${PN}-dev" from scratch in order to package dev libraries/headers as part of intended packages and only package remaining libraries/headers as part of "FILES_${PN}-dev".
Quoted 5 lines
This is probably fine, but have you considered/tried re-ordering list of PACKAGES, moving ${PN}-dev to the end? That way it would let other packages to pick up their files before collecting the remainder. Not sure, but I wonder if that would be any cleaner...
Quoted 3 lines
Your suggestion sounded useful, so I gave it a try but unfortunately OE core still prefers to package libraries and headers as part of "FILES_${PN}-dev" rather than other intended packages.
Sorry, I may not have been very clear. I didn't mean moving FILES_${PN}-dev position in the recipe, but rather ${PN}-dev position inside PACKAGES list.
So, if you have FILES_a = "*" and FILES_b = "*" it all depends on which one is listed first in PACKAGES to get all the files: PACKAGES = "a b" or "b a"
This have happened in the past few times, e.g this one is very clear to illustrate the point:
In that case, libgcc-dev had to be moved to the very front of the list to get a chance to pick up the file, which would otherwise go into another package.
But then, immediate expansion (as _remove wasn't available back then) or the use of actual _remove maybe fine for downstream, but otherwise is discouraged.
So, if nothing else works, just re-defining FILES_${PN}-dev should be fine.
Quoted 92 lines
Fyi, I just did following change instead of this patch which wasn't successful:
(quoted diff) +0
-0@@ -703,6 +655,17 @@ SUMMARY_libitm-dev = "GNU transactional memorysupport library - development fil
FILES_libitm-staticdev = "${libdir}/libitm.a" SUMMARY_libitm-staticdev = "GNU transactional memory support library
- static development files"meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb +11
-1+# Package remaining dev libraries and headers +FILES_${PN}-dev = "\ + ${includedir} \ + ${base_libdir}/*_nonshared.a \ + ${base_libdir}/*.o \ + ${datadir}/aclocal \ + ${libdir}/*.o \ + ${libdir}/*_nonshared.a \ + ${libdir}/*.so \ + " + EAT_VER_MAIN ??= "" -SumitQuoted 69 lines
Quoted 69 lines
Signed-off-by Sumit Garg <[email protected]>--- .../external-arm-toolchain.bb | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+)meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb +48
-1@@ -546,6 +546,54 @@ FILES_${PN} += "\ ${base_libdir}/libpcprofile.so \ " +FILES_${PN}-dev = "\ + ${includedir}/*.h \ + ${includedir}/netatalk/ \ + ${includedir}/netiucv/ \ + ${includedir}/neteconet/ \ + ${includedir}/nfs/ \ + ${includedir}/rpcsvc/ \ + ${includedir}/netipx/ \ + ${includedir}/misc/ \ + ${includedir}/rpc/ \ + ${includedir}/sys/ \ + ${includedir}/netrose/ \ + ${includedir}/arpa/ \ + ${includedir}/netinet/ \ + ${includedir}/netrom/ \ + ${includedir}/finclude/ \ + ${includedir}/netax25/ \ + ${includedir}/netash/ \ + ${includedir}/bits/ \ + ${includedir}/xen/ \ + ${includedir}/netpacket/ \ + ${includedir}/drm/ \ + ${includedir}/net/ \ + ${includedir}/protocols/ \ + ${includedir}/gnu/ \ + ${base_libdir}/*_nonshared.a \ + ${base_libdir}/*.o \ + ${datadir}/aclocal \ + ${libdir}/*.o \ + ${libdir}/*_nonshared.a \ + ${libdir}/libcrypt.so \ + ${libdir}/libc.so \ + ${libdir}/libm.so \ + ${libdir}/libpthread.so \ + ${libdir}/libresolv.so \ + ${libdir}/librt.so \ + ${libdir}/libutil.so \ + ${libdir}/libnss_files.so \ + ${libdir}/libnss_compat.so \ + ${libdir}/libnss_dns.so \ + ${libdir}/libnss_hesiod.so \ + ${libdir}/libnss_db.so \ + ${libdir}/libdl.so \ + ${libdir}/libanl.so \ + ${libdir}/libBrokenLocale.so \ + ${libdir}/libthread_db.so \ + " + FILES_${PN}-dbg += "${base_libdir}/debug" # From gcc-runtime.inc --2.7.4
Re: [PATCH v2 2/5] external-arm-toolchain: Refine dev libraries/headers packaging
Quoted 23 lines · Denys Dmytriyenko
Quoted 17 lines · Sumit Garg
Quoted 10 lines · Denys Dmytriyenko
Quoted 7 lines · Sumit Garg
OE core by default package all libraries/headers installed as "${libdir}/lib*.so", "${libdir}/*.la" and {includedir} as part of FILES_${PN}-dev" but in case of external Arm toolchain recipe, multiple packages are provided which needs to include specific libraries and headers. So define "FILES_${PN}-dev" from scratch in order to package dev libraries/headers as part of intended packages and only package remaining libraries/headers as part of "FILES_${PN}-dev".
Quoted 5 lines
This is probably fine, but have you considered/tried re-ordering list of PACKAGES, moving ${PN}-dev to the end? That way it would let other packages to pick up their files before collecting the remainder. Not sure, but I wonder if that would be any cleaner...
Quoted 3 lines
Your suggestion sounded useful, so I gave it a try but unfortunately OE core still prefers to package libraries and headers as part of "FILES_${PN}-dev" rather than other intended packages.
Quoted 6 lines
Sorry, I may not have been very clear. I didn't mean moving FILES_${PN}-dev position in the recipe, but rather ${PN}-dev position inside PACKAGES list.
So, if you have
FILES_a= "*" andFILES_b= "*" it all depends on which one is listed first in PACKAGES to get all the files: PACKAGES = "a b" or "b a"
Sorry I misinterpreted about what you meant. This approach worked like a charm and it's much cleaner I think. So I just did following change instead of this patch:
meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb +13 -0
@@ -307,6 +307,19 @@ PACKAGES =+ "\ linux-libc-headers-dev \ " +# Re-order PACKAGES list in order to shift ${PN}-dev towards the end as +# it is meant to pick up remaining dev libraries and headers that aren't +# picked up by other intended packages. And since some static libraries +# needs to be packaged in ${PN}-dev, so we need to keep ${PN}-staticdev +# later in order. + +PACKAGES := "${@oe.utils.str_filter_out('${PN}-dev', '${PACKAGES}', d)}" +PACKAGES := "${@oe.utils.str_filter_out('${PN}-staticdev', '${PACKAGES}', d)}" +PACKAGES += "\ + ${PN}-dev \ + ${PN}-staticdev \ +" + INSANE_SKIP_${PN}-dbg = "staticdev" INSANE_SKIP_${PN}-utils += "ldflags" INSANE_SKIP_libstdc++ += "ldflags"
If this change looks fine, then I will use it instead for v3.
Quoted 8 lines
This have happened in the past few times, e.g this one is very clear to illustrate the point:
In that case, libgcc-dev had to be moved to the very front of the list to get a chance to pick up the file, which would otherwise go into another package.
Thanks for sharing this example.
-Sumit
Quoted 98 lines
But then, immediate expansion (as
_removewasn't available back then) or the use of actual_removemaybe fine for downstream, but otherwise is discouraged.So, if nothing else works, just re-defining FILES_${PN}-dev should be fine.
Quoted 92 lines
Fyi, I just did following change instead of this patch which wasn't successful:
(quoted diff) +0
-0@@ -703,6 +655,17 @@ SUMMARY_libitm-dev = "GNU transactional memorysupport library - development fil
FILES_libitm-staticdev = "${libdir}/libitm.a" SUMMARY_libitm-staticdev = "GNU transactional memory support library
- static development files"(quoted diff) +11
-1+# Package remaining dev libraries and headers +FILES_${PN}-dev = "\ + ${includedir} \ + ${base_libdir}/*_nonshared.a \ + ${base_libdir}/*.o \ + ${datadir}/aclocal \ + ${libdir}/*.o \ + ${libdir}/*_nonshared.a \ + ${libdir}/*.so \ + " + EAT_VER_MAIN ??= "" -SumitQuoted 69 lines
Quoted 69 lines
Signed-off-by Sumit Garg <[email protected]>--- .../external-arm-toolchain.bb | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+)meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb +48
-1@@ -546,6 +546,54 @@ FILES_${PN} += "\ ${base_libdir}/libpcprofile.so \ " +FILES_${PN}-dev = "\ + ${includedir}/*.h \ + ${includedir}/netatalk/ \ + ${includedir}/netiucv/ \ + ${includedir}/neteconet/ \ + ${includedir}/nfs/ \ + ${includedir}/rpcsvc/ \ + ${includedir}/netipx/ \ + ${includedir}/misc/ \ + ${includedir}/rpc/ \ + ${includedir}/sys/ \ + ${includedir}/netrose/ \ + ${includedir}/arpa/ \ + ${includedir}/netinet/ \ + ${includedir}/netrom/ \ + ${includedir}/finclude/ \ + ${includedir}/netax25/ \ + ${includedir}/netash/ \ + ${includedir}/bits/ \ + ${includedir}/xen/ \ + ${includedir}/netpacket/ \ + ${includedir}/drm/ \ + ${includedir}/net/ \ + ${includedir}/protocols/ \ + ${includedir}/gnu/ \ + ${base_libdir}/*_nonshared.a \ + ${base_libdir}/*.o \ + ${datadir}/aclocal \ + ${libdir}/*.o \ + ${libdir}/*_nonshared.a \ + ${libdir}/libcrypt.so \ + ${libdir}/libc.so \ + ${libdir}/libm.so \ + ${libdir}/libpthread.so \ + ${libdir}/libresolv.so \ + ${libdir}/librt.so \ + ${libdir}/libutil.so \ + ${libdir}/libnss_files.so \ + ${libdir}/libnss_compat.so \ + ${libdir}/libnss_dns.so \ + ${libdir}/libnss_hesiod.so \ + ${libdir}/libnss_db.so \ + ${libdir}/libdl.so \ + ${libdir}/libanl.so \ + ${libdir}/libBrokenLocale.so \ + ${libdir}/libthread_db.so \ + " + FILES_${PN}-dbg += "${base_libdir}/debug" # From gcc-runtime.inc --2.7.4