[Buildroot] [PATCH 1/1] support/scripts/gen-bootlin-toolchains: allows armv8-a CPU to use armv7-a toolchains

Thomas Petazzoni thomas.petazzoni at bootlin.com
Sat Apr 19 14:03:00 UTC 2025


On Tue, 15 Apr 2025 13:25:05 +0200
Gaël PORTAY <gael.portay+rtone at gmail.com> wrote:

> The ARMV7-A toolchains are capable to compile binaries for ARMv8-A CPU
> in AArch32 execution state.
> 
> This adds the BR2_ARM_CPU_ARMV8A option in the 'conditions' to allow
> ARMV8-A CPU such as Cortex-A53 or Cortex-A72 to use ARMV7-A toolchains.
> 
> Signed-off-by: Gaël PORTAY <gael.portay+rtone at gmail.com>

Thanks, applied!

> In an attempt to move the Raspberry defconfigs to the Bootlin external
> toolchain (glibc-stable), I figured out that the ARM64 CPUs in 32-bits
> have no Bootlin toolchain available because of a lack for the likewise
> 'conditions': BR2_ARM_CPU_ARMV7A || BR2_ARM_CPU_ARMV8A
> 
> I am a little bit concerned about the change propose in this patch as
> the 'conditions' could be used to generate the test if no 'test_options'
> is defined, and that cannot split the following 'conditions' into single
> option pieces:
> 
> 	(BR2_ARM_CPU_ARMV7A && BR2_ARM_EABIHF) || BR2_ARM_CPU_ARMV8A
> 
> This is the part of code that would not work if 'test_options' is unset:
> 
> 	if 'test_options' in arches[self.arch]:
> 	    test_options = arches[self.arch]['test_options']
> 	else:
> 	    test_options = arches[self.arch]['conditions']
> 	for opt in test_options:
> 	    if opt.startswith("!"):
> 	        f.write("        # %s is not set\n" % opt[1:])
> 	    else:
> 	        f.write("        %s=y\n" % opt)
> 
> However, this kind of "complex" 'conditions' with such CPU feature
> options requires to get overriden by the 'test_options', right?

I understand your concern, but I believe you're right that those
complex cases simply _must_ have test_conditions defined. I thought a
bit about this, and didn't see a reasonably simple solution other than
what you have proposed.

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com


More information about the buildroot mailing list