Skip to contentSkip to conversation

Fix a number of toolchain dependency issues

PATCH In review Thomas Petazzoni via buildroot 4 participants 16 messages Jun 5, 2022 – Jun 7, 2022

lore
Share & tools
lore
#0 lore raw

cover Fix a number of toolchain dependency issues

Hello,

The starting point for this series is the investigation of several build failures affecting the master branch.

Most of those failures are due to the fact that we can currently create configurations for which no C library is available. This happens on architectures where glibc is the only supported C library, but BR2_STATIC_LIBS is enabled.

This is taken care of by the first four patches, which are basically split from a single patch posted by James Hilliard.

Then, another problem is that a recent commit allowed glibc only for powerpc8 on the ppc64le architecture, leaving a number of other PowerPC variants selectable with ppc64le, but for which no C library was available.

Finally, the toolchain-external-booltin package had a similar problem to the glibc/BR2_STATIC_LIBS issue: the package would be visible even if BR2_STATIC_LIBS=y and the selected CPU architecture is only supported by glibc.

Thomas

James Hilliard (4):
package/uclibc: introduce and use BR2_PACKAGE_UCLIBC_ARCH_SUPPORTS and
BR2_PACKAGE_UCLIBC_SUPPORTS
package/glibc: introduce and use BR2_PACKAGE_GLIBC_ARCH_SUPPORTS and
BR2_PACKAGE_GLIBC_SUPPORTS
package/musl: introduce and use BR2_PACKAGE_MUSL_ARCH_SUPPORTS and
BR2_PACKAGE_MUSL_SUPPORTS
Config.in: only allow BR2_STATIC_LIBS on supported libc/arch

Thomas Petazzoni (3):
arch/Config.in.powerpc: disable some variants on ppc64le support/scripts/gen-bootlin-toolchains: properly take into account
!BR2_STATIC_LIBS for glibc toolchains
toolchain/toolchain-external/toolchain-external-bootlin: regenerate
with correct !BR2_STATIC_LIBS handling

 Config.in                                     |  2 +
 arch/Config.in.powerpc                        | 10 +++++
 package/glibc/Config.in                       | 38 ++++++++++++++++
 package/musl/Config.in                        | 28 ++++++++++++
 package/uclibc/Config.in                      | 28 ++++++++++++
 support/scripts/gen-bootlin-toolchains        |  5 ++-
 toolchain/toolchain-buildroot/Config.in       | 43 ++++---------------
 .../Config.in.options                         | 10 ++---
 8 files changed, 124 insertions(+), 40 deletions(-)
Signature · 6 lines
2.35.3

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

PATCH 1/7 package/uclibc: introduce and use BR2_PACKAGE_UCLIBC_ARCH_SUPPORTS and BR2_PACKAGE_UCLIBC_SUPPORTS

From: James Hilliard <[email protected]>

In this commit BR2_PACKAGE_UCLIBC_SUPPORTS looks redundant with BR2_PACKAGE_UCLIBC_ARCH_SUPPORTS, but for other C libraries, they will be different. To be consistent, we use the same pattern for uClibc as well.

---
 package/uclibc/Config.in                | 28 +++++++++++++++++++++++++
 toolchain/toolchain-buildroot/Config.in |  8 +------
 2 files changed, 29 insertions(+), 7 deletions(-)
package/uclibc/Config.in +28 -0
index 310414bebc..754c3ea014 100644
@@ -1,3 +1,31 @@
+config BR2_PACKAGE_UCLIBC_ARCH_SUPPORTS
+	bool
+	default y if BR2_aarch64
+	default y if BR2_aarch64_be
+	default y if BR2_arcle
+	default y if BR2_arceb
+	default y if BR2_arm
+	default y if BR2_armeb
+	default y if BR2_i386
+	default y if BR2_m68k
+	default y if BR2_microblaze
+	default y if BR2_mips
+	default y if BR2_mipsel
+	default y if BR2_mips64
+	default y if BR2_mips64el
+	default y if BR2_or1k
+	default y if BR2_powerpc
+	default y if BR2_RISCV_64
+	default y if BR2_sh4
+	default y if BR2_sh4eb
+	default y if BR2_sparc
+	default y if BR2_xtensa
+	default y if BR2_x86_64
+
+config BR2_PACKAGE_UCLIBC_SUPPORTS
+	bool
+	default y if BR2_PACKAGE_UCLIBC_ARCH_SUPPORTS
+
 if BR2_TOOLCHAIN_BUILDROOT_UCLIBC
 
 comment "uClibc Options"
toolchain/toolchain-buildroot/Config.in +1 -7
index 559c254622..31f2be8b25 100644
@@ -27,13 +27,7 @@ choice
 
 config BR2_TOOLCHAIN_BUILDROOT_UCLIBC
 	bool "uClibc-ng"
-	depends on BR2_aarch64 || BR2_aarch64_be || BR2_arcle   || BR2_arceb  || \
-		   BR2_arm     || BR2_armeb    || \
-		   BR2_i386    || BR2_m68k   || BR2_microblaze || \
-		   BR2_mips    || BR2_mipsel || BR2_mips64 || BR2_mips64el || \
-		   BR2_or1k    || BR2_powerpc || BR2_RISCV_64 || \
-		   BR2_sh4     || BR2_sh4eb   || BR2_sparc || BR2_xtensa || \
-		   BR2_x86_64
+	depends on BR2_PACKAGE_UCLIBC_SUPPORTS
 	select BR2_TOOLCHAIN_USES_UCLIBC
 	help
 	  This option selects uClibc-ng as the C library for the
