Skip to contentSkip to conversation

gcc-arm: add re-staging of unwind.h from external-arm-toolchain

PATCH In review Denys Dmytriyenko 2 participants 5 messages May 6, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 gcc-arm: add re-staging of unwind.h from external-arm-toolchain

From: Denys Dmytriyenko <[email protected]>

gcc-target.inc expects unwind.h to come from and be staged by libgcc. When TCMODE="external-arm" libgcc is provided by external-arm-toolchain.bb And while it stages the necessary unwind.h file, it ends up in slightly different location, so re-stage it. More details are in the comments.

---
 .../recipes-devtools/gcc/gcc-arm-common.inc             | 17 +++++++++++++++++
 meta-arm-toolchain/recipes-devtools/gcc/gcc_arm-8.2.bb  |  1 +
 meta-arm-toolchain/recipes-devtools/gcc/gcc_arm-8.3.bb  |  1 +
 meta-arm-toolchain/recipes-devtools/gcc/gcc_arm-9.2.bb  |  1 +
 4 files changed, 20 insertions(+)
 create mode 100644 meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc
meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc new file +17 -0
new file mode 100644
index 0000000..55f40e1
@@ -0,0 +1,17 @@
+# gcc-target.inc in OE-Core has these 2 lines in do_install():
+#
+# | # Add unwind.h, it comes from libgcc which we don't want to build again
+# | install ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/unwind.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+#
+# When TCMODE="external-arm" libgcc is provided by external-arm-toolchain.bb
+# And while it stages the necessary unwind.h file, it ends up in slightly
+# different location. While this is a kludge, be very conservative - only
+# copy the file for target build in recipe-specific sysroot, in external-arm
+# toolchain mode and if the required file does not exist already.
+
+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/
+	fi
+}
meta-arm-toolchain/recipes-devtools/gcc/gcc_arm-8.2.bb +1 -0
index c4a2de2..51a0877 100644
@@ -1,5 +1,6 @@
 require recipes-devtools/gcc/gcc-${PV}.inc
 require recipes-devtools/gcc/gcc-target.inc
+require recipes-devtools/gcc/gcc-arm-common.inc
 
 # Building with thumb enabled on armv4t armv5t fails with
 # | gcc-4.8.1-r0/gcc-4.8.1/gcc/cp/decl.c:7438:(.text.unlikely+0x2fa): relocation truncated to fit: R_ARM_THM_CALL against symbol `fancy_abort(char const*, int, char const*)' defined in .glue_7 section in linker stubs
meta-arm-toolchain/recipes-devtools/gcc/gcc_arm-8.3.bb +1 -0
index c4a2de2..51a0877 100644
@@ -1,5 +1,6 @@
 require recipes-devtools/gcc/gcc-${PV}.inc
 require recipes-devtools/gcc/gcc-target.inc
+require recipes-devtools/gcc/gcc-arm-common.inc
 
 # Building with thumb enabled on armv4t armv5t fails with
 # | gcc-4.8.1-r0/gcc-4.8.1/gcc/cp/decl.c:7438:(.text.unlikely+0x2fa): relocation truncated to fit: R_ARM_THM_CALL against symbol `fancy_abort(char const*, int, char const*)' defined in .glue_7 section in linker stubs
meta-arm-toolchain/recipes-devtools/gcc/gcc_arm-9.2.bb +1 -0
index c4a2de2..51a0877 100644
@@ -1,5 +1,6 @@
 require recipes-devtools/gcc/gcc-${PV}.inc
 require recipes-devtools/gcc/gcc-target.inc
+require recipes-devtools/gcc/gcc-arm-common.inc
 
 # Building with thumb enabled on armv4t armv5t fails with
 # | gcc-4.8.1-r0/gcc-4.8.1/gcc/cp/decl.c:7438:(.text.unlikely+0x2fa): relocation truncated to fit: R_ARM_THM_CALL against symbol `fancy_abort(char const*, int, char const*)' defined in .glue_7 section in linker stubs
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/4 gcc-arm: remove extra binary aliases when TCMODE=external-arm

