Skip to contentSkip to conversation

package/gcc: cleanup arch/cpu combinations

PATCH Superseded Gustavo Zacarias 2 participants 5 messages Aug 19, 2014 – Aug 20, 2014

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/gcc: cleanup arch/cpu combinations

Cleanup arch/cpu combination limits, we had super-wide depends and it doesn't help readability.

Make the bool/depends/select order the same for all entries.

Drop redundant limitations, for example sparc* if sparc wasn't supported in general.

Power8 requires at least gcc 4.9.

---
 package/gcc/Config.in.host | 76 ++++++++++++++++++++++++++++++++++++----------
 1 file changed, 60 insertions(+), 16 deletions(-)
package/gcc/Config.in.host +60 -16
index b29bacb..79e924e 100644
@@ -19,58 +19,102 @@ choice
 	  Select the version of gcc you wish to use.
 
 	config BR2_GCC_VERSION_4_2_2_AVR32_2_1_5
-		depends on BR2_avr32
 		bool "gcc 4.2.2-avr32-2.1.5"
+		# Only supported architecture
+		depends on BR2_avr32
 
 	config BR2_GCC_VERSION_4_4_X
-		depends on !BR2_microblaze && !BR2_aarch64 && !BR2_arc && !BR2_avr32 && !BR2_cortex_a5 && !BR2_cortex_a7 && !BR2_cortex_a12 && !BR2_cortex_a15 && !BR2_x86_corei7 && !BR2_x86_atom && !BR2_x86_jaguar && !BR2_powerpc_476 && !BR2_powerpc_476fp && !BR2_fa526 && !BR2_pj4 && !BR2_powerpc64le
 		bool "gcc 4.4.x"
+		# Unsupported architectures
+		depends on !BR2_microblaze && !BR2_aarch64 && !BR2_arc \
+			&& !BR2_avr32 && !BR2_powerpc64le
+		# Unsupported ARM cores
+		depends on !BR2_cortex_a5 && !BR2_cortex_a7 && \
+			!BR2_cortex_a12 && !BR2_cortex_a15 && !BR2_fa526 && \
+			!BR2_pj4
 		# ARM EABIhf support appeared in gcc 4.6
 		depends on !BR2_ARM_EABIHF
-		# VFPv4 support appeared in gcc 4.5
+		# ARM VFPv4 support appeared in gcc 4.5
 		depends on !BR2_ARM_FPU_VFPV4 && !BR2_ARM_FPU_VFPV4D16
+		# Unsupported PPC cores
+		depends on !BR2_powerpc_476 && !BR2_powerpc_476fp \
+			&& !BR2_power8
+		# Unsupported x86 cores
+		depends on !BR2_x86_atom && !BR2_x86_corei7 && !BR2_x86_jaguar
 		# musl patches only for gcc 4.7+
 		depends on !BR2_TOOLCHAIN_BUILDROOT_MUSL
 
 	config BR2_GCC_VERSION_4_5_X
-		depends on !BR2_microblaze && !BR2_aarch64 && !BR2_arc && !BR2_avr32 && !BR2_cortex_a7 && !BR2_cortex_a12 && !BR2_cortex_a15 && !BR2_x86_corei7 && !BR2_x86_jaguar && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8 && !BR2_fa526 && !BR2_pj4 && !BR2_powerpc64le
-		select BR2_GCC_NEEDS_MPC
+		bool "gcc 4.5.x"
+		# Unsupported architectures
+		depends on !BR2_microblaze && !BR2_aarch64 && !BR2_arc \
+			&& !BR2_avr32  && !BR2_powerpc64le
+		# Unsupported ARM cores
+		depends on !BR2_cortex_a7 && !BR2_cortex_a12 && \
+			!BR2_cortex_a15 && !BR2_fa526 && !BR2_pj4
+		# Unsupported PPC cores
+		depends on !BR2_power8
+		# Unsupported SPARC cores
+		depends on !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 \
+			&& !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8
+		# Unsupported X86 cores
+		depends on !BR2_x86_corei7 && !BR2_x86_jaguar
 		# ARM EABIhf support appeared in gcc 4.6
 		depends on !BR2_ARM_EABIHF
 		# musl patches only for gcc 4.7+
 		depends on !BR2_TOOLCHAIN_BUILDROOT_MUSL
-		bool "gcc 4.5.x"
+		select BR2_GCC_NEEDS_MPC
 
 	config BR2_GCC_VERSION_4_7_X
-		depends on !BR2_microblaze && !BR2_aarch64 && !BR2_arc && !BR2_avr32 && !BR2_bfin && !BR2_cortex_a12 && !BR2_x86_jaguar && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8 && !BR2_pj4 && !BR2_powerpc64le
-		select BR2_GCC_NEEDS_MPC
 		bool "gcc 4.7.x"
+		# Unsupported architectures
+		depends on !BR2_microblaze && !BR2_aarch64 && !BR2_arc \
+			&& !BR2_avr32 && !BR2_bfin && !BR2_powerpc64le
+		# Unsupported ARM cores
+		depends on !BR2_cortex_a12 && !BR2_pj4
+		# Unsupported PPC cores
+		depends on !BR2_power8
+		# Unsupported SPARC cores
+		depends on !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 \
+			&& !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8
+		# Unsupported x86 cores
+		depends on !BR2_x86_jaguar
+		select BR2_GCC_NEEDS_MPC
 
 	config BR2_GCC_VERSION_4_8_X
