All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] external-arm-toolchain: Add support for SDK generation
@ 2020-06-10 13:42 Sumit Garg
  2020-06-10 13:42 ` [PATCH v2 1/5] external-arm-toolchain: Remove glibc locale dependency Sumit Garg
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: Sumit Garg @ 2020-06-10 13:42 UTC (permalink / raw)
  To: meta-arm
  Cc: pbarker, denis, wmills, richard.purdie, daniel.thompson, 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_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

-- 
2.7.4


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

* [PATCH v2 1/5] external-arm-toolchain: Remove glibc locale dependency
  2020-06-10 13:42 [PATCH v2 0/5] external-arm-toolchain: Add support for SDK generation Sumit Garg
@ 2020-06-10 13:42 ` Sumit Garg
  2020-06-12  4:14   ` [meta-arm] " Denys Dmytriyenko
  2020-06-10 13:42 ` [PATCH v2 2/5] external-arm-toolchain: Refine dev libraries/headers packaging Sumit Garg
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Sumit Garg @ 2020-06-10 13:42 UTC (permalink / raw)
  To: meta-arm
  Cc: pbarker, denis, wmills, richard.purdie, daniel.thompson, 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.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
---
 meta-arm-toolchain/conf/distro/include/tcmode-external-arm.inc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta-arm-toolchain/conf/distro/include/tcmode-external-arm.inc b/meta-arm-toolchain/conf/distro/include/tcmode-external-arm.inc