Signature · 6 lines
2.35.3

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

PATCH 2/7 package/glibc: introduce and use BR2_PACKAGE_GLIBC_ARCH_SUPPORTS and BR2_PACKAGE_GLIBC_SUPPORTS

In reply to Thomas Petazzoni via buildroot

From: James Hilliard <[email protected]>

As part of this, the dependency of the comment "glibc needs a toolchain w/ dynamic library, kernel headers >= 3.2" is changed to use BR2_PACKAGE_GLIBC_ARCH_SUPPORTS instead of just BR2_USE_MMU, so that the comment only appears on architectures for which glibc is supported

---
 package/glibc/Config.in                 | 38 +++++++++++++++++++++++++
 toolchain/toolchain-buildroot/Config.in | 20 ++-----------
 2 files changed, 40 insertions(+), 18 deletions(-)
package/glibc/Config.in +38 -0
index 8e9ddac7d9..56f7299568 100644
@@ -1,3 +1,41 @@
+config BR2_PACKAGE_GLIBC_ARCH_SUPPORTS
+	bool
+	default y if BR2_arm
+	default y if BR2_armeb
+	default y if BR2_aarch64
+	default y if BR2_aarch64_be
+	default y if BR2_i386
+	default y if BR2_mips
+	default y if BR2_mipsel
+	default y if BR2_mips64
+	default y if BR2_mips64el
+	default y if BR2_or1k
+	default y if BR2_powerpc
+	default y if BR2_powerpc64
+	default y if BR2_powerpc_power8
+	default y if BR2_riscv
+	default y if BR2_s390x
+	default y if BR2_sh
+	default y if BR2_sparc64
+	default y if BR2_x86_64
+	default y if BR2_microblaze
+	default y if BR2_nios2
+	default y if BR2_arc && BR2_ARC_ATOMIC_EXT
+	default y if BR2_csky
+	depends on !BR2_powerpc_SPE
+	depends on BR2_RISCV_ISA_RVA || !BR2_riscv
+	depends on BR2_USE_MMU
+
+config BR2_PACKAGE_GLIBC_SUPPORTS
+	bool
+	default y if BR2_PACKAGE_GLIBC_ARCH_SUPPORTS
+	depends on !BR2_STATIC_LIBS
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10 || !BR2_powerpc64le
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_5 || !BR2_MIPS_NAN_2008
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_0 || !BR2_RISCV_64
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_1 || !BR2_arc
+
 if BR2_TOOLCHAIN_BUILDROOT_GLIBC
 
 comment "Glibc Options"
toolchain/toolchain-buildroot/Config.in +2 -18
index 31f2be8b25..7ce2998cf7 100644
@@ -37,23 +37,7 @@ config BR2_TOOLCHAIN_BUILDROOT_UCLIBC
 
 config BR2_TOOLCHAIN_BUILDROOT_GLIBC
 	bool "glibc"
-	depends on BR2_arm         || BR2_armeb      || BR2_aarch64 || \
-		   BR2_aarch64_be  || BR2_i386       || BR2_mips    || \
-		   BR2_mipsel      || BR2_mips64     || BR2_mips64el|| \
-		   BR2_powerpc     || BR2_powerpc64  || BR2_powerpc_power8 || \
-		   BR2_riscv       || BR2_s390x      || BR2_sh          || \
-		   BR2_sparc64     || BR2_x86_64     || BR2_microblaze  || \
-		   BR2_nios2       || (BR2_arc && BR2_ARC_ATOMIC_EXT)   || \
-		   BR2_csky 	   || BR2_or1k
-	depends on BR2_USE_MMU
-	depends on !BR2_STATIC_LIBS
-	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
-	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10 || !BR2_powerpc64le
-	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_5 || !BR2_MIPS_NAN_2008
-	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_0 || !BR2_RISCV_64
-	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_1 || !BR2_arc
-	depends on !BR2_powerpc_SPE
-	depends on BR2_RISCV_ISA_RVA || !BR2_riscv
+	depends on BR2_PACKAGE_GLIBC_SUPPORTS
 	select BR2_TOOLCHAIN_USES_GLIBC
 	help
 	  This option selects glibc as the C library for the
@@ -62,7 +46,7 @@ config BR2_TOOLCHAIN_BUILDROOT_GLIBC
 	  http://www.gnu.org/software/libc/
 
 comment "glibc needs a toolchain w/ dynamic library, kernel headers >= 3.2"
-	depends on BR2_USE_MMU
+	depends on BR2_PACKAGE_GLIBC_ARCH_SUPPORTS
 	depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
 
 # glibc >= 2.26 require kernel headers >= 3.10 on powerpc64le.
Signature · 6 lines
2.35.3

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

PATCH 3/7 package/musl: introduce and use BR2_PACKAGE_MUSL_ARCH_SUPPORTS and BR2_PACKAGE_MUSL_SUPPORTS

In reply to Thomas Petazzoni via buildroot

From: James Hilliard <[email protected]>

