Skip to contentSkip to conversation

arm-toolchain: merge binary toolchain recipes

PATCH Superseded Jon Mason 4 participants 6 messages May 28, 2020 – Jun 5, 2020

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Jon Mason

author
#0 lore raw

PATCH 1/1 arm-toolchain: merge binary toolchain recipes

Merge the majority of the binary toolchain recipes for building on an x86 host into a common include file.

---
 .../gcc-aarch64-none-elf_9.2-2019.12.bb       | 25 ------------------
 .../gcc-arm-none-eabi_9-2019-q4-major.bb      | 25 ------------------
 .../external-arm-toolchain/gcc-x86host.inc    | 26 +++++++++++++++++++
 3 files changed, 26 insertions(+), 50 deletions(-)
 create mode 100644 meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-x86host.inc
meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-aarch64-none-elf_9.2-2019.12.bb +0 -25
index 2ec0f9c..1c61755 100644
@@ -11,28 +11,3 @@ PROVIDES = "virtual/aarch64-none-elf-gcc"
 SRC_URI = "https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-${PV}-x86_64-aarch64-none-elf.tar.xz"
 
 SRC_URI[sha256sum] = "36d2cbe7c2984f2c20f562ac2f3ba524c59151adfa8ee10f1326c88de337b6d1"