-		depends on !BR2_microblaze && !BR2_arc && !BR2_avr32 && !BR2_bfin && !BR2_cortex_a12 && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8 && !BR2_powerpc64le && !BR2_sparc
+		bool "gcc 4.8.x"
+		# Unsupported architectures
+		depends on !BR2_microblaze && !BR2_arc && !BR2_avr32 \
+			&& !BR2_bfin && !BR2_powerpc64le && !BR2_sparc
+		# Unsupported ARM cores
+		depends on !BR2_cortex_a12
+		# Unsupported PPC cores
+		depends on !BR2_power8
 		select BR2_GCC_NEEDS_MPC
 		select BR2_GCC_SUPPORTS_GRAPHITE
-		bool "gcc 4.8.x"
 
 	config BR2_GCC_VERSION_4_8_ARC
+		bool "gcc 4.8-arc"
+		# Only supported architecture
 		depends on BR2_arc
 		select BR2_GCC_NEEDS_MPC
-		bool "gcc 4.8-arc"
 
 	config BR2_GCC_VERSION_4_9_X
-		depends on !BR2_arc && !BR2_avr32 && !BR2_bfin && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8 && !BR2_sparc
+		bool "gcc 4.9.x"
+		# Unsupported architectures
+		depends on !BR2_arc && !BR2_avr32 && !BR2_bfin && !BR2_sparc
 		# PR60102 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60102
 		select BR2_GCC_NEEDS_MPC
 		select BR2_GCC_SUPPORTS_GRAPHITE
-		bool "gcc 4.9.x"
 
 	config BR2_GCC_VERSION_SNAP
-		depends on !BR2_arc && !BR2_avr32 && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8 && !BR2_sparc
-		select BR2_GCC_NEEDS_MPC
+		bool "gcc snapshot"
+		# Unsupported architectures
+		depends on !BR2_arc && !BR2_avr32 && !BR2_sparc
 		# musl patches only for gcc 4.7+
 		depends on !BR2_TOOLCHAIN_BUILDROOT_MUSL
+		select BR2_GCC_NEEDS_MPC
 		select BR2_GCC_SUPPORTS_GRAPHITE
-		bool "gcc snapshot"
 endchoice
 
 config BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE
Signature · 1 line
1.8.5.5
#1 lore raw

PATCH v2 1/1 package/gcc: cleanup arch/cpu combinations

Dear Gustavo Zacarias,

Quoted 11 lines · Gustavo Zacarias

Cleanup arch/cpu combination limits, we had super-wide depends and it doesn't help readability.

Make the bool/depends/select order the same for all entries.

Drop redundant limitations, for example sparc* if sparc wasn't supported in general.

Power8 requires at least gcc 4.9.

What do you think of a solution like:

[Buildroot] [PATCH] toolchain/gcc: Introduce BR2_ARCH_HAS_GCC_x_y_PLUS

which Mischa Jonker posted a while ago (but didn't push strong enough to get it merged) ?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH v2 1/1 package/gcc: cleanup arch/cpu combinations

Quoted 6 lines · Thomas Petazzoni

What do you think of a solution like:

[Buildroot] [PATCH] toolchain/gcc: Introduce BR2_ARCH_HAS_GCC_x_y_PLUS

which Mischa Jonker posted a while ago (but didn't push strong enough to get it merged) ?

Hi.
I thought about that but it really doesn't help in this scenario in a complete way, since a given gcc may be broken (like 4.9.x was for ppc e500) even though it includes support because of bitrot or bugs, like some sparc targets, or blackfin for that matter.
Regards.

#3 lore raw

PATCH v2 1/1 package/gcc: cleanup arch/cpu combinations

Dear Gustavo Zacarias,

Quoted 4 lines · Gustavo Zacarias

I thought about that but it really doesn't help in this scenario in a complete way, since a given gcc may be broken (like 4.9.x was for ppc e500) even though it includes support because of bitrot or bugs, like some sparc targets, or blackfin for that matter.

Right, but I believe it's two different (but related) matters:

* On one hand, Mischa's approach is good to specify starting from which gcc version this or that architecture or architecture variant was supported. It allows to encode the "theory".

* On the other hand, additional 'depends on' can be added exceptionally to prevent certain gcc versions from being selected, when they are supposed to work in theory, but in practice do not work due to bugs (that are likely to be fixed in the next point release).

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#4 lore raw

PATCH v2 1/1 package/gcc: cleanup arch/cpu combinations

Quoted 11 lines · Thomas Petazzoni

Right, but I believe it's two different (but related) matters:

* On one hand, Mischa's approach is good to specify starting from which gcc version this or that architecture or architecture variant was supported. It allows to encode the "theory".

* On the other hand, additional 'depends on' can be added exceptionally to prevent certain gcc versions from being selected, when they are supposed to work in theory, but in practice do not work due to bugs (that are likely to be fixed in the next point release).

True.
My basic aim here was to make things more legible when i was putting a limit on power8 since it was too cluttered already with a single depends being 300 characters wide - hardly legible and very prone to mistakes/redundancy.
I think we can commit this and "upgrade it" so to speak when Mischa's patchset is in to clean it up more.
Regards.