---
 package/musl/Config.in                  | 28 +++++++++++++++++++++++++
 toolchain/toolchain-buildroot/Config.in | 10 +--------
 2 files changed, 29 insertions(+), 9 deletions(-)
package/musl/Config.in +28 -0
index 69da615b63..c1a10bdd58 100644
@@ -1,3 +1,31 @@
+config BR2_PACKAGE_MUSL_ARCH_SUPPORTS
+	bool
+	default y if BR2_aarch64
+	default y if BR2_arm
+	default y if BR2_armeb
+	default y if BR2_i386
+	default y if BR2_microblaze
+	default y if BR2_mips
+	default y if BR2_mipsel
+	default y if BR2_mips64
+	default y if BR2_mips64el
+	default y if BR2_or1k
+	default y if BR2_powerpc
+	default y if BR2_powerpc64
+	default y if BR2_powerpc64le
+	default y if BR2_RISCV_64
+	default y if BR2_sh
+	default y if BR2_x86_64
+	depends on !BR2_powerpc_SPE # not supported, build breaks
+	depends on !(BR2_powerpc64 || BR2_powerpc64le) || BR2_POWERPC_CPU_HAS_ALTIVEC
+	# sh2 nommu is supported by musl, but we don't have support
+	# for it in Buildroot.
+	depends on BR2_USE_MMU
+
+config BR2_PACKAGE_MUSL_SUPPORTS
+	bool
+	default y if BR2_PACKAGE_MUSL_ARCH_SUPPORTS
+
 config BR2_PACKAGE_MUSL
 	bool
 	default y
toolchain/toolchain-buildroot/Config.in +1 -9
index 7ce2998cf7..0dac816a4d 100644
@@ -61,15 +61,7 @@ comment "glibc on MIPS w/ NAN2008 needs a toolchain w/ headers >= 4.5"
 
 config BR2_TOOLCHAIN_BUILDROOT_MUSL
 	bool "musl"
-	depends on BR2_aarch64	   || BR2_arm   || BR2_armeb   || BR2_i386 || \
-		   BR2_microblaze  || BR2_mips  || BR2_mipsel  || BR2_mips64 || \
-		   BR2_mips64el    || BR2_or1k  || BR2_powerpc || BR2_powerpc64 || \
-		   BR2_powerpc64le || BR2_RISCV_64 || BR2_sh   || BR2_x86_64
-	depends on !BR2_powerpc_SPE # not supported, build breaks
-	depends on !(BR2_powerpc64 || BR2_powerpc64le) || BR2_POWERPC_CPU_HAS_ALTIVEC
-	# sh2 nommu is supported by musl, but we don't have support
-	# for it in Buildroot.
-	depends on BR2_USE_MMU
+	depends on BR2_PACKAGE_MUSL_SUPPORTS
 	select BR2_TOOLCHAIN_USES_MUSL
 	help
 	  This option selects musl as the C library for the
Signature · 6 lines
2.35.3

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

PATCH 4/7 Config.in: only allow BR2_STATIC_LIBS on supported libc/arch

In reply to Thomas Petazzoni via buildroot

From: James Hilliard <[email protected]>

It is currently possible to select BR2_STATIC_LIBS while BR2_TOOLCHAIN_BUILDROOT is selected even when there are no buildroot toolchains that support BR2_STATIC_LIBS for the selected architecture.

Add BR2_TOOLCHAIN_BUILDROOT_STATIC_LIBS_SUPPORTS so that we can disable the selection of BR2_STATIC_LIBS when using an unsupported architecture.

Fixes:
- http://autobuild.buildroot.net/results/4da59af8193376ec893321c4c2aaf1d25598502d
- http://autobuild.buildroot.net/results/1950348218a4f097f078d158977c13f8b0a97d6e
- http://autobuild.buildroot.net/results/2f03f2be32ad9898a990f6f0264d8c8d51991eb1

---
 Config.in                               | 2 ++
 toolchain/toolchain-buildroot/Config.in | 5 +++++
 2 files changed, 7 insertions(+)
Config.in +2 -0
index f0cd6f48ed..52c3c4b4c8 100644
@@ -601,6 +601,8 @@ choice
 
 config BR2_STATIC_LIBS
 	bool "static only"
+	depends on !BR2_TOOLCHAIN_BUILDROOT || \
+		BR2_TOOLCHAIN_BUILDROOT_STATIC_LIBS_SUPPORTS
 	help
 	  Build and use only static libraries. No shared libraries will
 	  be installed on the target. This potentially increases your
toolchain/toolchain-buildroot/Config.in +5 -0
index 0dac816a4d..11566c27ff 100644
@@ -20,6 +20,11 @@ config BR2_TOOLCHAIN_BUILDROOT_VENDOR
 
 	  If you're not sure, just leave the default "buildroot" value.
 
+config BR2_TOOLCHAIN_BUILDROOT_STATIC_LIBS_SUPPORTS
+	bool
+	default y if BR2_PACKAGE_UCLIBC_SUPPORTS
+	default y if BR2_PACKAGE_MUSL_SUPPORTS
+
 choice
 	prompt "C library"
 	default BR2_TOOLCHAIN_BUILDROOT_UCLIBC
Signature · 6 lines
2.35.3

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

PATCH 5/7 arch/Config.in.powerpc: disable some variants on ppc64le

In reply to Thomas Petazzoni via buildroot

