Skip to contentSkip to conversation

arch/Config.in: introduce BR2_ARCH_NEEDS_GCC_AT_LEAST_14

PATCH Applied Thomas Petazzoni via buildroot 2 participants 4 messages Dec 27, 2023 – Dec 28, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 arch/Config.in: introduce BR2_ARCH_NEEDS_GCC_AT_LEAST_14

Since commit
a0d2a5cfec0ade7cb577cbff25aac289e746e61b ("support/scripts/gen-bootlin-toolchains:
generate BR2_ARCH_NEEDS_GCC_AT_LEAST_X guard"), the gen-bootlin-toolchains script will generate references to BR2_ARCH_NEEDS_GCC_AT_LEAST_X including potentially against the "next" version of gcc.

Indeed, a toolchain using gcc 13.x should have a "depends on !BR2_ARCH_NEEDS_GCC_AT_LEAST_14" so that once some architectures that require gcc 14.x are added, such toolchains are not made visible.

In order for this to work, we must have the BR2_ARCH_NEEDS_GCC_AT_LEAST_x symbol ready for the N+1 version of gcc compared to the latest one we support.

As we're supporting up to gcc 13.x right now, let's introduce the symbol BR2_ARCH_NEEDS_GCC_AT_LEAST_14 so that gcc 13.x toolchains can be marked depends on !BR2_ARCH_NEEDS_GCC_AT_LEAST_14.

The other alternative would be to make the gen-bootlin-toolchains a bit smarter, and not emit this depends on !BR2_ARCH_NEEDS_GCC_AT_LEAST_14 if BR2_ARCH_NEEDS_GCC_AT_LEAST_14 does not exist. But this would require re-running the script when BR2_ARCH_NEEDS_GCC_AT_LEAST_14 which we are unlikely to do. While today, when the script is invoked, the usual check-symbols complains and reminds us that BR2_ARCH_NEEDS_GCC_AT_LEAST_14 should be added, so we remember to do it right away.

---
 arch/Config.in | 4 ++++
 1 file changed, 4 insertions(+)
arch/Config.in +4 -0
index e37f4dab1d..9912f9fce6 100644
@@ -313,6 +313,10 @@ config BR2_ARCH_NEEDS_GCC_AT_LEAST_13
 	bool
 	select BR2_ARCH_NEEDS_GCC_AT_LEAST_12
 
+config BR2_ARCH_NEEDS_GCC_AT_LEAST_14
+	bool
+	select BR2_ARCH_NEEDS_GCC_AT_LEAST_13
+
 # The following string values are defined by the individual
 # Config.in.$ARCH files
 config BR2_ARCH
Signature · 6 lines
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 2/2 toolchain/toolchain-external/toolchain-external-bootlin: update to 2023.11-1

New toolchains have been released, with the following changes:

- The bleeding-edge toolchains are based on gcc 13.2, binutils 2.41, gdb 14.1, kernel headers 5.10, glibc 2.38, musl 1.2.4 or uclibc-ng 1.0.45.

- The stable toolchains are based on gcc 12.3, binutils 2.40, gdb 13.2, kernel headers 4.14, glibc 2.38, musl 1.2.4 or uclibc-ng 1.0.45.

- The glibc version is no longer affected by CVE-2023-4911

- The gdb build has been fixed to no longer rely on uninstalled libbfd.so and libopcodes.so libraries

- The zlib library, which was incorrectly present in the toolchain sysroot, is gone, fixing various build failures encountered with 2023.08 toolchains.

- There are now toolchains for m68k 68xxx based on uclibc and musl in addition to glibc, which was already supported

The careful reviewer will notice that a number of

depends on !BR2_ARCH_NEEDS_GCC_AT_LEAST_14

are being added to the toolchains that use gcc 13.x, as per a0d2a5cfec0ade7cb577cbff25aac289e746e61b ("support/scripts/gen-bootlin-toolchains: generate BR2_ARCH_NEEDS_GCC_AT_LEAST_X guard").

All 214 test cases were successfully run:

https://gitlab.com/tpetazzoni/buildroot/-/pipelines/1120323562

---
 .../tests/toolchain/test_external_bootlin.py  |  60 ++
 .../Config.in.options                         | 618 ++++++++-----
 .../toolchain-external-bootlin.hash           | 836 +++++++++---------
 .../toolchain-external-bootlin.mk             | 438 ++++-----
 4 files changed, 1124 insertions(+), 828 deletions(-)
support/testing/tests/toolchain/test_external_bootlin.py +60 -0
index fb82a0a377..02090755fd 100644
@@ -675,6 +675,66 @@ class TestExternalToolchainBootlinArmv7mUclibcStable(TestExternalToolchain):
         TestExternalToolchain.common_check(self)
 
 
+class TestExternalToolchainBootlinM68k68xxxGlibcBleedingEdge(TestExternalToolchain):
+    config = """
+        BR2_m68k=y
+        BR2_m68k_68040=y
+        BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
+        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_M68K_68XXX_GLIBC_BLEEDING_EDGE=y
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """
+    toolchain_prefix = "m68k-linux"
+
+    def test_run(self):
+        TestExternalToolchain.common_check(self)
+
+
+class TestExternalToolchainBootlinM68k68xxxGlibcStable(TestExternalToolchain):
+    config = """
+        BR2_m68k=y
+        BR2_m68k_68040=y
+        BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
+        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_M68K_68XXX_GLIBC_STABLE=y
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """
+    toolchain_prefix = "m68k-linux"
+
+    def test_run(self):
+        TestExternalToolchain.common_check(self)
+
+
+class TestExternalToolchainBootlinM68k68xxxMuslBleedingEdge(TestExternalToolchain):
+    config = """
+        BR2_m68k=y
+        BR2_m68k_68040=y
+        BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
+        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_M68K_68XXX_MUSL_BLEEDING_EDGE=y
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """
+    toolchain_prefix = "m68k-linux"
+
+    def test_run(self):
+        TestExternalToolchain.common_check(self)
+
+
+class TestExternalToolchainBootlinM68k68xxxMuslStable(TestExternalToolchain):
+    config = """
+        BR2_m68k=y
+        BR2_m68k_68040=y
+        BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
+        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_M68K_68XXX_MUSL_STABLE=y
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """
+    toolchain_prefix = "m68k-linux"
+
+    def test_run(self):
+        TestExternalToolchain.common_check(self)
+
+
 class TestExternalToolchainBootlinM68k68xxxUclibcBleedingEdge(TestExternalToolchain):
     config = """
         BR2_m68k=y
toolchain/toolchain-external/toolchain-external-bootlin/Config.in.options +411 -207

2,183 lines not on this page · raw message

toolchain/toolchain-external/toolchain-external-bootlin/toolchain-external-bootlin.hash +422 -414

751 lines not on this page · raw message

toolchain/toolchain-external/toolchain-external-bootlin/toolchain-external-bootlin.mk +231 -207

438 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 6 lines
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

Part of the diff is not shown here. View the raw message.

#2 lore raw

Re: [Buildroot] [PATCH 2/2] toolchain/toolchain-external/toolchain-external-bootlin: update to 2023.11-1

Thomas, All,

On 2023-12-27 18:13 +0100, Thomas Petazzoni via buildroot spake thusly:

Quoted 31 lines

New toolchains have been released, with the following changes:

- The bleeding-edge toolchains are based on gcc 13.2, binutils 2.41, gdb 14.1, kernel headers 5.10, glibc 2.38, musl 1.2.4 or uclibc-ng 1.0.45.

- The stable toolchains are based on gcc 12.3, binutils 2.40, gdb 13.2, kernel headers 4.14, glibc 2.38, musl 1.2.4 or uclibc-ng 1.0.45.

- The glibc version is no longer affected by CVE-2023-4911

- The gdb build has been fixed to no longer rely on uninstalled libbfd.so and libopcodes.so libraries

- The zlib library, which was incorrectly present in the toolchain sysroot, is gone, fixing various build failures encountered with 2023.08 toolchains.

- There are now toolchains for m68k 68xxx based on uclibc and musl in addition to glibc, which was already supported

The careful reviewer will notice that a number of

depends on !BR2_ARCH_NEEDS_GCC_AT_LEAST_14

are being added to the toolchains that use gcc 13.x, as per a0d2a5cfec0ade7cb577cbff25aac289e746e61b ("support/scripts/gen-bootlin-toolchains: generate BR2_ARCH_NEEDS_GCC_AT_LEAST_X guard").

Quoted 5 lines

All 214 test cases were successfully run:

https://gitlab.com/tpetazzoni/buildroot/-/pipelines/1120323562

Applied to master, thanks.

Regards,
Yann E. MORIN.

[--SNIP big patch--]

Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw
In reply to Thomas Petazzoni via buildroot

Thomas, All,

On 2023-12-27 18:13 +0100, Thomas Petazzoni via buildroot spake thusly:

Quoted 19 lines

Since commit
a0d2a5cfec0ade7cb577cbff25aac289e746e61b ("support/scripts/gen-bootlin-toolchains:
generate BR2_ARCH_NEEDS_GCC_AT_LEAST_X guard"), the gen-bootlin-toolchains script will generate references to BR2_ARCH_NEEDS_GCC_AT_LEAST_X including potentially against the "next" version of gcc.

Indeed, a toolchain using gcc 13.x should have a "depends on !BR2_ARCH_NEEDS_GCC_AT_LEAST_14" so that once some architectures that require gcc 14.x are added, such toolchains are not made visible.

In order for this to work, we must have the BR2_ARCH_NEEDS_GCC_AT_LEAST_x symbol ready for the N+1 version of gcc compared to the latest one we support.

As we're supporting up to gcc 13.x right now, let's introduce the symbol BR2_ARCH_NEEDS_GCC_AT_LEAST_14 so that gcc 13.x toolchains can be marked depends on !BR2_ARCH_NEEDS_GCC_AT_LEAST_14.

Quoted 8 lines

The other alternative would be to make the gen-bootlin-toolchains a bit smarter, and not emit this depends on !BR2_ARCH_NEEDS_GCC_AT_LEAST_14 if BR2_ARCH_NEEDS_GCC_AT_LEAST_14 does not exist. But this would require re-running the script when BR2_ARCH_NEEDS_GCC_AT_LEAST_14 which we are unlikely to do. While today, when the script is invoked, the usual check-symbols complains and reminds us that BR2_ARCH_NEEDS_GCC_AT_LEAST_14 should be added, so we remember to do it right away.

I was originally of the opinion that we should make the script smarte and not emit missing sumbols, buth the rationale you put forward has convinced me.

Applied to master, thanks.

Regards,
Yann E. MORIN.

Quoted 27 lines
---
 arch/Config.in | 4 ++++
 1 file changed, 4 insertions(+)
arch/Config.in +4 -0
index e37f4dab1d..9912f9fce6 100644
@@ -313,6 +313,10 @@ config BR2_ARCH_NEEDS_GCC_AT_LEAST_13
 	bool
 	select BR2_ARCH_NEEDS_GCC_AT_LEAST_12
 
+config BR2_ARCH_NEEDS_GCC_AT_LEAST_14
+	bool
+	select BR2_ARCH_NEEDS_GCC_AT_LEAST_13
+
 # The following string values are defined by the individual
 # Config.in.$ARCH files
 config BR2_ARCH
Signature · 6 lines
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot