Skip to contentSkip to conversation

support/testing: update the ARM toolchain used for the systemd init tests

PATCH New Romain Naour 2 participants 3 messages Apr 4, 2020 – Apr 5, 2020

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 support/testing: update the ARM toolchain used for the systemd init tests

As reported on the mailing list, there is a build issue with systemd 245 when using gcc < 5.0:

http://lists.busybox.net/pipermail/buildroot/2020-April/278931.html

Update to the Bootling toolchain 2017.05 that meet the minimum requered version of toolchain componant:
GCC 5.4.0
linux-headers 3.10.105

See:
https://toolchains.bootlin.com/downloads/releases/toolchains/armv5-eabi/readmes/armv5-eabi--glibc--stable-2017.05-toolchains-1-1.txt

Tested:
https://gitlab.com/kubu93/buildroot/pipelines/132890602

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/498144403
https://gitlab.com/buildroot.org/buildroot/-/jobs/498144405
https://gitlab.com/buildroot.org/buildroot/-/jobs/498144406
https://gitlab.com/buildroot.org/buildroot/-/jobs/498144408
https://gitlab.com/buildroot.org/buildroot/-/jobs/498144410
https://gitlab.com/buildroot.org/buildroot/-/jobs/498144412

---
 support/testing/tests/init/test_systemd.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)
support/testing/tests/init/test_systemd.py +13 -0
index 0ac18cb623..10634cbb1f 100644
@@ -2,11 +2,24 @@ import infra.basetest
 from tests.init.base import InitSystemBase as InitSystemBase
 
 