-
-S = "${WORKDIR}/gcc-arm-${PV}-x86_64-aarch64-none-elf"
-
-COMPATIBLE_HOST = "x86_64.*-linux"
-
-do_install() {
-    install -d ${D}${datadir}/aarch64-none-elf/
-    cp -r ${S}/. ${D}${datadir}/aarch64-none-elf/
-
-    install -d ${D}${bindir}
-    # Symlink all executables into bindir
-    for f in ${D}${datadir}/aarch64-none-elf/bin/aarch64-none-elf-*; do
-        lnr $f ${D}${bindir}/$(basename $f)
-    done
-}
-
-FILES_${PN} = "${datadir} ${bindir}"
-
-INSANE_SKIP_${PN} = "already-stripped libdir staticdev file-rdeps"
-
-INHIBIT_SYSROOT_STRIP = "1"
-INHIBIT_PACKAGE_STRIP = "1"
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-
-BBCLASSEXTEND = "native nativesdk"
meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-arm-none-eabi_9-2019-q4-major.bb +0 -25
index 84f6dba..e0c220b 100644
@@ -12,28 +12,3 @@ SRC_URI = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/${B
 
 SRC_URI[md5sum] = "fe0029de4f4ec43cf7008944e34ff8cc"
 SRC_URI[sha256sum] = "bcd840f839d5bf49279638e9f67890b2ef3a7c9c7a9b25271e83ec4ff41d177a"
-
-S = "${WORKDIR}/${BPN}-${PV}"
-
-COMPATIBLE_HOST = "x86_64.*-linux"
-
-do_install() {
-    install -d ${D}${datadir}/arm-none-eabi/
-    cp -r ${S}/. ${D}${datadir}/arm-none-eabi/
-
-    install -d ${D}${bindir}
-    # Symlink all executables into bindir
-    for f in ${D}${datadir}/arm-none-eabi/bin/arm-none-eabi-*; do
-        lnr $f ${D}${bindir}/$(basename $f)
-    done
-}
-
-FILES_${PN} = "${datadir} ${bindir}"
-
-INSANE_SKIP_${PN} = "already-stripped libdir staticdev file-rdeps"
-
-INHIBIT_SYSROOT_STRIP = "1"
-INHIBIT_PACKAGE_STRIP = "1"
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-
-BBCLASSEXTEND = "native nativesdk"
meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-x86host.inc new file +26 -0
new file mode 100644
index 0000000..7cfe5a3
@@ -0,0 +1,26 @@
+S = "${WORKDIR}/${BPN}-${PV}"
+
+COMPATIBLE_HOST = "x86_64.*-linux"
+
+FILES_${PN} = "${datadir} ${bindir}"
+
+NAME = "${BPN}".strip("gcc-")
+
+do_install() {
+    install -d ${D}${datadir}/${NAME}/
+    cp -r ${S}/. ${D}${datadir}/${NAME}/
+
+    install -d ${D}${bindir}
+    # Symlink all executables into bindir
+    for f in ${D}${datadir}/${NAME}/bin/${NAME}-*; do
+        lnr $f ${D}${bindir}/$(basename $f)
+    done
+}
+
+INSANE_SKIP_${PN} = "already-stripped libdir staticdev file-rdeps"
+
+INHIBIT_SYSROOT_STRIP = "1"
+INHIBIT_PACKAGE_STRIP = "1"
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Jon Mason

Merge the majority of the binary toolchain recipes for building on an x86 host into a common include file.

Quoted 123 lines
---
 .../gcc-aarch64-none-elf_9.2-2019.12.bb       | 25 ------------------
 .../gcc-arm-none-eabi_9-2019-q4-major.bb      | 25 ------------------
 .../external-arm-toolchain/gcc-x86host.inc    | 26 +++++++++++++++++++
 3 files changed, 26 insertions(+), 50 deletions(-)
 create mode 100644

meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-x86host.inc

diff --git b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-aarch64-none-elf_9.2-2019.12.bb index 2ec0f9c..1c61755 100644
---
a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-aarch64-none-elf_9.2-2019.12.bb
+++
b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-aarch64-none-elf_9.2-2019.12.bb

(quoted diff) +0 -0
@@ -11,28 +11,3 @@ PROVIDES = "virtual/aarch64-none-elf-gcc"
 SRC_URI =

"https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-${PV}-x86_64-aarch64-none-elf.tar.xz"

SRC_URI[sha256sum] =
"36d2cbe7c2984f2c20f562ac2f3ba524c59151adfa8ee10f1326c88de337b6d1"

meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-aarch64-none-elf_9.2-2019.12.bb +0 -25
-
-S = "${WORKDIR}/gcc-arm-${PV}-x86_64-aarch64-none-elf"
-
-COMPATIBLE_HOST = "x86_64.*-linux"
-
-do_install() {
-    install -d ${D}${datadir}/aarch64-none-elf/
-    cp -r ${S}/. ${D}${datadir}/aarch64-none-elf/
-
-    install -d ${D}${bindir}
-    # Symlink all executables into bindir
-    for f in ${D}${datadir}/aarch64-none-elf/bin/aarch64-none-elf-*; do
-        lnr $f ${D}${bindir}/$(basename $f)
-    done
-}
-
-FILES_${PN} = "${datadir} ${bindir}"
-
-INSANE_SKIP_${PN} = "already-stripped libdir staticdev file-rdeps"
-
-INHIBIT_SYSROOT_STRIP = "1"
-INHIBIT_PACKAGE_STRIP = "1"
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-
-BBCLASSEXTEND = "native nativesdk"

diff --git b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-arm-none-eabi_9-2019-q4-major.bb index 84f6dba..e0c220b 100644
---
a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-arm-none-eabi_9-2019-q4-major.bb
+++
b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-arm-none-eabi_9-2019-q4-major.bb

(quoted diff) +0 -0
@@ -12,28 +12,3 @@ SRC_URI =

"https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/${B

SRC_URI[md5sum] = "fe0029de4f4ec43cf7008944e34ff8cc" SRC_URI[sha256sum] =
"bcd840f839d5bf49279638e9f67890b2ef3a7c9c7a9b25271e83ec4ff41d177a"

meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-arm-none-eabi_9-2019-q4-major.bb +0 -25
-
-S = "${WORKDIR}/${BPN}-${PV}"
-
-COMPATIBLE_HOST = "x86_64.*-linux"
-
-do_install() {
-    install -d ${D}${datadir}/arm-none-eabi/
-    cp -r ${S}/. ${D}${datadir}/arm-none-eabi/
-
-    install -d ${D}${bindir}
-    # Symlink all executables into bindir
-    for f in ${D}${datadir}/arm-none-eabi/bin/arm-none-eabi-*; do
-        lnr $f ${D}${bindir}/$(basename $f)
-    done
-}
-
-FILES_${PN} = "${datadir} ${bindir}"
-
-INSANE_SKIP_${PN} = "already-stripped libdir staticdev file-rdeps"
-
-INHIBIT_SYSROOT_STRIP = "1"
-INHIBIT_PACKAGE_STRIP = "1"
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-
-BBCLASSEXTEND = "native nativesdk"

diff --git a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-x86host.inc b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-x86host.inc new file mode 100644
index 0000000..7cfe5a3
--- /dev/null
+++
b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-x86host.inc

meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-x86host.inc new file +26 -0
@@ -0,0 +1,26 @@
+S = "${WORKDIR}/${BPN}-${PV}"
+
+COMPATIBLE_HOST = "x86_64.*-linux"
+
+FILES_${PN} = "${datadir} ${bindir}"
+
+NAME = "${BPN}".strip("gcc-")
+
+do_install() {
+    install -d ${D}${datadir}/${NAME}/
+    cp -r ${S}/. ${D}${datadir}/${NAME}/
+
+    install -d ${D}${bindir}
+    # Symlink all executables into bindir
+    for f in ${D}${datadir}/${NAME}/bin/${NAME}-*; do
+        lnr $f ${D}${bindir}/$(basename $f)
+    done
+}
+
+INSANE_SKIP_${PN} = "already-stripped libdir staticdev file-rdeps"
+
+INHIBIT_SYSROOT_STRIP = "1"
+INHIBIT_PACKAGE_STRIP = "1"
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.20.1
#2 lore raw
In reply to Jon Mason
Quoted 89 lines · Jon Mason

Merge the majority of the binary toolchain recipes for building on an x86 host into a common include file.

---
 .../gcc-aarch64-none-elf_9.2-2019.12.bb       | 25 ------------------
 .../gcc-arm-none-eabi_9-2019-q4-major.bb      | 25 ------------------
 .../external-arm-toolchain/gcc-x86host.inc    | 26 +++++++++++++++++++
 3 files changed, 26 insertions(+), 50 deletions(-)
 create mode 100644

meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-x86host.inc

diff --git b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-aarch64-none-elf_9.2-2019.12.bb index 2ec0f9c..1c61755 100644
---
a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-aarch64-none-elf_9.2-2019.12.bb
+++
b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-aarch64-none-elf_9.2-2019.12.bb

(quoted diff) +0 -0
@@ -11,28 +11,3 @@ PROVIDES = "virtual/aarch64-none-elf-gcc"
 SRC_URI =

"https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-${PV}-x86_64-aarch64-none-elf.tar.xz"

SRC_URI[sha256sum] =
"36d2cbe7c2984f2c20f562ac2f3ba524c59151adfa8ee10f1326c88de337b6d1"

meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-aarch64-none-elf_9.2-2019.12.bb +0 -25
-
-S = "${WORKDIR}/gcc-arm-${PV}-x86_64-aarch64-none-elf"
-
-COMPATIBLE_HOST = "x86_64.*-linux"
-
-do_install() {
-    install -d ${D}${datadir}/aarch64-none-elf/
-    cp -r ${S}/. ${D}${datadir}/aarch64-none-elf/
-
-    install -d ${D}${bindir}
-    # Symlink all executables into bindir
-    for f in ${D}${datadir}/aarch64-none-elf/bin/aarch64-none-elf-*; do
-        lnr $f ${D}${bindir}/$(basename $f)
-    done
-}
-
-FILES_${PN} = "${datadir} ${bindir}"
-
-INSANE_SKIP_${PN} = "already-stripped libdir staticdev file-rdeps"
-
-INHIBIT_SYSROOT_STRIP = "1"
-INHIBIT_PACKAGE_STRIP = "1"
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-
-BBCLASSEXTEND = "native nativesdk"

diff --git b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-arm-none-eabi_9-2019-q4-major.bb index 84f6dba..e0c220b 100644
---
a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-arm-none-eabi_9-2019-q4-major.bb
+++
b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-arm-none-eabi_9-2019-q4-major.bb

(quoted diff) +0 -0
@@ -12,28 +12,3 @@ SRC_URI =

"https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/${B

SRC_URI[md5sum] = "fe0029de4f4ec43cf7008944e34ff8cc" SRC_URI[sha256sum] =
"bcd840f839d5bf49279638e9f67890b2ef3a7c9c7a9b25271e83ec4ff41d177a"

meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-arm-none-eabi_9-2019-q4-major.bb +0 -25
-
-S = "${WORKDIR}/${BPN}-${PV}"
-
-COMPATIBLE_HOST = "x86_64.*-linux"
-
-do_install() {
-    install -d ${D}${datadir}/arm-none-eabi/
-    cp -r ${S}/. ${D}${datadir}/arm-none-eabi/
-
-    install -d ${D}${bindir}
-    # Symlink all executables into bindir
-    for f in ${D}${datadir}/arm-none-eabi/bin/arm-none-eabi-*; do
-        lnr $f ${D}${bindir}/$(basename $f)
-    done
-}
-
-FILES_${PN} = "${datadir} ${bindir}"
-
-INSANE_SKIP_${PN} = "already-stripped libdir staticdev file-rdeps"
-
-INHIBIT_SYSROOT_STRIP = "1"
-INHIBIT_PACKAGE_STRIP = "1"
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-
-BBCLASSEXTEND = "native nativesdk"
Quoted 8 lines

diff --git a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-x86host.inc b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-x86host.inc new file mode 100644
index 0000000..7cfe5a3
--- /dev/null
+++
b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-x86host.inc

Aren't you missing require gcc-x86host.inc in the other gcc recipes?

Quoted 31 lines
meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-x86host.inc new file +26 -0
@@ -0,0 +1,26 @@
+S = "${WORKDIR}/${BPN}-${PV}"
+
+COMPATIBLE_HOST = "x86_64.*-linux"
+
+FILES_${PN} = "${datadir} ${bindir}"
+
+NAME = "${BPN}".strip("gcc-")
+
+do_install() {
+    install -d ${D}${datadir}/${NAME}/
+    cp -r ${S}/. ${D}${datadir}/${NAME}/
+
+    install -d ${D}${bindir}
+    # Symlink all executables into bindir
+    for f in ${D}${datadir}/${NAME}/bin/${NAME}-*; do
+        lnr $f ${D}${bindir}/$(basename $f)
+    done
+}
+
+INSANE_SKIP_${PN} = "already-stripped libdir staticdev file-rdeps"
+
+INHIBIT_SYSROOT_STRIP = "1"
+INHIBIT_PACKAGE_STRIP = "1"
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.20.1
#3 lore raw
In reply to Jon Mason
Quoted 15 lines · Jon Mason
meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-aarch64-none-elf_9.2-2019.12.bb +0 -15
-
-S = "${WORKDIR}/gcc-arm-${PV}-x86_64-aarch64-none-elf"
-
-COMPATIBLE_HOST = "x86_64.*-linux"
-
-do_install() {
-    install -d ${D}${datadir}/aarch64-none-elf/
-    cp -r ${S}/. ${D}${datadir}/aarch64-none-elf/
-
-    install -d ${D}${bindir}
-    # Symlink all executables into bindir
-    for f in ${D}${datadir}/aarch64-none-elf/bin/aarch64-none-elf-*; do
-        lnr $f ${D}${bindir}/$(basename $f)
-    done
-}

meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-aarch64-none-elf_9.2-2019.12.bb PROVIDES = "virtual/aarch64-none-elf-gcc" · line 38

Quoted 10 lines
meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-aarch64-none-elf_9.2-2019.12.bb +0 -10
-
-FILES_${PN} = "${datadir} ${bindir}"
-
-INSANE_SKIP_${PN} = "already-stripped libdir staticdev file-rdeps"
-
-INHIBIT_SYSROOT_STRIP = "1"
-INHIBIT_PACKAGE_STRIP = "1"
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-
-BBCLASSEXTEND = "native nativesdk"

Forgot to include the include file.

Quoted 1 line

+S = "${WORKDIR}/${BPN}-${PV}"

That's the default value.

Quoted 1 line

+NAME = "${BPN}".strip("gcc-")

That is a syntax error. Looking at the repetition below, maybe this would be better (untested):

BINPATH="${datadir}${@d.getVar("BPN").strip("gcc-")}"

Ross

author
#4 lore raw
Quoted 29 lines · Ross Burton
Quoted 15 lines · Jon Mason
meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-aarch64-none-elf_9.2-2019.12.bb +0 -15
-
-S = "${WORKDIR}/gcc-arm-${PV}-x86_64-aarch64-none-elf"
-
-COMPATIBLE_HOST = "x86_64.*-linux"
-
-do_install() {
-    install -d ${D}${datadir}/aarch64-none-elf/
-    cp -r ${S}/. ${D}${datadir}/aarch64-none-elf/
-
-    install -d ${D}${bindir}
-    # Symlink all executables into bindir
-    for f in ${D}${datadir}/aarch64-none-elf/bin/aarch64-none-elf-*; do
-        lnr $f ${D}${bindir}/$(basename $f)
-    done
-}

meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-aarch64-none-elf_9.2-2019.12.bb PROVIDES = "virtual/aarch64-none-elf-gcc" · line 38

Quoted 10 lines
meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-aarch64-none-elf_9.2-2019.12.bb +0 -10
-
-FILES_${PN} = "${datadir} ${bindir}"
-
-INSANE_SKIP_${PN} = "already-stripped libdir staticdev file-rdeps"
-
-INHIBIT_SYSROOT_STRIP = "1"
-INHIBIT_PACKAGE_STRIP = "1"
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-
-BBCLASSEXTEND = "native nativesdk"

Forgot to include the include file.

Quoted 8 lines
Quoted 1 line

+S = "${WORKDIR}/${BPN}-${PV}"

That's the default value.

Quoted 1 line

+NAME = "${BPN}".strip("gcc-")

That is a syntax error. Looking at the repetition below, maybe this would be better (untested):

Wait, you are not testing this? SHAME! Disregard my lack of testing, as rules do not apply to me.

Quoted 1 line

BINPATH="${datadir}${@d.getVar("BPN").strip("gcc-")}"

So, this doesn't work, as it outputs gcc-arm-none-eabi/usr/share/usr/share/arm-none-eabi/arm-none-eabi/ instead of
gcc-arm-none-eabi/usr/share/arm-none-eabi/

This is due to the multiple ways this is being used. I think the better solution is
BINNAME = "${@d.getVar("BPN").strip("gcc-")}"

I'll send out v2 shortly. Thanks for the eyes.

Thanks,
Jon

Quoted 2 lines

Ross

#5 lore raw
In reply to Ross Burton
Quoted 7 lines · Ross Burton

meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-aarch64-none-elf_9.2-2019.12.bb PROVIDES = "virtual/aarch64-none-elf-gcc"

Quoted 4 lines · Jon Mason
meta-arm-toolchain/recipes-devtools/external-arm-toolchain/gcc-aarch64-none-elf_9.2-2019.12.bb +1 -2
-
-S = "${WORKDIR}/gcc-arm-${PV}-x86_64-aarch64-none-elf"
 
+S = "${WORKDIR}/${BPN}-${PV}"

That's the default value.

Yeah, that's the default for one recipe, not the other...

Signature · 1 line
Denys