Following commit
e59b3acc3603e55fbaec25406258ec9ca9623564 ("toolchain/glibc: Restrict ppc64le support to power8"), when selecting ppc64le as the architecture, it is possible to end up with a selection for which no C library is provided.

Indeed:

- glibc only supports Power8
- uclibc has no support for ppc64le at all
- musl only supports ppc64le processors that have Altivec support

Therefore, this commit adds "depends on !BR2_powerpc64le" to those PowerPC architecture variants for which no C library support exists.

Fixes:

http://autobuild.buildroot.net/results/3f6fb1c2d5648e78f7856bdea3171b5a89dfa2f9/

---
 arch/Config.in.powerpc | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/Config.in.powerpc +10 -0
index 272f66f4e7..c48edd3bb4 100644
@@ -14,6 +14,8 @@ choice
 	  Specific CPU variant to use
 config BR2_generic_powerpc
 	bool "generic"
+	# No C library supports this variant on ppc64le
+	depends on !BR2_powerpc64le
 config BR2_powerpc_401
 	bool "401"
 	depends on !BR2_ARCH_IS_64
@@ -64,8 +66,12 @@ config BR2_powerpc_604e
 	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_620
 	bool "620"
+	# No C library supports this variant on ppc64le
+	depends on !BR2_powerpc64le
 config BR2_powerpc_630
 	bool "630"
+	# No C library supports this variant on ppc64le
+	depends on !BR2_powerpc64le
 config BR2_powerpc_740
 	bool "740"
 	depends on !BR2_ARCH_IS_64
@@ -118,8 +124,12 @@ config BR2_powerpc_e6500
 	select BR2_POWERPC_CPU_HAS_ALTIVEC
 config BR2_powerpc_power4
 	bool "power4"
+	# No C library supports this variant on ppc64le
+	depends on !BR2_powerpc64le
 config BR2_powerpc_power5
 	bool "power5"
+	# No C library supports this variant on ppc64le
+	depends on !BR2_powerpc64le
 config BR2_powerpc_power6
 	bool "power6"
 	select BR2_POWERPC_CPU_HAS_ALTIVEC
Signature · 6 lines
2.35.3

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

Re: [Buildroot] [PATCH 5/7] arch/Config.in.powerpc: disable some variants on ppc64le

Hello Thomas,

Le 05/06/2022 à 21:42, Thomas Petazzoni via buildroot a écrit :

Quoted 12 lines

Following commit
e59b3acc3603e55fbaec25406258ec9ca9623564 ("toolchain/glibc: Restrict ppc64le support to power8"), when selecting ppc64le as the architecture, it is possible to end up with a selection for which no C library is provided.

Indeed:

- glibc only supports Power8
- uclibc has no support for ppc64le at all
- musl only supports ppc64le processors that have Altivec support

Quoted 6 lines

Therefore, this commit adds "depends on !BR2_powerpc64le" to those PowerPC architecture variants for which no C library support exists.

Fixes:

http://autobuild.buildroot.net/results/3f6fb1c2d5648e78f7856bdea3171b5a89dfa2f9/

Not related to this patch but it seems that uClibc-ng only support powerpc (BR2_powerpc) without ALTIVEC support (!BR2_POWERPC_CPU_HAS_ALTIVEC).

As soon as BR2_POWERPC_CPU_HAS_ALTIVEC is set, the uclibc-ng build due a conflicting types for 'elf_vrreg_t':

http://autobuild.buildroot.net/results/084/084bd1df5cf10c81646d6edf01f5347a35fc9e6b/build-end.log

This was not noticed by Toolchain-builder project since it only build powerpc configuration without altivec support (e300c3, 440fp, e500mc).

https://toolchains.bootlin.com/downloads/releases/toolchains/powerpc-e300c3/fragments/powerpc-e300c3--uclibc--bleeding-edge-2020.08-1.frag

Surprisingly, it also fail with power4 and power5 where BR2_POWERPC_CPU_HAS_ALTIVEC is not set but with the same error.

It seems broken since always, we should restrict uClibc-ng to all know working configuration.

Best regards,
Romain

Quoted 35 lines
---
 arch/Config.in.powerpc | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/Config.in.powerpc +6 -0
index 272f66f4e7..c48edd3bb4 100644
@@ -14,6 +14,8 @@ choice
 	  Specific CPU variant to use
 config BR2_generic_powerpc
 	bool "generic"
+	# No C library supports this variant on ppc64le
+	depends on !BR2_powerpc64le
 config BR2_powerpc_401
 	bool "401"
 	depends on !BR2_ARCH_IS_64
@@ -64,8 +66,12 @@ config BR2_powerpc_604e
 	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_620
 	bool "620"
+	# No C library supports this variant on ppc64le
+	depends on !BR2_powerpc64le
 config BR2_powerpc_630
 	bool "630"
+	# No C library supports this variant on ppc64le
+	depends on !BR2_powerpc64le
 config BR2_powerpc_740
 	bool "740"
 	depends on !BR2_ARCH_IS_64
@@ -118,8 +124,12 @@ config BR2_powerpc_e6500
 	select BR2_POWERPC_CPU_HAS_ALTIVEC
 config BR2_powerpc_power4

arch/Config.in.powerpc config BR2_powerpc_e6500 · line 135

Quoted 10 lines
arch/Config.in.powerpc +4 -0
 	bool "power4"