index 9171380..eee1a51 100644
--- a/meta-arm-toolchain/conf/distro/include/tcmode-external-arm.inc
+++ b/meta-arm-toolchain/conf/distro/include/tcmode-external-arm.inc
@@ -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 () {
-- 
2.7.4


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

* [PATCH v2 2/5] external-arm-toolchain: Refine dev libraries/headers packaging
  2020-06-10 13:42 [PATCH v2 0/5] external-arm-toolchain: Add support for SDK generation Sumit Garg
  2020-06-10 13:42 ` [PATCH v2 1/5] external-arm-toolchain: Remove glibc locale dependency Sumit Garg
@ 2020-06-10 13:42 ` Sumit Garg
  2020-06-12  4:23   ` Denys Dmytriyenko
  2020-06-10 13:43 ` [PATCH v2 3/5] external-arm-toolchain: Align glibc packaging to OE TARGET_SYS Sumit Garg
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Sumit Garg @ 2020-06-10 13:42 UTC (permalink / raw)
  To: meta-arm
  Cc: pbarker, denis, wmills, richard.purdie, daniel.thompson, 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".

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
---
 .../external-arm-toolchain.bb                      | 48 ++++++++++++++++++++++
 1 file changed, 48 insertions(+)

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 8cfc208..5d9a0a8 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
@@ -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


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

* [PATCH v2 3/5] external-arm-toolchain: Align glibc packaging to OE TARGET_SYS
  2020-06-10 13:42 [PATCH v2 0/5] external-arm-toolchain: Add support for SDK generation Sumit Garg
  2020-06-10 13:42 ` [PATCH v2 1/5] external-arm-toolchain: Remove glibc locale dependency Sumit Garg
  2020-06-10 13:42 ` [PATCH v2 2/5] external-arm-toolchain: Refine dev libraries/headers packaging Sumit Garg
@ 2020-06-10 13:43 ` Sumit Garg
  2020-06-12  2:15   ` Denys Dmytriyenko
  2020-06-10 13:43 ` [PATCH v2 4/5] meta-arm-toolchain: Add README Sumit Garg
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Sumit Garg @ 2020-06-10 13:43 UTC (permalink / raw)
  To: meta-arm
  Cc: pbarker, denis, wmills, richard.purdie, daniel.thompson, Sumit Garg

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

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
---
 .../external-arm-toolchain/external-arm-toolchain.bb   | 18 ++++++++++--------
 .../recipes-devtools/gcc/gcc-arm-common.inc            |  2 +-
 2 files changed, 11 insertions(+), 9 deletions(-)

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 5d9a0a8..7c7c607 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
@@ -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)}"
diff --git a/meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc b/meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc
index 5599743..392c57f 100644
--- a/meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc
+++ b/meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc
@@ -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


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

* [PATCH v2 4/5] meta-arm-toolchain: Add README
  2020-06-10 13:42 [PATCH v2 0/5] external-arm-toolchain: Add support for SDK generation Sumit Garg
                   ` (2 preceding siblings ...)
  2020-06-10 13:43 ` [PATCH v2 3/5] external-arm-toolchain: Align glibc packaging to OE TARGET_SYS Sumit Garg
@ 2020-06-10 13:43 ` Sumit Garg
  2020-06-10 13:43 ` [PATCH v2 5/5] external-arm-toolchain: Add package specific licenses Sumit Garg
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 18+ messages in thread
From: Sumit Garg @ 2020-06-10 13:43 UTC (permalink / raw)
  To: meta-arm
  Cc: pbarker, denis, wmills, richard.purdie, daniel.thompson, Sumit Garg

Document usage details for GNU Arm toolchains which could either be built
from source or pre-built.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
---
 meta-arm-toolchain/README.md | 113 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 113 insertions(+)
 create mode 100644 meta-arm-toolchain/README.md

diff --git a/meta-arm-toolchain/README.md b/meta-arm-toolchain/README.md
new file mode 100644
index 0000000..e415136
--- /dev/null
+++ b/meta-arm-toolchain/README.md
@@ -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 <sumit.garg@linaro.org>
-- 
2.7.4


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

* [PATCH v2 5/5] external-arm-toolchain: Add package specific licenses
  2020-06-10 13:42 [PATCH v2 0/5] external-arm-toolchain: Add support for SDK generation Sumit Garg
                   ` (3 preceding siblings ...)
  2020-06-10 13:43 ` [PATCH v2 4/5] meta-arm-toolchain: Add README Sumit Garg
@ 2020-06-10 13:43 ` Sumit Garg
  2020-06-12  4:26   ` Denys Dmytriyenko
  2020-06-11 15:12 ` [meta-arm] [PATCH v2 0/5] external-arm-toolchain: Add support for SDK generation Jon Mason
  2020-06-12  2:18 ` Denys Dmytriyenko
  6 siblings, 1 reply; 18+ messages in thread
From: Sumit Garg @ 2020-06-10 13:43 UTC (permalink / raw)
  To: meta-arm
  Cc: pbarker, denis, wmills, richard.purdie, daniel.thompson, Sumit Garg

Add license.inc file to state license of various packages provided by
pre-built Arm tool-set.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
---
 .../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

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 7c7c607..6968536 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
@@ -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 \
diff --git a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/license.inc b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/license.inc
new file mode 100644
index 0000000..b6ee42c
--- /dev/null
+++ b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/license.inc
@@ -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"
-- 
2.7.4


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

* Re: [meta-arm] [PATCH v2 0/5] external-arm-toolchain: Add support for SDK generation
  2020-06-10 13:42 [PATCH v2 0/5] external-arm-toolchain: Add support for SDK generation Sumit Garg
                   ` (4 preceding siblings ...)
  2020-06-10 13:43 ` [PATCH v2 5/5] external-arm-toolchain: Add package specific licenses Sumit Garg
@ 2020-06-11 15:12 ` Jon Mason
  2020-06-12  2:18 ` Denys Dmytriyenko
  6 siblings, 0 replies; 18+ messages in thread
From: Jon Mason @ 2020-06-11 15:12 UTC (permalink / raw)
  To: Sumit Garg
  Cc: meta-arm, pbarker, denis, wmills, richard.purdie, daniel.thompson

On Wed, Jun 10, 2020 at 07:12:57PM +0530, Sumit Garg wrote:
> 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.

Given Denys and Paul's comments on the previous series, I would like
their ack/nack before pulling in.

Thanks,
Jon

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

> 


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

* Re: [PATCH v2 3/5] external-arm-toolchain: Align glibc packaging to OE TARGET_SYS
  2020-06-10 13:43 ` [PATCH v2 3/5] external-arm-toolchain: Align glibc packaging to OE TARGET_SYS Sumit Garg
@ 2020-06-12  2:15   ` Denys Dmytriyenko
  2020-06-12  5:33     ` Sumit Garg
  0 siblings, 1 reply; 18+ messages in thread
From: Denys Dmytriyenko @ 2020-06-12  2:15 UTC (permalink / raw)
  To: Sumit Garg; +Cc: meta-arm, pbarker, wmills, richard.purdie, daniel.thompson

On Wed, Jun 10, 2020 at 07:13:00PM +0530, Sumit Garg wrote:
> OE 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.

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

-- 
Denys


> 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.
> 
> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> ---
>  .../external-arm-toolchain/external-arm-toolchain.bb   | 18 ++++++++++--------
>  .../recipes-devtools/gcc/gcc-arm-common.inc            |  2 +-
>  2 files changed, 11 insertions(+), 9 deletions(-)
> 
> 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 5d9a0a8..7c7c607 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
> @@ -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)}"
> diff --git a/meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc b/meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc
> index 5599743..392c57f 100644
> --- a/meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc
> +++ b/meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc
> @@ -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
> 

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

