arch: move definition of KERNEL_ARCH to Config.in.<arch> files

Similar to other arch-specific strings, the 'KERNEL_ARCH' variable can be
determined from Config.in.<arch> files.

Besides aligning with similar strings, this also means simplification: the
big 'sed' covers several architectures not even supported by Buildroot.

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
This commit is contained in:
Thomas De Schampheleire 2022-01-15 21:02:59 +01:00 committed by Arnout Vandecappelle (Essensium/Mind)
parent e8011a08b6
commit cf198e2299
18 changed files with 55 additions and 16 deletions

View File

@ -437,22 +437,7 @@ QUIET := $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),-q)
# Strip off the annoying quoting # Strip off the annoying quoting
ARCH := $(call qstrip,$(BR2_ARCH)) ARCH := $(call qstrip,$(BR2_ARCH))
KERNEL_ARCH := $(call qstrip,$(BR2_KERNEL_ARCH))
KERNEL_ARCH := $(shell echo "$(ARCH)" | sed -e "s/-.*//" \
-e s/i.86/i386/ -e s/sun4u/sparc64/ \
-e s/arcle/arc/ \
-e s/arceb/arc/ \
-e s/arm.*/arm/ -e s/sa110/arm/ \
-e s/aarch64.*/arm64/ \
-e s/nds32.*/nds32/ \
-e s/or1k/openrisc/ \
-e s/parisc64/parisc/ \
-e s/powerpc64.*/powerpc/ \
-e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
-e s/riscv.*/riscv/ \
-e s/sh.*/sh/ \
-e s/s390x/s390/ \
-e s/microblazeel/microblaze/)
ZCAT := $(call qstrip,$(BR2_ZCAT)) ZCAT := $(call qstrip,$(BR2_ZCAT))
BZCAT := $(call qstrip,$(BR2_BZCAT)) BZCAT := $(call qstrip,$(BR2_BZCAT))

View File

@ -328,6 +328,9 @@ config BR2_ARCH_NEEDS_GCC_AT_LEAST_11
config BR2_ARCH config BR2_ARCH
string string
config BR2_KERNEL_ARCH
string
config BR2_ENDIAN config BR2_ENDIAN
string string

View File

@ -62,6 +62,9 @@ config BR2_ARCH
default "arc" if BR2_arcle default "arc" if BR2_arcle
default "arceb" if BR2_arceb default "arceb" if BR2_arceb
config BR2_KERNEL_ARCH
default "arc"
config BR2_arc config BR2_arc
bool bool
default y if BR2_arcle || BR2_arceb default y if BR2_arcle || BR2_arceb

View File

@ -822,6 +822,10 @@ config BR2_ARCH
default "aarch64" if BR2_aarch64 default "aarch64" if BR2_aarch64
default "aarch64_be" if BR2_aarch64_be default "aarch64_be" if BR2_aarch64_be
config BR2_KERNEL_ARCH
default "arm" if BR2_arm || BR2_armeb
default "arm64" if BR2_aarch64 || BR2_aarch64_be
config BR2_ENDIAN config BR2_ENDIAN
default "LITTLE" if (BR2_arm || BR2_aarch64) default "LITTLE" if (BR2_arm || BR2_aarch64)
default "BIG" if (BR2_armeb || BR2_aarch64_be) default "BIG" if (BR2_armeb || BR2_aarch64_be)

View File

@ -39,6 +39,9 @@ config BR2_GCC_TARGET_FLOAT_ABI
config BR2_ARCH config BR2_ARCH
default "csky" default "csky"
config BR2_KERNEL_ARCH
default "csky"
config BR2_ENDIAN config BR2_ENDIAN
default "LITTLE" default "LITTLE"

View File

@ -1,6 +1,9 @@
config BR2_ARCH config BR2_ARCH
default "m68k" if BR2_m68k default "m68k" if BR2_m68k
config BR2_KERNEL_ARCH
default "m68k"
config BR2_ENDIAN config BR2_ENDIAN
default "BIG" default "BIG"

View File

@ -2,6 +2,9 @@ config BR2_ARCH
default "microblazeel" if BR2_microblazeel default "microblazeel" if BR2_microblazeel
default "microblaze" if BR2_microblazebe default "microblaze" if BR2_microblazebe
config BR2_KERNEL_ARCH
default "microblaze"
config BR2_ENDIAN config BR2_ENDIAN
default "LITTLE" if BR2_microblazeel default "LITTLE" if BR2_microblazeel
default "BIG" if BR2_microblazebe default "BIG" if BR2_microblazebe

View File