From: Denys Dmytriyenko <[email protected]>

When TCMODE=external-arm, TARGET_SYS!=EAT_TARGET_SYS and gcc installs extra binary aliases, which could lead to QA errors:

ERROR: gcc-arm-9.2-r2019.12 do_package: QA Issue: gcc: Files/directories were installed but not shipped in any package:
/usr/bin/arm-poky-linux-gnueabi-arm-none-linux-gnueabihf-g++ /usr/bin/arm-poky-linux-gnueabi-arm-none-linux-gnueabihf-gcc /usr/bin/arm-poky-linux-gnueabi-arm-none-linux-gnueabihf-gcc-ar /usr/bin/arm-poky-linux-gnueabi-arm-none-linux-gnueabihf-gcc-ranlib /usr/bin/arm-poky-linux-gnueabi-arm-none-linux-gnueabihf-gcc-nm
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
gcc: 5 installed and not shipped files. [installed-vs-shipped]
ERROR: gcc-arm-9.2-r2019.12 do_package: Fatal QA errors found, failing task.

---
 meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc | 10 ++++++++++
 1 file changed, 10 insertions(+)
meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc +10 -0
index 55f40e1..5599743 100644
@@ -15,3 +15,13 @@ do_install_prepend_class-target () {
 		install ${STAGING_LIBDIR}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/include/unwind.h ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/
 	fi
 }
+
+# When TCMODE="external-arm" and TARGET_SYS is different from EAT_TARGET_SYS,
+# gcc installs additional aliases as ${TARGET_SYS}-${EAT_TARGET_SYS}-gcc, etc.
+# Since those are not packaged and not too useful, let's remove them to avoid
+# QA issues
+do_install_append () {
+	for f in g++ gcc gcc-ar gcc-ranlib gcc-nm; do
+		rm -f ${D}${bindir}/${TARGET_SYS}-${EAT_TARGET_SYS}-$f
+	done
+}
Signature · 1 line
2.7.4
#2 lore raw

PATCH 3/4 external-arm-toolchain: remove empty libexecdir

In reply to Denys Dmytriyenko

From: Denys Dmytriyenko <[email protected]>

Fixes following QA issue (normally a warning, but Poky and other distros may treat it as fatal):

ERROR: external-arm-toolchain-2019.12-r0 do_package: QA Issue: external-arm-toolchain: Files/directories were installed but not shipped in any package:
/usr/libexec
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
external-arm-toolchain: 1 installed and not shipped files. [installed-vs-shipped]
ERROR: external-arm-toolchain-2019.12-r0 do_package: Fatal QA errors found, failing task.

---
 .../recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb    | 1 +
 1 file changed, 1 insertion(+)
meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb +1 -0
index 88ebbb3..f98f6a3 100644
@@ -223,6 +223,7 @@ do_install() {
 	rmdir ${D}${bindir} || true
 	rmdir ${D}${sbindir} || true
 	rmdir ${D}${base_sbindir} || true
+	rmdir ${D}${libexecdir} || true
 }
 
 # External toolchain doesn't provide multilib support so make corresponding
Signature · 1 line
2.7.4
#3 lore raw

PATCH 4/4 external-arm-toolchain: remove unused /usr/share/info/dir

In reply to Denys Dmytriyenko

From: Denys Dmytriyenko <[email protected]>

Fixes following QA issue:

WARNING: external-arm-toolchain-2019.12-r0 do_package_qa: QA Issue: The /usr/share/info/dir file is not meant to be shipped in a particular package. [infodir]

---
 .../recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb  | 3 +++
 1 file changed, 3 insertions(+)
meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb +3 -0
index f98f6a3..04d8923 100644
@@ -224,6 +224,9 @@ do_install() {
 	rmdir ${D}${sbindir} || true
 	rmdir ${D}${base_sbindir} || true
 	rmdir ${D}${libexecdir} || true
+
+	# Remove unused /usr/share/info/dir
+	rm -f ${D}${infodir}/dir
 }
 
 # External toolchain doesn't provide multilib support so make corresponding
