Commit
c11dceaa9698 ("kconfig: Determine the default arch from CC")
introduced the automatic selection of a default target architecture by
querying and parsing the default compiler's target machine. Because the
detection breaks across GCC output versions, this commit forwards the host
architecture already detected by the main Makefile to the KConfig
system. This way, KConfig will be in sync with what the Makefile system has
detected.
Signed-off-by: Simon Kuenzer <simon@unikraft.io>
Reviewed-by: Michalis Pappas <michalis@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikrat.io>
GitHub-Closes: #1084
# see https://www.kernel.org/doc/Documentation/kbuild/Config.in-language.txt.
#
mainmenu "Unikraft/$(UK_FULLVERSION) Configuration"
+
config UK_FULLVERSION
string
default "$(UK_FULLVERSION)"
+
config UK_CODENAME
string
default "$(UK_CODENAME)"
+
config UK_ARCH
string
default "x86_64" if ARCH_X86_64
default "arm" if ARCH_ARM_32
default "$(UK_ARCH)"
+config HOST_ARCH
+ string
+ default "$(HOST_ARCH)"
+
config NO_APP
def_bool $(shell,test $(UK_BASE) = $(UK_APP) && echo y || echo n)
# We don't want to fully expand UK_DEFCONFIG here, so Kconfig will
# recognize that if it's still at its default $(CONFIG_DIR)/defconfig
COMMON_CONFIG_ENV = \
- CC=$(CC)\
CONFIG_="CONFIG_" \
KCONFIG_CONFIG="$(UK_CONFIG)" \
KCONFIG_AUTOCONFIG="$(KCONFIG_AUTOCONFIG)" \
KCONFIG_AUTOHEADER="$(KCONFIG_AUTOHEADER)" \
KCONFIG_TRISTATE="$(KCONFIG_TRISTATE)" \
- HOST_GCC_VERSION="$(HOSTCC_VERSION)" \
+ HOST_ARCH="$(HOSTARCH)" \
BUILD_DIR="$(BUILD_DIR)" \
UK_BASE="$(CONFIG_UK_BASE)" \
UK_APP="$(CONFIG_UK_APP)" \
choice
prompt "Architecture"
- default ARCH_ARM_32 if ($(shell,$(CC) -dumpmachine | cut -d '-' -f1) = "arm")
- default ARCH_ARM_64 if ($(shell,$(CC) -dumpmachine | cut -d '-' -f1) = "arm64")
+ default ARCH_ARM_32 if HOST_ARCH = "arm"
+ default ARCH_ARM_64 if HOST_ARCH = "arm64"
default ARCH_X86_64
help
Select the target CPU architecture.