+	# No C library supports this variant on ppc64le
+	depends on !BR2_powerpc64le
 config BR2_powerpc_power5
 	bool "power5"
+	# No C library supports this variant on ppc64le
+	depends on !BR2_powerpc64le
 config BR2_powerpc_power6
 	bool "power6"
 	select BR2_POWERPC_CPU_HAS_ALTIVEC

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

#7 lore raw

Re: [Buildroot] [PATCH 5/7] arch/Config.in.powerpc: disable some variants on ppc64le

Quoted 31 lines · Romain Naour

Hello Thomas,

Quoted 12 lines · Thomas Petazzoni via buildroot

Following commit
e59b3acc3603e55fbaec25406258ec9ca9623564 ("toolchain/glibc: Restrict ppc64le support to power8"), when selecting ppc64le as the architecture, it is possible to end up with a selection for which no C library is provided.

Indeed:

- glibc only supports Power8
- uclibc has no support for ppc64le at all
- musl only supports ppc64le processors that have Altivec support

Quoted 6 lines

Therefore, this commit adds "depends on !BR2_powerpc64le" to those PowerPC architecture variants for which no C library support exists.

Fixes:

http://autobuild.buildroot.net/results/3f6fb1c2d5648e78f7856bdea3171b5a89dfa2f9/

Not related to this patch but it seems that uClibc-ng only support powerpc (BR2_powerpc) without ALTIVEC support (!BR2_POWERPC_CPU_HAS_ALTIVEC).

As soon as BR2_POWERPC_CPU_HAS_ALTIVEC is set, the uclibc-ng build due a conflicting types for 'elf_vrreg_t':

http://autobuild.buildroot.net/results/084/084bd1df5cf10c81646d6edf01f5347a35fc9e6b/build-end.log

Quoted 7 lines

This was not noticed by Toolchain-builder project since it only build powerpc configuration without altivec support (e300c3, 440fp, e500mc).

https://toolchains.bootlin.com/downloads/releases/toolchains/powerpc-e300c3/fragments/powerpc-e300c3--uclibc--bleeding-edge-2020.08-1.frag

Surprisingly, it also fail with power4 and power5 where BR2_POWERPC_CPU_HAS_ALTIVEC is not set but with the same error.

These are 64 bit machines, and uclibc doesn't support ppc64 big or little endian.

Quoted 3 lines

It seems broken since always, we should restrict uClibc-ng to all know working configuration.

We should disable 32 bit userspace for the 64bit CPUs. While they can run a 32 bit userspace with an appropriate kernel, it doesn't make sense to expose that option.

The options are:
- 32 bit big endian
- 32 bit little endian
- 64 bit big endian (power4 onwards, and other non-IBM CPUs)
- 64 bit little endian (power8 onwards, and other non-IBM CPUs)

Power8 and onwards can run big endian, but it's not common. RHEL, SuSe, Ubuntu build little endian only.

I have had a few goes at writing some kconfig to express this, but I didn't get something that was worth posting. Thomas' patch has gone in the tree, and this improves the situation a little, but there's still the case of being able to select 32 bit for the 64 bit CPUs.

We could add "depends on BR2_ARCH_IS_64" to the 64 bit CPUs?

Quoted 47 lines

Best regards,
Romain

Quoted 42 lines
---
 arch/Config.in.powerpc | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/Config.in.powerpc +10 -0
index 272f66f4e7..c48edd3bb4 100644
@@ -14,6 +14,8 @@ choice
        Specific CPU variant to use
 config BR2_generic_powerpc
      bool "generic"
+     # No C library supports this variant on ppc64le
+     depends on !BR2_powerpc64le
 config BR2_powerpc_401
      bool "401"
      depends on !BR2_ARCH_IS_64
@@ -64,8 +66,12 @@ config BR2_powerpc_604e
      depends on !BR2_ARCH_IS_64
 config BR2_powerpc_620
      bool "620"
+     # No C library supports this variant on ppc64le
+     depends on !BR2_powerpc64le
 config BR2_powerpc_630
      bool "630"
+     # No C library supports this variant on ppc64le
+     depends on !BR2_powerpc64le
 config BR2_powerpc_740
      bool "740"
      depends on !BR2_ARCH_IS_64
@@ -118,8 +124,12 @@ config BR2_powerpc_e6500
      select BR2_POWERPC_CPU_HAS_ALTIVEC
 config BR2_powerpc_power4
      bool "power4"
+     # No C library supports this variant on ppc64le
+     depends on !BR2_powerpc64le
 config BR2_powerpc_power5
      bool "power5"
+     # No C library supports this variant on ppc64le
+     depends on !BR2_powerpc64le
Quoted 8 lines

arch/Config.in.powerpc config BR2_powerpc_e6500 · line 135

Quoted 3 lines
arch/Config.in.powerpc +0 -0
 config BR2_powerpc_power6
      bool "power6"
      select BR2_POWERPC_CPU_HAS_ALTIVEC

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

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

#8 lore raw

PATCH 6/7 support/scripts/gen-bootlin-toolchains: properly take into account !BR2_STATIC_LIBS for glibc toolchains

In reply to Thomas Petazzoni via buildroot

