Skip to contentSkip to conversation

UML: hard-code the result of 'uname -s'

PATCH Superseded Masahiro Yamada 1 participant 2 messages Jul 21, 2023

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 UML: hard-code the result of 'uname -s'

We rely on 'uname -s' returning 'Linux' as there are arch/um/os-Linux/ and arch/x86/um/os-Linux/, but no other os-*/ directories.

Supporting a non-Linux host is unlikely to happen.

Let's hard-code 'Linux'.

---

 arch/um/Makefile     | 7 +++----
 arch/x86/um/Makefile | 2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)
arch/um/Makefile +3 -4
index da4d5256af2f..1735a562453d 100644
@@ -18,14 +18,13 @@ else
 endif
 
 ARCH_DIR := arch/um
-OS := $(shell uname -s)
 # We require bash because the vmlinux link and loader script cpp use bash
 # features.
 SHELL := /bin/bash
 
 core-y			+= $(ARCH_DIR)/kernel/		\
 			   $(ARCH_DIR)/drivers/		\
-			   $(ARCH_DIR)/os-$(OS)/
+			   $(ARCH_DIR)/os-Linux/
 
 MODE_INCLUDE	+= -I$(srctree)/$(ARCH_DIR)/include/shared/skas
 
@@ -78,7 +77,7 @@ USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -I%,,$(KBUILD_CFLAGS))) \
 		-idirafter $(objtree)/include -D__KERNEL__ -D__UM_HOST__
 
 #This will adjust *FLAGS accordingly to the platform.
-include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)
+include $(srctree)/$(ARCH_DIR)/Makefile-os-Linux
 
 KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_DIR)/include \
 		   -I$(srctree)/$(HOST_DIR)/include/uapi \
@@ -155,4 +154,4 @@ archclean:
 	@find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \
 		-o -name '*.gcov' \) -type f -print | xargs rm -f
 
-export HEADER_ARCH SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS DEV_NULL_PATH
+export HEADER_ARCH SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING DEV_NULL_PATH
arch/x86/um/Makefile +1 -1
index ee89f6bb9242..e207e6748aa2 100644
@@ -13,7 +13,7 @@ obj-y = bugs_$(BITS).o delay.o fault.o ldt.o \
 	ptrace_$(BITS).o ptrace_user.o setjmp_$(BITS).o signal.o \
 	stub_$(BITS).o stub_segv.o \
 	sys_call_table_$(BITS).o sysrq_$(BITS).o tls_$(BITS).o \
-	mem_$(BITS).o subarch.o os-$(OS)/
+	mem_$(BITS).o subarch.o os-Linux/
 
 ifeq ($(CONFIG_X86_32),y)
 
Signature · 1 line
2.39.2
#1 lore raw

PATCH 2/2 UML: use obj-y to descend into arch/um/*/

I like to use obj-y in as many places as possible.

Change the core-y to obj-y. It fixes the single build issue. [1]

[1]: https://lore.kernel.org/linux-kbuild/[email protected]/T/#m7bc402e1e038f00ebcf2e92ed7fcb8a52fc1ea44

---

 arch/um/Kbuild   | 2 ++
 arch/um/Makefile | 4 ----
 2 files changed, 2 insertions(+), 4 deletions(-)
arch/um/Kbuild +2 -0
index a4e40e534e6a..6cf0c1e5927b 100644
@@ -1 +1,3 @@
 # SPDX-License-Identifier: GPL-2.0-only
+
+obj-y += kernel/ drivers/ os-Linux/
arch/um/Makefile +0 -4
index 1735a562453d..82f05f250634 100644
@@ -22,10 +22,6 @@ ARCH_DIR := arch/um
 # features.
 SHELL := /bin/bash
 
-core-y			+= $(ARCH_DIR)/kernel/		\
-			   $(ARCH_DIR)/drivers/		\
-			   $(ARCH_DIR)/os-Linux/
-
 MODE_INCLUDE	+= -I$(srctree)/$(ARCH_DIR)/include/shared/skas
 
 HEADER_ARCH 	:= $(SUBARCH)
Signature · 7 lines
2.39.2


_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um