* Re: [PATCH v2 0/5] external-arm-toolchain: Add support for SDK generation
  2020-06-10 13:42 [PATCH v2 0/5] external-arm-toolchain: Add support for SDK generation Sumit Garg
                   ` (5 preceding siblings ...)
  2020-06-11 15:12 ` [meta-arm] [PATCH v2 0/5] external-arm-toolchain: Add support for SDK generation Jon Mason
@ 2020-06-12  2:18 ` Denys Dmytriyenko
  6 siblings, 0 replies; 18+ messages in thread
From: Denys Dmytriyenko @ 2020-06-12  2:18 UTC (permalink / raw)
  To: Sumit Garg; +Cc: meta-arm, pbarker, wmills, richard.purdie, daniel.thompson

On Wed, Jun 10, 2020 at 07:12:57PM +0530, Sumit Garg wrote:
> 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)

Thank you very much for publishing test results! This is a huge improvement! 
We should definitely do this more often for our patch submissions.


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

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

* Re: [meta-arm] [PATCH v2 1/5] external-arm-toolchain: Remove glibc locale dependency
  2020-06-10 13:42 ` [PATCH v2 1/5] external-arm-toolchain: Remove glibc locale dependency Sumit Garg
@ 2020-06-12  4:14   ` Denys Dmytriyenko
  0 siblings, 0 replies; 18+ messages in thread
From: Denys Dmytriyenko @ 2020-06-12  4:14 UTC (permalink / raw)
  To: Sumit Garg; +Cc: meta-arm, pbarker, wmills, richard.purdie, daniel.thompson

On Wed, Jun 10, 2020 at 07:12:58PM +0530, Sumit Garg wrote:
> 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.

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

Reviewed-by: Denys Dmytriyenko <denys@ti.com>


> ---
>  meta-arm-toolchain/conf/distro/include/tcmode-external-arm.inc | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/meta-arm-toolchain/conf/distro/include/tcmode-external-arm.inc b/meta-arm-toolchain/conf/distro/include/tcmode-external-arm.inc
> index 9171380..eee1a51 100644
> --- a/meta-arm-toolchain/conf/distro/include/tcmode-external-arm.inc
> +++ b/meta-arm-toolchain/conf/distro/include/tcmode-external-arm.inc
> @@ -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...


>  ERROR_QA[type] ?= "list"
>  python toolchain_metadata_setup () {
> -- 
> 2.7.4
> 

> 


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

* Re: [PATCH v2 2/5] external-arm-toolchain: Refine dev libraries/headers packaging
  2020-06-10 13:42 ` [PATCH v2 2/5] external-arm-toolchain: Refine dev libraries/headers packaging Sumit Garg
@ 2020-06-12  4:23   ` Denys Dmytriyenko
  2020-06-12  7:07     ` Sumit Garg
  0 siblings, 1 reply; 18+ messages in thread
From: Denys Dmytriyenko @ 2020-06-12  4:23 UTC (permalink / raw)
  To: Sumit Garg; +Cc: meta-arm, pbarker, wmills, richard.purdie, daniel.thompson

On Wed, Jun 10, 2020 at 07:12:59PM +0530, Sumit Garg wrote:
> 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...


> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> ---
>  .../external-arm-toolchain.bb                      | 48 ++++++++++++++++++++++
>  1 file changed, 48 insertions(+)
> 
> 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 8cfc208..5d9a0a8 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
> @@ -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
> 

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

* Re: [PATCH v2 5/5] external-arm-toolchain: Add package specific licenses
  2020-06-10 13:43 ` [PATCH v2 5/5] external-arm-toolchain: Add package specific licenses Sumit Garg
@ 2020-06-12  4:26   ` Denys Dmytriyenko
  0 siblings, 0 replies; 18+ messages in thread
From: Denys Dmytriyenko @ 2020-06-12  4:26 UTC (permalink / raw)
  To: Sumit Garg; +Cc: meta-arm, pbarker, wmills, richard.purdie, daniel.thompson

On Wed, Jun 10, 2020 at 07:13:02PM +0530, Sumit Garg wrote:
> Add license.inc file to state license of various packages provided by
> pre-built Arm tool-set.
> 
> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>

Reviewed-by: Denys Dmytriyenko <denys@ti.com>


> ---
>  .../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
> 
> 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 7c7c607..6968536 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
> @@ -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 \
> diff --git a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/license.inc b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/license.inc
> new file mode 100644
> index 0000000..b6ee42c
> --- /dev/null
> +++ b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/license.inc
> @@ -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"
> -- 
> 2.7.4
> 

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

* Re: [PATCH v2 3/5] external-arm-toolchain: Align glibc packaging to OE TARGET_SYS
  2020-06-12  2:15   ` Denys Dmytriyenko
@ 2020-06-12  5:33     ` Sumit Garg
  2020-06-12  6:16       ` Denys Dmytriyenko
  0 siblings, 1 reply; 18+ messages in thread
From: Sumit Garg @ 2020-06-12  5:33 UTC (permalink / raw)
  To: Denys Dmytriyenko
  Cc: meta-arm, Paul Barker, wmills, Richard Purdie, Daniel Thompson

On Fri, 12 Jun 2020 at 07:45, Denys Dmytriyenko <denis@denix.org> wrote:
>
> On Wed, Jun 10, 2020 at 07:13:00PM +0530, Sumit Garg wrote:
> > OE 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.
>
> 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.

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

Makes sense, will add symlinks for EAT_TARGET_SYS in order to continue
supporting your downstream use-cases.

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

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

>
> --
> Denys
>
>
> > 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.
> >
> > Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > ---
> >  .../external-arm-toolchain/external-arm-toolchain.bb   | 18 ++++++++++--------
> >  .../recipes-devtools/gcc/gcc-arm-common.inc            |  2 +-
> >  2 files changed, 11 insertions(+), 9 deletions(-)
> >
> > 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 5d9a0a8..7c7c607 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
> > @@ -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)}"
> > diff --git a/meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc b/meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc
> > index 5599743..392c57f 100644
> > --- a/meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc
> > +++ b/meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc
> > @@ -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
> >

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

* Re: [PATCH v2 3/5] external-arm-toolchain: Align glibc packaging to OE TARGET_SYS
  2020-06-12  5:33     ` Sumit Garg
@ 2020-06-12  6:16       ` Denys Dmytriyenko
  2020-06-12  7:12         ` Sumit Garg
  0 siblings, 1 reply; 18+ messages in thread
From: Denys Dmytriyenko @ 2020-06-12  6:16 UTC (permalink / raw)
  To: Sumit Garg; +Cc: meta-arm, Paul Barker, wmills, Richard Purdie, Daniel Thompson

On Fri, Jun 12, 2020 at 11:03:39AM +0530, Sumit Garg wrote:
> On Fri, 12 Jun 2020 at 07:45, Denys Dmytriyenko <denis@denix.org> wrote:
> >
> > On Wed, Jun 10, 2020 at 07:13:00PM +0530, Sumit Garg wrote:
> > > OE 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.
> >
> > 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.
> 
> >
> > 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.
> 
> Makes sense, will add symlinks for EAT_TARGET_SYS in 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... :)