The Config.in options created for each toolchain were properly taking into account the !BR2_STATIC_LIBS dependency of glibc toolchains. However, this dependency was not taken into account into the main BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARCH_SUPPORTS option. Consequently, if an architecture is only supported by glibc, but BR2_STATIC_LIBS is enabled, the main "Bootlin toolchain" option was visible... but with no selectable toolchain.

We fix this by making sure that BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARCH_SUPPORTS is only true for all architectures supported, taking into account the fact that some architectures can only be supported if !BR2_STATIC_LIBS, when the only available C library is glibc.

---
 support/scripts/gen-bootlin-toolchains | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
support/scripts/gen-bootlin-toolchains +4 -1
index f9dd9da9a8..97a744340a 100755
@@ -482,7 +482,10 @@ def gen_config_in_options(toolchains, fpath):
         f.write("config BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARCH_SUPPORTS\n")
         f.write("\tbool\n")
         for arch, details in arches.items():
-            f.write("\tdefault y if %s\n" % " && ".join(details['conditions']))
+            conditions = details['conditions'].copy()
+            if set([t.libc for t in toolchains if t.arch == arch]) == set(['glibc']):
+                conditions.append("!BR2_STATIC_LIBS")
+            f.write("\tdefault y if %s\n" % " && ".join(conditions))
         f.write("\n")
 
         f.write("if BR2_TOOLCHAIN_EXTERNAL_BOOTLIN\n\n")
Signature · 6 lines
2.35.3

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

Re: [Buildroot] [PATCH 6/7] support/scripts/gen-bootlin-toolchains: properly take into account !BR2_STATIC_LIBS for glibc toolchains

Thomas, All,

On 2022-06-05 21:42 +0200, Thomas Petazzoni spake thusly:

Quoted 24 lines

The Config.in options created for each toolchain were properly taking into account the !BR2_STATIC_LIBS dependency of glibc toolchains. However, this dependency was not taken into account into the main BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARCH_SUPPORTS option. Consequently, if an architecture is only supported by glibc, but BR2_STATIC_LIBS is enabled, the main "Bootlin toolchain" option was visible... but with no selectable toolchain.

We fix this by making sure that BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARCH_SUPPORTS is only true for all architectures supported, taking into account the fact that some architectures can only be supported if !BR2_STATIC_LIBS, when the only available C library is glibc.

---
 support/scripts/gen-bootlin-toolchains | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
support/scripts/gen-bootlin-toolchains +0 -0
index f9dd9da9a8..97a744340a 100755

support/scripts/gen-bootlin-toolchains def gen_config_in_options(toolchains, fpath): · line 486

Quoted 6 lines
support/scripts/gen-bootlin-toolchains +2 -1
@@ -482,7 +482,10 @@ def gen_config_in_options(toolchains, fpath):
         f.write("config BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARCH_SUPPORTS\n")
         f.write("\tbool\n")
         for arch, details in arches.items():
-            f.write("\tdefault y if %s\n" % " && ".join(details['conditions']))
+            conditions = details['conditions'].copy()
+            if set([t.libc for t in toolchains if t.arch == arch]) == set(['glibc']):

What about:

    if 'glibc' in [t.libc for t in toolchains if t.arch == arch]

Regards,
Yann E. MORIN.

Quoted 8 lines
support/scripts/gen-bootlin-toolchains +2 -0
+                conditions.append("!BR2_STATIC_LIBS")
+            f.write("\tdefault y if %s\n" % " && ".join(conditions))
         f.write("\n")
 
         f.write("if BR2_TOOLCHAIN_EXTERNAL_BOOTLIN\n\n")
Signature · 1 line
2.35.3
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
#10 lore raw

Re: [Buildroot] [PATCH 6/7] support/scripts/gen-bootlin-toolchains: properly take into account !BR2_STATIC_LIBS for glibc toolchains

Thomas, All,

On 2022-06-05 22:24 +0200, Yann E. MORIN spake thusly:

Quoted 33 lines

On 2022-06-05 21:42 +0200, Thomas Petazzoni spake thusly:

Quoted 24 lines

The Config.in options created for each toolchain were properly taking into account the !BR2_STATIC_LIBS dependency of glibc toolchains. However, this dependency was not taken into account into the main BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARCH_SUPPORTS option. Consequently, if an architecture is only supported by glibc, but BR2_STATIC_LIBS is enabled, the main "Bootlin toolchain" option was visible... but with no selectable toolchain.

We fix this by making sure that BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARCH_SUPPORTS is only true for all architectures supported, taking into account the fact that some architectures can only be supported if !BR2_STATIC_LIBS, when the only available C library is glibc.

---
 support/scripts/gen-bootlin-toolchains | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
support/scripts/gen-bootlin-toolchains +0 -0
index f9dd9da9a8..97a744340a 100755

support/scripts/gen-bootlin-toolchains def gen_config_in_options(toolchains, fpath): · line 486

Quoted 6 lines
support/scripts/gen-bootlin-toolchains +2 -1
@@ -482,7 +482,10 @@ def gen_config_in_options(toolchains, fpath):
         f.write("config BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARCH_SUPPORTS\n")
         f.write("\tbool\n")
         for arch, details in arches.items():
-            f.write("\tdefault y if %s\n" % " && ".join(details['conditions']))
+            conditions = details['conditions'].copy()
+            if set([t.libc for t in toolchains if t.arch == arch]) == set(['glibc']):

What about:

Quoted 1 line
    if 'glibc' in [t.libc for t in toolchains if t.arch == arch]

