* [PATCH v2 1/2] UML: hard-code the result of 'uname -s'
@ 2023-07-21 17:18 Masahiro Yamada
2023-07-21 17:18 ` [PATCH v2 2/2] UML: use obj-y to descend into arch/um/*/ Masahiro Yamada
2023-08-19 21:08 ` [PATCH v2 1/2] UML: hard-code the result of 'uname -s' Richard Weinberger
0 siblings, 2 replies; 6+ messages in thread
From: Masahiro Yamada @ 2023-07-21 17:18 UTC (permalink / raw)
To: Richard Weinberger, Anton Ivanov, Johannes Berg, linux-um
Cc: linux-kernel, linux-kbuild, Jiri Slaby, Masahiro Yamada,
Borislav Petkov, Dave Hansen, H. Peter Anvin, Ingo Molnar,
Thomas Gleixner, x86
We rely on 'uname -s' returning 'Linux' because there are os-Linux/
directories, but no other os-*/.
Supporting a non-Linux host is unlikely to happen.
Let's hard-code 'Linux'.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
(no changes since v1)
arch/um/Makefile | 7 +++----
arch/x86/um/Makefile | 2 +-
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/arch/um/Makefile b/arch/um/Makefile
index da4d5256af2f..1735a562453d 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -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
diff --git a/arch/x86/um/Makefile b/arch/x86/um/Makefile
index ee89f6bb9242..e207e6748aa2 100644
--- a/arch/x86/um/Makefile
+++ b/arch/x86/um/Makefile
@@ -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)
--
2.39.2
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] UML: use obj-y to descend into arch/um/*/
2023-07-21 17:18 [PATCH v2 1/2] UML: hard-code the result of 'uname -s' Masahiro Yamada
@ 2023-07-21 17:18 ` Masahiro Yamada
2023-07-24 6:53 ` Jiri Slaby
2023-08-08 18:21 ` Nick Desaulniers
2023-08-19 21:08 ` [PATCH v2 1/2] UML: hard-code the result of 'uname -s' Richard Weinberger
1 sibling, 2 replies; 6+ messages in thread
From: Masahiro Yamada @ 2023-07-21 17:18 UTC (permalink / raw)
To: Richard Weinberger, Anton Ivanov, Johannes Berg, linux-um
Cc: linux-kernel, linux-kbuild, Jiri Slaby, Masahiro Yamada
The single build rule does not work with the core-y syntax. [1]
Use the standard obj-y syntax.
[1]: https://lore.kernel.org/linux-kbuild/d57ba55f-20a3-b836-783d-b49c8a161b6e@kernel.org/T/#m7bc402e1e038f00ebcf2e92ed7fcb8a52fc1ea44
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
Changes in v2:
- Rephase the commit log
arch/um/Kbuild | 2 ++
arch/um/Makefile | 4 ----
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/um/Kbuild b/arch/um/Kbuild
index a4e40e534e6a..6cf0c1e5927b 100644
--- a/arch/um/Kbuild
+++ b/arch/um/Kbuild
@@ -1 +1,3 @@
# SPDX-License-Identifier: GPL-2.0-only
+
+obj-y += kernel/ drivers/ os-Linux/
diff --git a/arch/um/Makefile b/arch/um/Makefile
index 1735a562453d..82f05f250634 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -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)
--
2.39.2
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] UML: use obj-y to descend into arch/um/*/
2023-07-21 17:18 ` [PATCH v2 2/2] UML: use obj-y to descend into arch/um/*/ Masahiro Yamada
@ 2023-07-24 6:53 ` Jiri Slaby
2023-08-08 18:21 ` Nick Desaulniers
1 sibling, 0 replies; 6+ messages in thread
From: Jiri Slaby @ 2023-07-24 6:53 UTC (permalink / raw)
To: Masahiro Yamada, Richard Weinberger, Anton Ivanov, Johannes Berg,
linux-um
Cc: linux-kernel, linux-kbuild
On 21. 07. 23, 19:18, Masahiro Yamada wrote:
> The single build rule does not work with the core-y syntax. [1]
>
> Use the standard obj-y syntax.
>
> [1]: https://lore.kernel.org/linux-kbuild/d57ba55f-20a3-b836-783d-b49c8a161b6e@kernel.org/T/#m7bc402e1e038f00ebcf2e92ed7fcb8a52fc1ea44
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Tested-by: Jiri Slaby <jirislaby@kernel.org>
thanks,
--
js
suse labs
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] UML: use obj-y to descend into arch/um/*/
2023-07-21 17:18 ` [PATCH v2 2/2] UML: use obj-y to descend into arch/um/*/ Masahiro Yamada
2023-07-24 6:53 ` Jiri Slaby
@ 2023-08-08 18:21 ` Nick Desaulniers
1 sibling, 0 replies; 6+ messages in thread
From: Nick Desaulniers @ 2023-08-08 18:21 UTC (permalink / raw)
To: Masahiro Yamada
Cc: Richard Weinberger, Anton Ivanov, Johannes Berg, linux-um,
linux-kernel, linux-kbuild, Jiri Slaby
On Sat, Jul 22, 2023 at 02:18:57AM +0900, Masahiro Yamada wrote:
> The single build rule does not work with the core-y syntax. [1]
>
> Use the standard obj-y syntax.
>
> [1]: https://lore.kernel.org/linux-kbuild/d57ba55f-20a3-b836-783d-b49c8a161b6e@kernel.org/T/#m7bc402e1e038f00ebcf2e92ed7fcb8a52fc1ea44
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
This resolves an issue I reported (but doesn't seem to be on lore
for linux-kbuild...)
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
> ---
>
> Changes in v2:
> - Rephase the commit log
>
> arch/um/Kbuild | 2 ++
> arch/um/Makefile | 4 ----
> 2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/arch/um/Kbuild b/arch/um/Kbuild
> index a4e40e534e6a..6cf0c1e5927b 100644
> --- a/arch/um/Kbuild
> +++ b/arch/um/Kbuild
> @@ -1 +1,3 @@
> # SPDX-License-Identifier: GPL-2.0-only
> +
> +obj-y += kernel/ drivers/ os-Linux/
> diff --git a/arch/um/Makefile b/arch/um/Makefile
> index 1735a562453d..82f05f250634 100644
> --- a/arch/um/Makefile
> +++ b/arch/um/Makefile
> @@ -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)
> --
> 2.39.2
>
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/2] UML: hard-code the result of 'uname -s'
2023-07-21 17:18 [PATCH v2 1/2] UML: hard-code the result of 'uname -s' Masahiro Yamada
2023-07-21 17:18 ` [PATCH v2 2/2] UML: use obj-y to descend into arch/um/*/ Masahiro Yamada
@ 2023-08-19 21:08 ` Richard Weinberger
2023-08-19 23:03 ` Masahiro Yamada
1 sibling, 1 reply; 6+ messages in thread
From: Richard Weinberger @ 2023-08-19 21:08 UTC (permalink / raw)
To: masahiroy
Cc: anton ivanov, Johannes Berg, linux-um, linux-kernel, linux-kbuild,
Jiri Slaby, bp, dave hansen, hpa, mingo, tglx, x86
----- Ursprüngliche Mail -----
> Von: "masahiroy" <masahiroy@kernel.org>
> We rely on 'uname -s' returning 'Linux' because there are os-Linux/
> directories, but no other os-*/.
>
> Supporting a non-Linux host is unlikely to happen.
>
> Let's hard-code 'Linux'.
While I agree that a non-Linux version is unlikely I'd like to
know why we can't keep the uname -s check?
I guess to avoid unnecessary command execution?
Thanks,
//richard
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/2] UML: hard-code the result of 'uname -s'
2023-08-19 21:08 ` [PATCH v2 1/2] UML: hard-code the result of 'uname -s' Richard Weinberger
@ 2023-08-19 23:03 ` Masahiro Yamada
0 siblings, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2023-08-19 23:03 UTC (permalink / raw)
To: Richard Weinberger
Cc: anton ivanov, Johannes Berg, linux-um, linux-kernel, linux-kbuild,
Jiri Slaby, bp, dave hansen, hpa, mingo, tglx, x86
On Sun, Aug 20, 2023 at 6:15 AM Richard Weinberger <richard@nod.at> wrote:
>
> ----- Ursprüngliche Mail -----
> > Von: "masahiroy" <masahiroy@kernel.org>
> > We rely on 'uname -s' returning 'Linux' because there are os-Linux/
> > directories, but no other os-*/.
> >
> > Supporting a non-Linux host is unlikely to happen.
> >
> > Let's hard-code 'Linux'.
>
> While I agree that a non-Linux version is unlikely I'd like to
> know why we can't keep the uname -s check?
> I guess to avoid unnecessary command execution?
Just because 'uname -s' is meaningless.
Just build 'Linux' ones irrespective of the host platform.
If it works, it works.
If not, it does not work.
--
Best Regards
Masahiro Yamada
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-08-19 23:04 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-21 17:18 [PATCH v2 1/2] UML: hard-code the result of 'uname -s' Masahiro Yamada
2023-07-21 17:18 ` [PATCH v2 2/2] UML: use obj-y to descend into arch/um/*/ Masahiro Yamada
2023-07-24 6:53 ` Jiri Slaby
2023-08-08 18:21 ` Nick Desaulniers
2023-08-19 21:08 ` [PATCH v2 1/2] UML: hard-code the result of 'uname -s' Richard Weinberger
2023-08-19 23:03 ` Masahiro Yamada
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).