> > 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...
> 
> 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
> 
> >
> > --
> > Denys
> >
> >
> > > 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.
> > >
> > > Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > > ---
> > >  .../external-arm-toolchain/external-arm-toolchain.bb   | 18 ++++++++++--------
> > >  .../recipes-devtools/gcc/gcc-arm-common.inc            |  2 +-
> > >  2 files changed, 11 insertions(+), 9 deletions(-)
> > >
> > > 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 5d9a0a8..7c7c607 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
> > > @@ -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)}"
> > > diff --git a/meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc b/meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc
> > > index 5599743..392c57f 100644
> > > --- a/meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc
> > > +++ b/meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc
> > > @@ -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
> > >
> 

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

* Re: [PATCH v2 2/5] external-arm-toolchain: Refine dev libraries/headers packaging
  2020-06-12  4:23   ` Denys Dmytriyenko
@ 2020-06-12  7:07     ` Sumit Garg
  2020-06-12  7:35       ` Denys Dmytriyenko
  0 siblings, 1 reply; 18+ messages in thread
From: Sumit Garg @ 2020-06-12  7:07 UTC (permalink / raw)
  To: Denys Dmytriyenko
  Cc: meta-arm, Paul Barker, wmills, Richard Purdie, Daniel Thompson

On Fri, 12 Jun 2020 at 09:53, Denys Dmytriyenko <denis@denix.org> wrote:
>
> On Wed, Jun 10, 2020 at 07:12:59PM +0530, Sumit Garg wrote:
> > 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...
>

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

>
> > Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > ---
> >  .../external-arm-toolchain.bb                      | 48 ++++++++++++++++++++++
> >  1 file changed, 48 insertions(+)
> >
> > 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 8cfc208..5d9a0a8 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
> > @@ -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
> >

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

* Re: [PATCH v2 3/5] external-arm-toolchain: Align glibc packaging to OE TARGET_SYS
  2020-06-12  6:16       ` Denys Dmytriyenko
@ 2020-06-12  7:12         ` Sumit Garg
  0 siblings, 0 replies; 18+ messages in thread
From: Sumit Garg @ 2020-06-12  7:12 UTC (permalink / raw)
  To: Denys Dmytriyenko
  Cc: meta-arm, Paul Barker, wmills, Richard Purdie, Daniel Thompson

On Fri, 12 Jun 2020 at 11:46, Denys Dmytriyenko <denis@denix.org> wrote:
>
> On Fri, Jun 12, 2020 at 11:03:39AM +0530, Sumit Garg wrote:
> > On Fri, 12 Jun 2020 at 07:45, Denys Dmytriyenko <denis@denix.org> wrote:
> > >
> > > On Wed, Jun 10, 2020 at 07:13:00PM +0530, Sumit Garg wrote:
> > > > OE 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.
> > >
> > > 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.
> >
> > >
> > > 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.
> >
> > Makes sense, will add symlinks for EAT_TARGET_SYS in 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

>
>
> > > 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...
> >
> > 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
> >
> > >
> > > --
> > > Denys
> > >
> > >
> > > > 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.
> > > >
> > > > Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > > > ---
> > > >  .../external-arm-toolchain/external-arm-toolchain.bb   | 18 ++++++++++--------
> > > >  .../recipes-devtools/gcc/gcc-arm-common.inc            |  2 +-
> > > >  2 files changed, 11 insertions(+), 9 deletions(-)
> > > >
> > > > 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 5d9a0a8..7c7c607 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
> > > > @@ -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)}"
> > > > diff --git a/meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc b/meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc
> > > > index 5599743..392c57f 100644
> > > > --- a/meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc
> > > > +++ b/meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc
> > > > @@ -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
> > > >
> >

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

* Re: [PATCH v2 2/5] external-arm-toolchain: Refine dev libraries/headers packaging
  2020-06-12  7:07     ` Sumit Garg
@ 2020-06-12  7:35       ` Denys Dmytriyenko
  2020-06-12  8:49         ` Sumit Garg
  0 siblings, 1 reply; 18+ messages in thread
From: Denys Dmytriyenko @ 2020-06-12  7:35 UTC (permalink / raw)
  To: Sumit Garg; +Cc: meta-arm, Paul Barker, wmills, Richard Purdie, Daniel Thompson