Nah, that does not test that there is *only* glibc; forget it...

Regards,
Yann E. MORIN.

Quoted 21 lines
Quoted 9 lines
support/scripts/gen-bootlin-toolchains +2 -0
+                conditions.append("!BR2_STATIC_LIBS")
+            f.write("\tdefault y if %s\n" % " && ".join(conditions))
         f.write("\n")
 
         f.write("if BR2_TOOLCHAIN_EXTERNAL_BOOTLIN\n\n")
Signature · 1 line
2.35.3
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
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
#11 lore raw

Re: [Buildroot] [PATCH 6/7] support/scripts/gen-bootlin-toolchains: properly take into account !BR2_STATIC_LIBS for glibc toolchains

Quoted 4 lines · On Sun, 5 Jun 2022 22:28:03 +0200 "Yann E. MORIN" <[email protected]>…
Quoted 2 lines

What about:

    if 'glibc' in [t.libc for t in toolchains if t.arch == arch]  

Nah, that does not test that there is *only* glibc; forget it...

Ah sorry, you realized separately. I had already replied to your previous reply :-)

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#12 lore raw

Re: [Buildroot] [PATCH 6/7] support/scripts/gen-bootlin-toolchains: properly take into account !BR2_STATIC_LIBS for glibc toolchains

In reply to Yann E. MORIN
Quoted 8 lines · On Sun, 5 Jun 2022 22:24:11 +0200 "Yann E. MORIN" <[email protected]>…

support/scripts/gen-bootlin-toolchains def gen_config_in_options(toolchains, fpath): · line 486

Quoted 4 lines

for arch, details in arches.items():

support/scripts/gen-bootlin-toolchains +2 -1
-            f.write("\tdefault y if %s\n" % " && ".join(details['conditions']))
+            conditions = details['conditions'].copy()
+            if set([t.libc for t in toolchains if t.arch == arch]) == set(['glibc']):  

What about:

    if 'glibc' in [t.libc for t in toolchains if t.arch == arch]

No, that would not work. We want to match if *only* glibc is available as a C library, not if glibc is one of the supported C libraries.

If [t.libc for t in toolchains if t.arch == arch] contains glibc and uclibc, we should *not* add the !BR2_STATIC_LIBS dependency, because uclibc can be used in the BR2_STATIC_LIBS=y scenario.

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#13 lore raw

PATCH 7/7 toolchain/toolchain-external/toolchain-external-bootlin: regenerate with correct !BR2_STATIC_LIBS handling

In reply to Thomas Petazzoni via buildroot

This commit is simply the result of regenerating the toolchain-external-bootlin package after gen-bootlin-toolchains was changed in commit "support/scripts/gen-bootlin-toolchains: properly take into account !BR2_STATIC_LIBS for glibc toolchains".

---
 .../toolchain-external-bootlin/Config.in.options       | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
toolchain/toolchain-external/toolchain-external-bootlin/Config.in.options +5 -5
index 53034c4f5e..06a9ddf2d2 100644
@@ -22,21 +22,21 @@ config BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARCH_SUPPORTS
 	default y if BR2_mips64 && BR2_mips_64 && BR2_MIPS_NABI32 && !BR2_MIPS_SOFT_FLOAT
 	default y if BR2_mips64el && BR2_mips_64 && BR2_MIPS_NABI32 && !BR2_MIPS_SOFT_FLOAT
 	default y if BR2_mips64el && BR2_mips_64r6 && BR2_MIPS_NABI32 && !BR2_MIPS_SOFT_FLOAT
-	default y if BR2_nios2
+	default y if BR2_nios2 && !BR2_STATIC_LIBS
 	default y if BR2_or1k
 	default y if BR2_powerpc && BR2_powerpc_440fp
 	default y if BR2_powerpc && BR2_powerpc_e300c3
 	default y if BR2_powerpc && BR2_powerpc_e500mc
-	default y if BR2_powerpc64 && BR2_powerpc_e5500
+	default y if BR2_powerpc64 && BR2_powerpc_e5500 && !BR2_STATIC_LIBS
 	default y if BR2_powerpc64 && BR2_powerpc_e6500
 	default y if BR2_powerpc64 && BR2_powerpc_power8
 	default y if BR2_powerpc64le && BR2_powerpc_power8
-	default y if BR2_riscv && BR2_riscv_g && BR2_RISCV_32 && BR2_RISCV_ABI_ILP32D
+	default y if BR2_riscv && BR2_riscv_g && BR2_RISCV_32 && BR2_RISCV_ABI_ILP32D && !BR2_STATIC_LIBS
 	default y if BR2_riscv && BR2_riscv_g && BR2_RISCV_64 && BR2_RISCV_ABI_LP64D
-	default y if BR2_s390x && BR2_s390x_z13
+	default y if BR2_s390x && BR2_s390x_z13 && !BR2_STATIC_LIBS
 	default y if BR2_sh && BR2_sh4
 	default y if BR2_sh && BR2_sh4aeb
