[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH v2 21/23] kconfig: Determine the default arch from CC



Automatically determine the architecture using CC

Signed-off-by: Sharan Santhanam <sharan.santhanam@xxxxxxxxx>
---
 Config.uk      | 6 +++++-
 Makefile       | 1 +
 arch/Config.uk | 4 ++--
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/Config.uk b/Config.uk
index 772db857..3235b914 100644
--- a/Config.uk
+++ b/Config.uk
@@ -11,7 +11,11 @@ config UK_CODENAME
        default "$(UK_CODENAME)"
 config UK_ARCH
        string
-       default "$(UK_ARCH)"
+       default "x86_64" if ARCH_X86_64
+       default "arm64"  if ARCH_ARM_64
+       default "arm"   if ARCH_ARM_32
+       default $(UK_ARCH)
+
 config NO_APP
        def_bool $(shell,test $(UK_BASE) = $(UK_APP) && echo y || echo n)
 
diff --git a/Makefile b/Makefile
index 09d2579a..6fa75cf2 100644
--- a/Makefile
+++ b/Makefile
@@ -669,6 +669,7 @@ DEFCONFIG = $(call qstrip,$(UK_DEFCONFIG))
 # 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)" \
diff --git a/arch/Config.uk b/arch/Config.uk
index 9f21504e..79097cf1 100644
--- a/arch/Config.uk
+++ b/arch/Config.uk
@@ -1,7 +1,7 @@
 choice
        prompt "Architecture"
-       default ARCH_ARM_32 if (UK_ARCH = "arm")
-       default ARCH_ARM_64 if (UK_ARCH = "arm64")
+       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_X86_64
        help
          Select the target CPU architecture.
-- 
2.20.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.