On Fri, Jun 12, 2020 at 12:37:43PM +0530, Sumit Garg wrote:
> On Fri, 12 Jun 2020 at 09:53, Denys Dmytriyenko <denis@denix.org> wrote:
> >
> > On Wed, Jun 10, 2020 at 07:12:59PM +0530, Sumit Garg wrote:
> > > 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...
> >
> 
> 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:

http://arago-project.org/git/?p=meta-arago.git;a=commitdiff;h=fd2587171fec09ffb2974fc7b402ae6daf9ebaea

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.


> 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
> 
> >
> > > Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > > ---
> > >  .../external-arm-toolchain.bb                      | 48 ++++++++++++++++++++++
> > >  1 file changed, 48 insertions(+)
> > >
> > > 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 8cfc208..5d9a0a8 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
> > > @@ -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
> > >
> 

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

* Re: [PATCH v2 2/5] external-arm-toolchain: Refine dev libraries/headers packaging
  2020-06-12  7:35       ` Denys Dmytriyenko
@ 2020-06-12  8:49         ` Sumit Garg
  0 siblings, 0 replies; 18+ messages in thread
From: Sumit Garg @ 2020-06-12  8:49 UTC (permalink / raw)
  To: Denys Dmytriyenko
  Cc: meta-arm, Paul Barker, wmills, Richard Purdie, Daniel Thompson

On Fri, 12 Jun 2020 at 13:05, Denys Dmytriyenko <denis@denix.org> wrote:
>
> On Fri, Jun 12, 2020 at 12:37:43PM +0530, Sumit Garg wrote:
> > On Fri, 12 Jun 2020 at 09:53, Denys Dmytriyenko <denis@denix.org> wrote:
> > >
> > > On Wed, Jun 10, 2020 at 07:12:59PM +0530, Sumit Garg wrote:
> > > > 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...
> > >
> >
> > 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"
>

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:

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

> This have happened in the past few times, e.g this one is very clear to
> illustrate the point:
>
> http://arago-project.org/git/?p=meta-arago.git;a=commitdiff;h=fd2587171fec09ffb2974fc7b402ae6daf9ebaea
>
> 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

> 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.
>
>
> > 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
> >
> > >
> > > > Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > > > ---
> > > >  .../external-arm-toolchain.bb                      | 48 ++++++++++++++++++++++
> > > >  1 file changed, 48 insertions(+)
> > > >
> > > > 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 8cfc208..5d9a0a8 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
> > > > @@ -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
> > > >
> >

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

end of thread, other threads:[~2020-06-12  8:49 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-10 13:42 [PATCH v2 0/5] external-arm-toolchain: Add support for SDK generation Sumit Garg
2020-06-10 13:42 ` [PATCH v2 1/5] external-arm-toolchain: Remove glibc locale dependency Sumit Garg
2020-06-12  4:14   ` [meta-arm] " Denys Dmytriyenko
2020-06-10 13:42 ` [PATCH v2 2/5] external-arm-toolchain: Refine dev libraries/headers packaging Sumit Garg
2020-06-12  4:23   ` Denys Dmytriyenko
2020-06-12  7:07     ` Sumit Garg
2020-06-12  7:35       ` Denys Dmytriyenko
2020-06-12  8:49         ` Sumit Garg
2020-06-10 13:43 ` [PATCH v2 3/5] external-arm-toolchain: Align glibc packaging to OE TARGET_SYS Sumit Garg
2020-06-12  2:15   ` Denys Dmytriyenko
2020-06-12  5:33     ` Sumit Garg
2020-06-12  6:16       ` Denys Dmytriyenko
2020-06-12  7:12         ` Sumit Garg
2020-06-10 13:43 ` [PATCH v2 4/5] meta-arm-toolchain: Add README Sumit Garg
2020-06-10 13:43 ` [PATCH v2 5/5] external-arm-toolchain: Add package specific licenses Sumit Garg
2020-06-12  4:26   ` Denys Dmytriyenko
2020-06-11 15:12 ` [meta-arm] [PATCH v2 0/5] external-arm-toolchain: Add support for SDK generation Jon Mason
2020-06-12  2:18 ` Denys Dmytriyenko

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.