+# External Toolchain fragment imported from:
+# https://toolchains.bootlin.com/downloads/releases/toolchains/armv5-eabi/fragments/armv5-eabi--glibc--stable-2017.05-toolchains-1-1.frag
 class InitSystemSystemdBase(InitSystemBase):
     config = \
         """
         BR2_arm=y
+        BR2_arm926t=y
+        BR2_ARM_CPU_ARMV5=y
+        BR2_ARM_EABI=y
+        BR2_ARM_SOFT_FLOAT=y
         BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
+        BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
+        BR2_TOOLCHAIN_EXTERNAL_URL="http://toolchains.bootlin.com/downloads/releases/toolchains/armv5-eabi--glibc--stable-2017.05-toolchains-1-1.tar.bz2"
+        BR2_TOOLCHAIN_EXTERNAL_GCC_5=y
+        BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_10=y
+        BR2_TOOLCHAIN_EXTERNAL_HAS_SSP=y
+        BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
         BR2_INIT_SYSTEMD=y
         BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
         BR2_LINUX_KERNEL=y
Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 2/2 package/systemd: add gcc >= 5.x dependency

As reported on the mailing list, there is a build issue with systemd 245 when using gcc < 5.0:

http://lists.busybox.net/pipermail/buildroot/2020-April/278931.html

Build issue:
../src/shared/gpt.c:7:9: error: initializer element is not constant
{ GPT_ROOT_X86, "root-x86" },

When testing with a toolchain using gcc 5.4.0 and the build is ok.
http://toolchains.bootlin.com/downloads/releases/toolchains/armv5-eabi--glibc--stable-2017.05-toolchains-1-1.tar.bz2

While searching for "error: initializer element is not constant" message, we can notice a note about gcc 5 change about "Initializing statics with compound literals":

https://gcc.gnu.org/gcc-5/porting_to.html

Add a dependency on gcc 5 to avoid using to old compiler.

There is the same issue with host-systemd with host gcc 4.9 (tested with Debian Jessie). So, add a dependency on host gcc >= 5.x.

Fixes:
http://autobuild.buildroot.org/results/520/520dab2253f4cbe408a8177a6587dcb38c6ba215
http://autobuild.buildroot.org/results/e0e/e0e0512de822864d670b5d176798a24ab09eed2d
http://autobuild.buildroot.org/results/f56/f5660b2711627fcee4086e096e4ec4d9ba190ab6

Cc Adam Duskett <[email protected]>
Cc Maxime Hadjinlian <[email protected]>
Cc Yann E. MORIN <[email protected]>

---
V2 add missing revese dependency for init systemd on host gcc 5.

---
 package/systemd/Config.in      | 2 ++
 package/systemd/Config.in.host | 1 +
 system/Config.in               | 8 ++++++--
 3 files changed, 9 insertions(+), 2 deletions(-)
package/systemd/Config.in +2 -0
index bd638477a0..4afe694413 100644
@@ -19,6 +19,8 @@ menuconfig BR2_PACKAGE_SYSTEMD
 	depends on !BR2_STATIC_LIBS # kmod
 	depends on BR2_TOOLCHAIN_HAS_THREADS # dbus
 	depends on BR2_USE_MMU # dbus
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5
+	depends on BR2_HOST_GCC_AT_LEAST_5 # host-systemd
 	select BR2_PACKAGE_HAS_UDEV
 	select BR2_PACKAGE_DBUS # runtime dependency only
 	select BR2_PACKAGE_LIBCAP
package/systemd/Config.in.host +1 -0
index 219f24239e..8e00bcf5c1 100644
@@ -1,3 +1,4 @@
 # Select this if you need host systemd tools (e.g. systemctl)
 config BR2_PACKAGE_HOST_SYSTEMD
 	bool
+	depends on BR2_HOST_GCC_AT_LEAST_5
system/Config.in +6 -2
index c8c5be40e0..4de21d0713 100644
@@ -121,15 +121,19 @@ config BR2_INIT_SYSTEMD
 	depends on BR2_USE_MMU
 	depends on !BR2_STATIC_LIBS
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5
+	depends on BR2_HOST_GCC_AT_LEAST_5 # host-systemd
 	select BR2_ROOTFS_MERGED_USR
 	select BR2_PACKAGE_SYSTEMD
 
-comment "systemd needs a glibc toolchain w/ SSP, headers >= 3.10"
+comment "systemd needs a glibc toolchain w/ SSP, headers >= 3.10, host and target gcc >= 5"
 	depends on BR2_PACKAGE_SYSTEMD_ARCH_SUPPORTS
 	depends on BR2_USE_MMU
 	depends on !BR2_TOOLCHAIN_USES_GLIBC || \
 		!BR2_TOOLCHAIN_HAS_SSP || \
-		!BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
+		!BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10 || \
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_5 || \
+		!BR2_HOST_GCC_AT_LEAST_5
 
 config BR2_INIT_NONE
 	bool "None"
Signature · 1 line
2.25.1
#2 lore raw

PATCH v2 1/2 support/testing: update the ARM toolchain used for the systemd init tests

In reply to Romain Naour

Romain, All,

On 2020-04-05 00:08 +0200, Romain Naour spake thusly:

Quoted 9 lines

As reported on the mailing list, there is a build issue with systemd 245 when using gcc < 5.0:

http://lists.busybox.net/pipermail/buildroot/2020-April/278931.html

Update to the Bootling toolchain 2017.05 that meet the minimum requered version of toolchain componant:
GCC 5.4.0
linux-headers 3.10.105

As discussed n the review of your v1, I've changed that to use a Cortex-A9 with VFP, so an armv7, which allows using the ARM toolchain, which we have as a known pre-built toolchain, rather than switch to using a custom external toolchain from Bootlin.

(FTR, the discussion was in that thread:

    http://lists.busybox.net/pipermail/buildroot/2020-April/278977.html

)

Both patches applied to master, thanks.

Regards,
Yann E. MORIN.

Quoted 55 lines

See:
https://toolchains.bootlin.com/downloads/releases/toolchains/armv5-eabi/readmes/armv5-eabi--glibc--stable-2017.05-toolchains-1-1.txt

Tested:
https://gitlab.com/kubu93/buildroot/pipelines/132890602

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/498144403
https://gitlab.com/buildroot.org/buildroot/-/jobs/498144405
https://gitlab.com/buildroot.org/buildroot/-/jobs/498144406
https://gitlab.com/buildroot.org/buildroot/-/jobs/498144408
https://gitlab.com/buildroot.org/buildroot/-/jobs/498144410
https://gitlab.com/buildroot.org/buildroot/-/jobs/498144412

---
 support/testing/tests/init/test_systemd.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)
support/testing/tests/init/test_systemd.py +13 -0
index 0ac18cb623..10634cbb1f 100644
@@ -2,11 +2,24 @@ import infra.basetest
 from tests.init.base import InitSystemBase as InitSystemBase
 
 
+# External Toolchain fragment imported from:
+# https://toolchains.bootlin.com/downloads/releases/toolchains/armv5-eabi/fragments/armv5-eabi--glibc--stable-2017.05-toolchains-1-1.frag
 class InitSystemSystemdBase(InitSystemBase):
     config = \
         """
         BR2_arm=y
+        BR2_arm926t=y
+        BR2_ARM_CPU_ARMV5=y
+        BR2_ARM_EABI=y
+        BR2_ARM_SOFT_FLOAT=y
         BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
+        BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
+        BR2_TOOLCHAIN_EXTERNAL_URL="http://toolchains.bootlin.com/downloads/releases/toolchains/armv5-eabi--glibc--stable-2017.05-toolchains-1-1.tar.bz2"
+        BR2_TOOLCHAIN_EXTERNAL_GCC_5=y
+        BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_10=y
+        BR2_TOOLCHAIN_EXTERNAL_HAS_SSP=y
+        BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
         BR2_INIT_SYSTEMD=y
         BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
         BR2_LINUX_KERNEL=y
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 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.  |
'------------------------------^-------^------------------^--------------------'