Signature · 1 line
2.7.4
#4 lore raw
In reply to Denys Dmytriyenko
Quoted 8 lines · Denys Dmytriyenko

From: Denys Dmytriyenko <[email protected]>

gcc-target.inc expects unwind.h to come from and be staged by libgcc. When TCMODE="external-arm" libgcc is provided by external-arm-toolchain.bb And while it stages the necessary unwind.h file, it ends up in slightly different location, so re-stage it. More details are in the comments.

Series applied to master branch.

Thanks,
Jon

Quoted 69 lines
---
 .../recipes-devtools/gcc/gcc-arm-common.inc             | 17 +++++++++++++++++
 meta-arm-toolchain/recipes-devtools/gcc/gcc_arm-8.2.bb  |  1 +
 meta-arm-toolchain/recipes-devtools/gcc/gcc_arm-8.3.bb  |  1 +
 meta-arm-toolchain/recipes-devtools/gcc/gcc_arm-9.2.bb  |  1 +
 4 files changed, 20 insertions(+)
 create mode 100644 meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc
meta-arm-toolchain/recipes-devtools/gcc/gcc-arm-common.inc new file +17 -0
new file mode 100644
index 0000000..55f40e1
@@ -0,0 +1,17 @@
+# gcc-target.inc in OE-Core has these 2 lines in do_install():
+#
+# | # Add unwind.h, it comes from libgcc which we don't want to build again
+# | install ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/unwind.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+#
+# When TCMODE="external-arm" libgcc is provided by external-arm-toolchain.bb
+# And while it stages the necessary unwind.h file, it ends up in slightly
+# different location. While this is a kludge, be very conservative - only
+# copy the file for target build in recipe-specific sysroot, in external-arm
+# toolchain mode and if the required file does not exist already.
+
+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/
+	fi
+}
meta-arm-toolchain/recipes-devtools/gcc/gcc_arm-8.2.bb +1 -0
index c4a2de2..51a0877 100644
@@ -1,5 +1,6 @@
 require recipes-devtools/gcc/gcc-${PV}.inc
 require recipes-devtools/gcc/gcc-target.inc
+require recipes-devtools/gcc/gcc-arm-common.inc
 
 # Building with thumb enabled on armv4t armv5t fails with
 # | gcc-4.8.1-r0/gcc-4.8.1/gcc/cp/decl.c:7438:(.text.unlikely+0x2fa): relocation truncated to fit: R_ARM_THM_CALL against symbol `fancy_abort(char const*, int, char const*)' defined in .glue_7 section in linker stubs
meta-arm-toolchain/recipes-devtools/gcc/gcc_arm-8.3.bb +1 -0
index c4a2de2..51a0877 100644
@@ -1,5 +1,6 @@
 require recipes-devtools/gcc/gcc-${PV}.inc
 require recipes-devtools/gcc/gcc-target.inc
+require recipes-devtools/gcc/gcc-arm-common.inc
 
 # Building with thumb enabled on armv4t armv5t fails with
 # | gcc-4.8.1-r0/gcc-4.8.1/gcc/cp/decl.c:7438:(.text.unlikely+0x2fa): relocation truncated to fit: R_ARM_THM_CALL against symbol `fancy_abort(char const*, int, char const*)' defined in .glue_7 section in linker stubs
meta-arm-toolchain/recipes-devtools/gcc/gcc_arm-9.2.bb +1 -0
index c4a2de2..51a0877 100644
@@ -1,5 +1,6 @@
 require recipes-devtools/gcc/gcc-${PV}.inc
 require recipes-devtools/gcc/gcc-target.inc
+require recipes-devtools/gcc/gcc-arm-common.inc
 
 # Building with thumb enabled on armv4t armv5t fails with
 # | gcc-4.8.1-r0/gcc-4.8.1/gcc/cp/decl.c:7438:(.text.unlikely+0x2fa): relocation truncated to fit: R_ARM_THM_CALL against symbol `fancy_abort(char const*, int, char const*)' defined in .glue_7 section in linker stubs
Signature · 1 line
2.7.4