-	default y if BR2_sparc64 && BR2_sparc_v9
+	default y if BR2_sparc64 && BR2_sparc_v9 && !BR2_STATIC_LIBS
 	default y if BR2_sparc && BR2_sparc_v8
 	default y if BR2_x86_64 && BR2_X86_CPU_HAS_MMX && BR2_X86_CPU_HAS_SSE && BR2_X86_CPU_HAS_SSE2
 	default y if BR2_x86_64 && BR2_X86_CPU_HAS_MMX && BR2_X86_CPU_HAS_SSE && BR2_X86_CPU_HAS_SSE2 && BR2_X86_CPU_HAS_SSE3 && BR2_X86_CPU_HAS_SSSE3 && BR2_X86_CPU_HAS_SSE4 && BR2_X86_CPU_HAS_SSE42
Signature · 6 lines
2.35.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#14 lore raw
In reply to Thomas Petazzoni via buildroot

James, Thomas, All,

On 2022-06-05 21:42 +0200, Thomas Petazzoni spake thusly:

Quoted 23 lines

The starting point for this series is the investigation of several build failures affecting the master branch.

Most of those failures are due to the fact that we can currently create configurations for which no C library is available. This happens on architectures where glibc is the only supported C library, but BR2_STATIC_LIBS is enabled.

This is taken care of by the first four patches, which are basically split from a single patch posted by James Hilliard.

Then, another problem is that a recent commit allowed glibc only for powerpc8 on the ppc64le architecture, leaving a number of other PowerPC variants selectable with ppc64le, but for which no C library was available.

Finally, the toolchain-external-booltin package had a similar problem to the glibc/BR2_STATIC_LIBS issue: the package would be visible even if BR2_STATIC_LIBS=y and the selected CPU architecture is only supported by glibc.

Thomas

Quoted 7 lines

James Hilliard (4):
package/uclibc: introduce and use BR2_PACKAGE_UCLIBC_ARCH_SUPPORTS and
BR2_PACKAGE_UCLIBC_SUPPORTS
package/glibc: introduce and use BR2_PACKAGE_GLIBC_ARCH_SUPPORTS and
BR2_PACKAGE_GLIBC_SUPPORTS
package/musl: introduce and use BR2_PACKAGE_MUSL_ARCH_SUPPORTS and
BR2_PACKAGE_MUSL_SUPPORTS

Those three patches, applied to master, thanks.

I've however re-ordered them so that glibc comes first, which is then used as an argument for keeping the same construct in uClibc-ng (so I tweaked the commit message slightly), and to make the same argument in musl as well (where I duplicated the commit log from uClibc-ng).

Regards,
Yann E. MORIN.

Quoted 22 lines

Config.in: only allow BR2_STATIC_LIBS on supported libc/arch

Thomas Petazzoni (3):
arch/Config.in.powerpc: disable some variants on ppc64le support/scripts/gen-bootlin-toolchains: properly take into account
!BR2_STATIC_LIBS for glibc toolchains
toolchain/toolchain-external/toolchain-external-bootlin: regenerate
with correct !BR2_STATIC_LIBS handling

 Config.in                                     |  2 +
 arch/Config.in.powerpc                        | 10 +++++
 package/glibc/Config.in                       | 38 ++++++++++++++++
 package/musl/Config.in                        | 28 ++++++++++++
 package/uclibc/Config.in                      | 28 ++++++++++++
 support/scripts/gen-bootlin-toolchains        |  5 ++-
 toolchain/toolchain-buildroot/Config.in       | 43 ++++---------------
 .../Config.in.options                         | 10 ++---
 8 files changed, 124 insertions(+), 40 deletions(-)
Signature · 1 line
2.35.3
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
#15 lore raw
In reply to Thomas Petazzoni via buildroot

James, Thomas, All,

On 2022-06-05 21:42 +0200, Thomas Petazzoni via buildroot spake thusly:

Quoted 7 lines

The starting point for this series is the investigation of several build failures affecting the master branch.

Most of those failures are due to the fact that we can currently create configurations for which no C library is available. This happens on architectures where glibc is the only supported C library, but BR2_STATIC_LIBS is enabled.

[--SNIP--]

Quoted 2 lines

James Hilliard (4):
Config.in: only allow BR2_STATIC_LIBS on supported libc/arch

As noticed by Arnout: Thomas, you dropped James' SoB in this patch (I guess as part of splitting it into four patches), so I re-added it as it was in the original v3:

    https://lore.kernel.org/buildroot/[email protected]/
Quoted 6 lines

Thomas Petazzoni (3):
arch/Config.in.powerpc: disable some variants on ppc64le support/scripts/gen-bootlin-toolchains: properly take into account
!BR2_STATIC_LIBS for glibc toolchains
toolchain/toolchain-external/toolchain-external-bootlin: regenerate
with correct !BR2_STATIC_LIBS handling

.. and with the rest of the series, and the blessing from Arnout on IRC:
applied to master, thanks.

Regards,
Yann E. MORIN.

Quoted 17 lines
 Config.in                                     |  2 +
 arch/Config.in.powerpc                        | 10 +++++
 package/glibc/Config.in                       | 38 ++++++++++++++++
 package/musl/Config.in                        | 28 ++++++++++++
 package/uclibc/Config.in                      | 28 ++++++++++++
 support/scripts/gen-bootlin-toolchains        |  5 ++-
 toolchain/toolchain-buildroot/Config.in       | 43 ++++---------------
 .../Config.in.options                         | 10 ++---
 8 files changed, 124 insertions(+), 40 deletions(-)
Signature · 6 lines
2.35.3

_______________________________________________
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