@ -235,6 +235,9 @@ config BR2_ARCH
default "mips64" if BR2_mips64 default "mips64" if BR2_mips64
default "mips64el" if BR2_mips64el default "mips64el" if BR2_mips64el
config BR2_KERNEL_ARCH
default "mips"
config BR2_ENDIAN config BR2_ENDIAN
default "LITTLE" if BR2_mipsel || BR2_mips64el default "LITTLE" if BR2_mipsel || BR2_mips64el
default "BIG" if BR2_mips || BR2_mips64 default "BIG" if BR2_mips || BR2_mips64

View File

@ -1,6 +1,9 @@
config BR2_ARCH config BR2_ARCH
default "nds32le" default "nds32le"
config BR2_KERNEL_ARCH
default "nds32"
config BR2_GCC_TARGET_ARCH config BR2_GCC_TARGET_ARCH
default "v3" default "v3"

View File

@ -1,6 +1,9 @@
config BR2_ARCH config BR2_ARCH
default "nios2" default "nios2"
config BR2_KERNEL_ARCH
default "nios2"
config BR2_ENDIAN config BR2_ENDIAN
default "LITTLE" default "LITTLE"

View File

@ -1,6 +1,9 @@
config BR2_ARCH config BR2_ARCH
default "or1k" default "or1k"
config BR2_KERNEL_ARCH
default "openrisc"
config BR2_ENDIAN config BR2_ENDIAN
default "BIG" default "BIG"

View File

@ -157,6 +157,9 @@ config BR2_ARCH
default "powerpc64" if BR2_powerpc64 default "powerpc64" if BR2_powerpc64
default "powerpc64le" if BR2_powerpc64le default "powerpc64le" if BR2_powerpc64le
config BR2_KERNEL_ARCH
default "powerpc"
config BR2_ENDIAN config BR2_ENDIAN
default "BIG" if BR2_powerpc || BR2_powerpc64 default "BIG" if BR2_powerpc || BR2_powerpc64
default "LITTLE" if BR2_powerpc64le default "LITTLE" if BR2_powerpc64le

View File

@ -118,6 +118,9 @@ config BR2_ARCH
default "riscv32" if !BR2_ARCH_IS_64 default "riscv32" if !BR2_ARCH_IS_64
default "riscv64" if BR2_ARCH_IS_64 default "riscv64" if BR2_ARCH_IS_64
config BR2_KERNEL_ARCH
default "riscv"
config BR2_ENDIAN config BR2_ENDIAN
default "LITTLE" default "LITTLE"

View File

@ -17,6 +17,9 @@ endchoice
config BR2_ARCH config BR2_ARCH
default "s390x" if BR2_s390x default "s390x" if BR2_s390x
config BR2_KERNEL_ARCH
default "s390"
config BR2_ENDIAN config BR2_ENDIAN
default "BIG" default "BIG"

View File

@ -24,6 +24,9 @@ config BR2_ARCH
default "sh4a" if BR2_sh4a default "sh4a" if BR2_sh4a
default "sh4aeb" if BR2_sh4aeb default "sh4aeb" if BR2_sh4aeb
config BR2_KERNEL_ARCH
default "sh"
config BR2_ENDIAN config BR2_ENDIAN
default "LITTLE" if BR2_sh4 || BR2_sh4a default "LITTLE" if BR2_sh4 || BR2_sh4a
default "BIG" if BR2_sh2a || BR2_sh4eb || BR2_sh4aeb default "BIG" if BR2_sh2a || BR2_sh4eb || BR2_sh4aeb

View File

@ -21,6 +21,10 @@ config BR2_ARCH
default "sparc" if BR2_sparc default "sparc" if BR2_sparc
default "sparc64" if BR2_sparc64 default "sparc64" if BR2_sparc64
config BR2_KERNEL_ARCH
default "sparc" if BR2_sparc
default "sparc64" if BR2_sparc64
config BR2_ENDIAN config BR2_ENDIAN
default "BIG" default "BIG"

View File

@ -564,6 +564,10 @@ config BR2_ARCH
default "i686" if BR2_i386 default "i686" if BR2_i386
default "x86_64" if BR2_x86_64 default "x86_64" if BR2_x86_64
config BR2_KERNEL_ARCH
default "i386" if !BR2_x86_64
default "x86_64" if BR2_x86_64
config BR2_ENDIAN config BR2_ENDIAN
default "LITTLE" default "LITTLE"

View File

@ -48,6 +48,9 @@ config BR2_ENDIAN
config BR2_ARCH config BR2_ARCH
default "xtensa" if BR2_xtensa default "xtensa" if BR2_xtensa
config BR2_KERNEL_ARCH
default "xtensa"
config BR2_READELF_ARCH_NAME config BR2_READELF_ARCH_NAME
default "Tensilica Xtensa Processor" default "Tensilica Xtensa Processor"