* [PATCH 1/3] um: fix parallel building with O= option
2018-08-04 4:47 [PATCH 0/3] Kbuild: fix and clean-up arch/um/Makefile Masahiro Yamada
@ 2018-08-04 4:47 ` Masahiro Yamada
2018-08-04 4:51 ` Masahiro Yamada
2018-09-15 18:47 ` Kees Cook
2018-08-04 4:47 ` [PATCH 2/3] kbuild: add %asm-generic to no-dot-config-targets Masahiro Yamada
` (3 subsequent siblings)
4 siblings, 2 replies; 10+ messages in thread
From: Masahiro Yamada @ 2018-08-04 4:47 UTC (permalink / raw)
To: linux-kbuild
Cc: Jeff Dike, Richard Weinberger, linux-um, Randy Dunlap,
Geert Uytterhoeven, Michal Marek, Sam Ravnborg, Masahiro Yamada,
linux-kernel
Randy Dunlap reports UML occasionally fails to build with -j<N> and
O=<builddir> options.
make[1]: Entering directory '/home/rdunlap/mmotm-2018-0802-1529/UM64'
UPD include/generated/uapi/linux/version.h
WRAP arch/x86/include/generated/asm/dma-contiguous.h
WRAP arch/x86/include/generated/asm/export.h
WRAP arch/x86/include/generated/asm/early_ioremap.h
WRAP arch/x86/include/generated/asm/mcs_spinlock.h
WRAP arch/x86/include/generated/asm/mm-arch-hooks.h
WRAP arch/x86/include/generated/uapi/asm/bpf_perf_event.h
WRAP arch/x86/include/generated/uapi/asm/poll.h
GEN ./Makefile
make[2]: *** No rule to make target 'archheaders'. Stop.
arch/um/Makefile:119: recipe for target 'archheaders' failed
make[1]: *** [archheaders] Error 2
make[1]: *** Waiting for unfinished jobs....
UPD include/config/kernel.release
make[1]: *** wait: No child processes. Stop.
Makefile:146: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2
The cause of the problem is the use of '$(MAKE) KBUILD_SRC=',
which recurses to the top Makefile via the $(objtree)/Makefile
generated by scripts/mkmakefile.
When you run "make -j<N> O=<builddir> ARCH=um", Make can execute
'archheaders' and 'outputmakefile' targets simultaneously because
there is no dependency between them.
If it happens,
$(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders
... tries to run $(objtree)/Makefile that is being updated.
The correct way for the recursion is
$(Q)$(MAKE) -f $(srctree)/Makefile ARCH=$(HEADER_ARCH) archheaders
..., which does not rely on the generated Makefile.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/um/Makefile | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/um/Makefile b/arch/um/Makefile
index e54dda8..de340e4 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -122,8 +122,7 @@ archheaders:
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \
kbuild-file=$(HOST_DIR)/include/uapi/asm/Kbuild \
obj=$(HOST_DIR)/include/generated/uapi/asm
- $(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders
-
+ $(Q)$(MAKE) -f $(srctree)/Makefile ARCH=$(HEADER_ARCH) archheaders
archprepare: include/generated/user_constants.h
--
2.7.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] um: fix parallel building with O= option
2018-08-04 4:47 ` [PATCH 1/3] um: fix parallel building with O= option Masahiro Yamada
@ 2018-08-04 4:51 ` Masahiro Yamada
2018-09-15 18:47 ` Kees Cook
1 sibling, 0 replies; 10+ messages in thread
From: Masahiro Yamada @ 2018-08-04 4:51 UTC (permalink / raw)
To: Linux Kbuild mailing list
Cc: Jeff Dike, Richard Weinberger, linux-um, Randy Dunlap,
Geert Uytterhoeven, Michal Marek, Sam Ravnborg, Masahiro Yamada,
Linux Kernel Mailing List
2018-08-04 13:47 GMT+09:00 Masahiro Yamada <yamada.masahiro@socionext.com>:
> Randy Dunlap reports UML occasionally fails to build with -j<N> and
> O=<builddir> options.
>
> make[1]: Entering directory '/home/rdunlap/mmotm-2018-0802-1529/UM64'
> UPD include/generated/uapi/linux/version.h
> WRAP arch/x86/include/generated/asm/dma-contiguous.h
> WRAP arch/x86/include/generated/asm/export.h
> WRAP arch/x86/include/generated/asm/early_ioremap.h
> WRAP arch/x86/include/generated/asm/mcs_spinlock.h
> WRAP arch/x86/include/generated/asm/mm-arch-hooks.h
> WRAP arch/x86/include/generated/uapi/asm/bpf_perf_event.h
> WRAP arch/x86/include/generated/uapi/asm/poll.h
> GEN ./Makefile
> make[2]: *** No rule to make target 'archheaders'. Stop.
> arch/um/Makefile:119: recipe for target 'archheaders' failed
> make[1]: *** [archheaders] Error 2
> make[1]: *** Waiting for unfinished jobs....
> UPD include/config/kernel.release
> make[1]: *** wait: No child processes. Stop.
> Makefile:146: recipe for target 'sub-make' failed
> make: *** [sub-make] Error 2
>
> The cause of the problem is the use of '$(MAKE) KBUILD_SRC=',
> which recurses to the top Makefile via the $(objtree)/Makefile
> generated by scripts/mkmakefile.
>
> When you run "make -j<N> O=<builddir> ARCH=um", Make can execute
> 'archheaders' and 'outputmakefile' targets simultaneously because
> there is no dependency between them.
>
> If it happens,
>
> $(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders
>
> ... tries to run $(objtree)/Makefile that is being updated.
>
> The correct way for the recursion is
>
> $(Q)$(MAKE) -f $(srctree)/Makefile ARCH=$(HEADER_ARCH) archheaders
>
> ..., which does not rely on the generated Makefile.
>
I forgot to add this:
Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
> arch/um/Makefile | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/um/Makefile b/arch/um/Makefile
> index e54dda8..de340e4 100644
> --- a/arch/um/Makefile
> +++ b/arch/um/Makefile
> @@ -122,8 +122,7 @@ archheaders:
> $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \
> kbuild-file=$(HOST_DIR)/include/uapi/asm/Kbuild \
> obj=$(HOST_DIR)/include/generated/uapi/asm
> - $(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders
> -
> + $(Q)$(MAKE) -f $(srctree)/Makefile ARCH=$(HEADER_ARCH) archheaders
>
> archprepare: include/generated/user_constants.h
>
> --
> 2.7.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] um: fix parallel building with O= option
2018-08-04 4:47 ` [PATCH 1/3] um: fix parallel building with O= option Masahiro Yamada
2018-08-04 4:51 ` Masahiro Yamada
@ 2018-09-15 18:47 ` Kees Cook
2018-09-18 4:01 ` Masahiro Yamada
1 sibling, 1 reply; 10+ messages in thread
From: Kees Cook @ 2018-09-15 18:47 UTC (permalink / raw)
To: Masahiro Yamada
Cc: Jeff Dike, Richard Weinberger, linux-um, Randy Dunlap,
Geert Uytterhoeven, Michal Marek, Sam Ravnborg, LKML
On Fri, Aug 3, 2018 at 9:47 PM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> Randy Dunlap reports UML occasionally fails to build with -j<N> and
> O=<builddir> options.
With v4.19-rc2 I'm still seeing a failure (for any parallelism) under ARCH=um
$ make -j8 ARCH=um O=/tmp/foo
...
/home/kees/src/linux-build/um/Makefile:1185: *** Headers not
exportable for the um architecture. Stop.
Am I missing something?
-Kees
--
Kees Cook
Pixel Security
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] um: fix parallel building with O= option
2018-09-15 18:47 ` Kees Cook
@ 2018-09-18 4:01 ` Masahiro Yamada
0 siblings, 0 replies; 10+ messages in thread
From: Masahiro Yamada @ 2018-09-18 4:01 UTC (permalink / raw)
To: Kees Cook
Cc: Jeff Dike, Richard Weinberger, linux-um, Randy Dunlap,
Geert Uytterhoeven, Michal Marek, Sam Ravnborg, LKML
Hi Kees,
2018-09-16 3:47 GMT+09:00 Kees Cook <keescook@chromium.org>:
> On Fri, Aug 3, 2018 at 9:47 PM, Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
>> Randy Dunlap reports UML occasionally fails to build with -j<N> and
>> O=<builddir> options.
>
> With v4.19-rc2 I'm still seeing a failure (for any parallelism) under ARCH=um
>
> $ make -j8 ARCH=um O=/tmp/foo
> ...
> /home/kees/src/linux-build/um/Makefile:1185: *** Headers not
> exportable for the um architecture. Stop.
>
> Am I missing something?
This is a different problem.
I sent a patch:
https://patchwork.kernel.org/patch/10603707/
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/3] kbuild: add %asm-generic to no-dot-config-targets
2018-08-04 4:47 [PATCH 0/3] Kbuild: fix and clean-up arch/um/Makefile Masahiro Yamada
2018-08-04 4:47 ` [PATCH 1/3] um: fix parallel building with O= option Masahiro Yamada
@ 2018-08-04 4:47 ` Masahiro Yamada
2018-08-04 4:47 ` [PATCH 3/3] um: clean up archheaders recipe Masahiro Yamada
` (2 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Masahiro Yamada @ 2018-08-04 4:47 UTC (permalink / raw)
To: linux-kbuild
Cc: Jeff Dike, Richard Weinberger, linux-um, Randy Dunlap,
Geert Uytterhoeven, Michal Marek, Sam Ravnborg, Masahiro Yamada,
linux-kernel
asm-generic and uapi-asm-generic do not depend on the kernel
configuration. In fact, uapi-asm-generic is the prerequisite of
headers_{install,check}, hence it should not require the .config file.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 85f3481..5cf87a18 100644
--- a/Makefile
+++ b/Makefile
@@ -224,7 +224,7 @@ clean-targets := %clean mrproper cleandocs
no-dot-config-targets := $(clean-targets) \
cscope gtags TAGS tags help% %docs check% coccicheck \
$(version_h) headers_% archheaders archscripts \
- kernelversion %src-pkg
+ %asm-generic kernelversion %src-pkg
config-targets := 0
mixed-targets := 0
--
2.7.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/3] um: clean up archheaders recipe
2018-08-04 4:47 [PATCH 0/3] Kbuild: fix and clean-up arch/um/Makefile Masahiro Yamada
2018-08-04 4:47 ` [PATCH 1/3] um: fix parallel building with O= option Masahiro Yamada
2018-08-04 4:47 ` [PATCH 2/3] kbuild: add %asm-generic to no-dot-config-targets Masahiro Yamada
@ 2018-08-04 4:47 ` Masahiro Yamada
2018-08-05 0:58 ` [PATCH 0/3] Kbuild: fix and clean-up arch/um/Makefile Randy Dunlap
2018-08-06 20:54 ` Richard Weinberger
4 siblings, 0 replies; 10+ messages in thread
From: Masahiro Yamada @ 2018-08-04 4:47 UTC (permalink / raw)
To: linux-kbuild
Cc: Jeff Dike, Richard Weinberger, linux-um, Randy Dunlap,
Geert Uytterhoeven, Michal Marek, Sam Ravnborg, Masahiro Yamada,
linux-kernel
Now that '%asm-generic' is added to no-dot-config-targets,
'make asm-generic' does not include the kernel configuration.
You can simply do 'make asm-generic' in the recursed top Makefile
without bothering syncconfig.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/um/Makefile | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/arch/um/Makefile b/arch/um/Makefile
index de340e4..1a47f9c 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -116,13 +116,7 @@ endef
KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig
archheaders:
- $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \
- kbuild-file=$(HOST_DIR)/include/asm/Kbuild \
- obj=$(HOST_DIR)/include/generated/asm
- $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \
- kbuild-file=$(HOST_DIR)/include/uapi/asm/Kbuild \
- obj=$(HOST_DIR)/include/generated/uapi/asm
- $(Q)$(MAKE) -f $(srctree)/Makefile ARCH=$(HEADER_ARCH) archheaders
+ $(Q)$(MAKE) -f $(srctree)/Makefile ARCH=$(HEADER_ARCH) asm-generic archheaders
archprepare: include/generated/user_constants.h
--
2.7.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 0/3] Kbuild: fix and clean-up arch/um/Makefile
2018-08-04 4:47 [PATCH 0/3] Kbuild: fix and clean-up arch/um/Makefile Masahiro Yamada
` (2 preceding siblings ...)
2018-08-04 4:47 ` [PATCH 3/3] um: clean up archheaders recipe Masahiro Yamada
@ 2018-08-05 0:58 ` Randy Dunlap
2018-08-06 20:54 ` Richard Weinberger
4 siblings, 0 replies; 10+ messages in thread
From: Randy Dunlap @ 2018-08-05 0:58 UTC (permalink / raw)
To: Masahiro Yamada, linux-kbuild
Cc: Jeff Dike, Richard Weinberger, linux-um, Geert Uytterhoeven,
Michal Marek, Sam Ravnborg, linux-kernel
On 08/03/2018 09:47 PM, Masahiro Yamada wrote:
> 1/3 fixes the build failure reported by Randy.
> (I may have seen a similar report before, but I cannot recall it.)
>
> 2/3 and 3/3 clean-up the Makefile a bit more.
>
> I'd like to apply this series to kbuild tree.
> Ack from UML folks are appreciated.
>
>
>
> Masahiro Yamada (3):
> um: fix parallel building with O= option
> kbuild: add %asm-generic to no-dot-config-targets
> um: clean up archheaders recipe
>
> Makefile | 2 +-
> arch/um/Makefile | 9 +--------
> 2 files changed, 2 insertions(+), 9 deletions(-)
>
for the series:
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Thanks.
--
~Randy
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/3] Kbuild: fix and clean-up arch/um/Makefile
2018-08-04 4:47 [PATCH 0/3] Kbuild: fix and clean-up arch/um/Makefile Masahiro Yamada
` (3 preceding siblings ...)
2018-08-05 0:58 ` [PATCH 0/3] Kbuild: fix and clean-up arch/um/Makefile Randy Dunlap
@ 2018-08-06 20:54 ` Richard Weinberger
2018-08-08 1:24 ` Masahiro Yamada
4 siblings, 1 reply; 10+ messages in thread
From: Richard Weinberger @ 2018-08-06 20:54 UTC (permalink / raw)
To: Masahiro Yamada
Cc: linux-kbuild, Jeff Dike, linux-um, Randy Dunlap,
Geert Uytterhoeven, Michal Marek, Sam Ravnborg, linux-kernel
Am Samstag, 4. August 2018, 06:47:00 CEST schrieb Masahiro Yamada:
>
> 1/3 fixes the build failure reported by Randy.
> (I may have seen a similar report before, but I cannot recall it.)
>
> 2/3 and 3/3 clean-up the Makefile a bit more.
>
> I'd like to apply this series to kbuild tree.
> Ack from UML folks are appreciated.
Nice to see this fixed, Masahiro! :-)
Acked-by: Richard Weinberger <richard@nod.at>
Thanks,
//richard
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/3] Kbuild: fix and clean-up arch/um/Makefile
2018-08-06 20:54 ` Richard Weinberger
@ 2018-08-08 1:24 ` Masahiro Yamada
0 siblings, 0 replies; 10+ messages in thread
From: Masahiro Yamada @ 2018-08-08 1:24 UTC (permalink / raw)
To: Richard Weinberger
Cc: Linux Kbuild mailing list, Jeff Dike, linux-um, Randy Dunlap,
Geert Uytterhoeven, Michal Marek, Sam Ravnborg,
Linux Kernel Mailing List
2018-08-07 5:54 GMT+09:00 Richard Weinberger <richard@nod.at>:
> Am Samstag, 4. August 2018, 06:47:00 CEST schrieb Masahiro Yamada:
>>
>> 1/3 fixes the build failure reported by Randy.
>> (I may have seen a similar report before, but I cannot recall it.)
>>
>> 2/3 and 3/3 clean-up the Makefile a bit more.
>>
>> I'd like to apply this series to kbuild tree.
>> Ack from UML folks are appreciated.
>
> Nice to see this fixed, Masahiro! :-)
>
> Acked-by: Richard Weinberger <richard@nod.at>
>
Applied to linux-kbuild.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 10+ messages in thread