* [PATCH v2 0/5] kbuild: Use relative paths if possible
@ 2014-05-09 12:52 Michal Marek
2014-05-09 12:52 ` [PATCH v2 1/5] firmware: Simplify directory creation Michal Marek
` (4 more replies)
0 siblings, 5 replies; 26+ messages in thread
From: Michal Marek @ 2014-05-09 12:52 UTC (permalink / raw)
To: linux-kbuild; +Cc: linux-kernel, Sam Ravnborg
Hi,
This series changes the Makefile to use relative paths for $(objtree),
always setting it to '.', and for $(srctree) setting either to '.' or
'..', when building in the source tree or a subdirectory thereof,
respectively. The goal is to make compiler messages and Oopses more
readable by avoiding the full path to the source/object directory.
Patch 2/5 is just an unrelated cleanup.
v1->v2: Fix the 'build' and 'source' symlinks in /lib/modules
Michal Marek (5):
firmware: Simplify directory creation
firmware: Use $(quote) in the Makefile
kbuild: Use relative path for $(objtree)
kbuild: Use relative path when building in the source tree
kbuild: Use relative path when building in a subdir of the source tree
Makefile | 18 ++++++++++++++----
firmware/Makefile | 34 +++++++---------------------------
scripts/Makefile.fwinst | 24 +++++++++++-------------
3 files changed, 32 insertions(+), 44 deletions(-)
--
1.8.4.5
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH v2 1/5] firmware: Simplify directory creation
2014-05-09 12:52 [PATCH v2 0/5] kbuild: Use relative paths if possible Michal Marek
@ 2014-05-09 12:52 ` Michal Marek
2014-05-09 16:51 ` Sam Ravnborg
2014-05-09 12:52 ` [PATCH v2 2/5] firmware: Use $(quote) in the Makefile Michal Marek
` (3 subsequent siblings)
4 siblings, 1 reply; 26+ messages in thread
From: Michal Marek @ 2014-05-09 12:52 UTC (permalink / raw)
To: linux-kbuild; +Cc: linux-kernel, Sam Ravnborg, David Woodhouse
When building the firmware blobs, use a simple loop to create
directories in $(objtree), like in Makefile.build. This simplifies the
rules and also makes it possible to set $(objtree) to '.' later. Before
this change, a dependency on $(objtree)/<dir> would be satisfied by
<dir> in $(srctree).
When installing the firmware blobs, call mkdir like in Makefile.modinst.
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
---
v1->v2: No changes.
firmware/Makefile | 30 +++++-------------------------
scripts/Makefile.fwinst | 24 +++++++++++-------------
2 files changed, 16 insertions(+), 38 deletions(-)
diff --git a/firmware/Makefile b/firmware/Makefile
index cbb09ce..6af62cf 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -138,12 +138,6 @@ fw-shipped-$(CONFIG_YAM) += yam/1200.bin yam/9600.bin
fw-shipped-all := $(fw-shipped-y) $(fw-shipped-m) $(fw-shipped-)
-# Directories which we _might_ need to create, so we have a rule for them.
-firmware-dirs := $(sort $(addprefix $(objtree)/$(obj)/,$(dir $(fw-external-y) $(fw-shipped-all))))
-
-quiet_cmd_mkdir = MKDIR $(patsubst $(objtree)/%,%,$@)
- cmd_mkdir = mkdir -p $@
-
quiet_cmd_ihex = IHEX $@
cmd_ihex = $(OBJCOPY) -Iihex -Obinary $< $@
@@ -184,21 +178,10 @@ wordsize_deps := $(wildcard include/config/64bit.h include/config/32bit.h \
include/config/superh32.h include/config/superh64.h \
include/config/x86_32.h include/config/x86_64.h)
-# Workaround for make < 3.81, where .SECONDEXPANSION doesn't work.
-# It'll end up depending on these targets, so make them a PHONY rule which
-# depends on _all_ the directories in $(firmware-dirs), and it'll work out OK.
-PHONY += $(objtree)/$$(%) $(objtree)/$(obj)/$$(%)
-$(objtree)/$$(%) $(objtree)/$(obj)/$$(%): $(firmware-dirs)
- @true
-
-# For the $$(dir %) trick, where we need % to be expanded first.
-.SECONDEXPANSION:
-
-$(patsubst %,$(obj)/%.gen.S, $(fw-shipped-y)): %: $(wordsize_deps) \
- | $(objtree)/$$(dir %)
+$(patsubst %,$(obj)/%.gen.S, $(fw-shipped-y)): %: $(wordsize_deps)
$(call cmd,fwbin,$(patsubst %.gen.S,%,$@))
$(patsubst %,$(obj)/%.gen.S, $(fw-external-y)): %: $(wordsize_deps) \
- include/config/extra/firmware/dir.h | $(objtree)/$$(dir %)
+ include/config/extra/firmware/dir.h
$(call cmd,fwbin,$(fwabs)/$(patsubst $(obj)/%.gen.S,%,$@))
# The .o files depend on the binaries directly; the .S files don't.
@@ -207,7 +190,7 @@ $(patsubst %,$(obj)/%.gen.o, $(fw-external-y)): $(obj)/%.gen.o: $(fwdir)/%
# .ihex is used just as a simple way to hold binary files in a source tree
# where binaries are frowned upon. They are directly converted with objcopy.
-$(obj)/%: $(obj)/%.ihex | $(objtree)/$(obj)/$$(dir %)
+$(obj)/%: $(obj)/%.ihex
$(call cmd,ihex)
# Don't depend on ihex2fw if we're installing and it already exists.
@@ -226,16 +209,13 @@ endif
# is actually meaningful, because the firmware has to be loaded in a certain
# order rather than as a single binary blob. Thus, we convert them into our
# more compact binary representation of ihex records (<linux/ihex.h>)
-$(obj)/%.fw: $(obj)/%.HEX $(ihex2fw_dep) | $(objtree)/$(obj)/$$(dir %)
+$(obj)/%.fw: $(obj)/%.HEX $(ihex2fw_dep)
$(call cmd,ihex2fw)
# .H16 is our own modified form of Intel HEX, with 16-bit length for records.
-$(obj)/%.fw: $(obj)/%.H16 $(ihex2fw_dep) | $(objtree)/$(obj)/$$(dir %)
+$(obj)/%.fw: $(obj)/%.H16 $(ihex2fw_dep)
$(call cmd,h16tofw)
-$(firmware-dirs):
- $(call cmd,mkdir)
-
obj-y += $(patsubst %,%.gen.o, $(fw-external-y))
obj-$(CONFIG_FIRMWARE_IN_KERNEL) += $(patsubst %,%.gen.o, $(fw-shipped-y))
diff --git a/scripts/Makefile.fwinst b/scripts/Makefile.fwinst
index 4d908d1..1a5639e 100644
--- a/scripts/Makefile.fwinst
+++ b/scripts/Makefile.fwinst
@@ -24,25 +24,23 @@ ifndef CONFIG_FIRMWARE_IN_KERNEL
mod-fw += $(fw-shipped-y)
endif
+ifneq ($(KBUILD_SRC),)
+# Create output directory if not already present
+_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
+
+firmware-dirs := $(sort $(addprefix $(objtree)/$(obj)/,$(dir $(fw-external-y) $(fw-shipped-all))))
+# Create directories for firmware in subdirectories
+_dummy := $(foreach d,$(firmware-dirs), $(shell [ -d $(d) ] || mkdir -p $(d)))
+endif
+
installed-mod-fw := $(addprefix $(INSTALL_FW_PATH)/,$(mod-fw))
installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all))
-installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/./
-
-# Workaround for make < 3.81, where .SECONDEXPANSION doesn't work.
-PHONY += $(INSTALL_FW_PATH)/$$(%) install-all-dirs
-$(INSTALL_FW_PATH)/$$(%): install-all-dirs
- @true
-install-all-dirs: $(installed-fw-dirs)
- @true
quiet_cmd_install = INSTALL $(subst $(srctree)/,,$@)
- cmd_install = $(INSTALL) -m0644 $< $@
-
-$(installed-fw-dirs):
- $(call cmd,mkdir)
+ cmd_install = mkdir -p $(@D); $(INSTALL) -m0644 $< $@
-$(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% | $(INSTALL_FW_PATH)/$$(dir %)
+$(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/%
$(call cmd,install)
PHONY += __fw_install __fw_modinst FORCE
--
1.8.4.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 2/5] firmware: Use $(quote) in the Makefile
2014-05-09 12:52 [PATCH v2 0/5] kbuild: Use relative paths if possible Michal Marek
2014-05-09 12:52 ` [PATCH v2 1/5] firmware: Simplify directory creation Michal Marek
@ 2014-05-09 12:52 ` Michal Marek
2014-05-09 12:52 ` [PATCH v2 3/5] kbuild: Use relative path for $(objtree) Michal Marek
` (2 subsequent siblings)
4 siblings, 0 replies; 26+ messages in thread
From: Michal Marek @ 2014-05-09 12:52 UTC (permalink / raw)
To: linux-kbuild; +Cc: linux-kernel, Sam Ravnborg, David Woodhouse
The literal " confuses syntax highlighting in vim.
Cc: David Woodhouse <dwmw2@infradead.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
---
v1->v2: No changes
firmware/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/firmware/Makefile b/firmware/Makefile
index 6af62cf..5747417 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -4,10 +4,10 @@
# Create $(fwabs) from $(CONFIG_EXTRA_FIRMWARE_DIR) -- if it doesn't have a
# leading /, it's relative to $(srctree).
-fwdir := $(subst ",,$(CONFIG_EXTRA_FIRMWARE_DIR))
+fwdir := $(subst $(quote),,$(CONFIG_EXTRA_FIRMWARE_DIR))
fwabs := $(addprefix $(srctree)/,$(filter-out /%,$(fwdir)))$(filter /%,$(fwdir))
-fw-external-y := $(subst ",,$(CONFIG_EXTRA_FIRMWARE))
+fw-external-y := $(subst $(quote),,$(CONFIG_EXTRA_FIRMWARE))
# There are three cases to care about:
# 1. Building kernel with CONFIG_FIRMWARE_IN_KERNEL=y -- $(fw-shipped-y) should
--
1.8.4.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 3/5] kbuild: Use relative path for $(objtree)
2014-05-09 12:52 [PATCH v2 0/5] kbuild: Use relative paths if possible Michal Marek
2014-05-09 12:52 ` [PATCH v2 1/5] firmware: Simplify directory creation Michal Marek
2014-05-09 12:52 ` [PATCH v2 2/5] firmware: Use $(quote) in the Makefile Michal Marek
@ 2014-05-09 12:52 ` Michal Marek
2014-06-04 9:03 ` Richard Weinberger
2014-05-09 12:52 ` [PATCH v2 4/5] kbuild: Use relative path when building in the source tree Michal Marek
2014-05-09 12:52 ` [PATCH v2 5/5] kbuild: Use relative path when building in a subdir of " Michal Marek
4 siblings, 1 reply; 26+ messages in thread
From: Michal Marek @ 2014-05-09 12:52 UTC (permalink / raw)
To: linux-kbuild; +Cc: linux-kernel, Sam Ravnborg
The main Makefile sets its working directory to the object tree and
never changes it again. Therefore, we can use '.' instead of the
absolute path. The only case where we need the absolute path is when
creating the 'build' symlink in /lib/modules.
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
---
v1->v2: Fix the 'build' symlink
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 60ccbfe..480503a 100644
--- a/Makefile
+++ b/Makefile
@@ -154,7 +154,7 @@ _all: modules
endif
srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR))
-objtree := $(CURDIR)
+objtree := .
src := $(srctree)
obj := $(objtree)
@@ -1057,7 +1057,7 @@ _modinst_:
@ln -s $(srctree) $(MODLIB)/source
@if [ ! $(objtree) -ef $(MODLIB)/build ]; then \
rm -f $(MODLIB)/build ; \
- ln -s $(objtree) $(MODLIB)/build ; \
+ ln -s $(CURDIR) $(MODLIB)/build ; \
fi
@cp -f $(objtree)/modules.order $(MODLIB)/
@cp -f $(objtree)/modules.builtin $(MODLIB)/
--
1.8.4.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 4/5] kbuild: Use relative path when building in the source tree
2014-05-09 12:52 [PATCH v2 0/5] kbuild: Use relative paths if possible Michal Marek
` (2 preceding siblings ...)
2014-05-09 12:52 ` [PATCH v2 3/5] kbuild: Use relative path for $(objtree) Michal Marek
@ 2014-05-09 12:52 ` Michal Marek
2014-05-09 12:52 ` [PATCH v2 5/5] kbuild: Use relative path when building in a subdir of " Michal Marek
4 siblings, 0 replies; 26+ messages in thread
From: Michal Marek @ 2014-05-09 12:52 UTC (permalink / raw)
To: linux-kbuild; +Cc: linux-kernel, Sam Ravnborg
When not using O=, $(srctree) refers to the same directory as
$(objtree), so we can set it to '.' as well. This makes the default
include path more compact and results in more readable messages from the
compiler. The only case where we need the absolute path is when creating
the 'source' symlink in /lib/modules.
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
---
v1->v2: Fix the 'source' symlink
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 480503a..4da1c4b 100644
--- a/Makefile
+++ b/Makefile
@@ -153,7 +153,7 @@ else
_all: modules
endif
-srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR))
+srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),.)
objtree := .
src := $(srctree)
obj := $(objtree)
@@ -1054,7 +1054,7 @@ _modinst_:
@rm -rf $(MODLIB)/kernel
@rm -f $(MODLIB)/source
@mkdir -p $(MODLIB)/kernel
- @ln -s $(srctree) $(MODLIB)/source
+ @ln -s `cd $(srctree) && /bin/pwd` $(MODLIB)/source
@if [ ! $(objtree) -ef $(MODLIB)/build ]; then \
rm -f $(MODLIB)/build ; \
ln -s $(CURDIR) $(MODLIB)/build ; \
--
1.8.4.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 5/5] kbuild: Use relative path when building in a subdir of the source tree
2014-05-09 12:52 [PATCH v2 0/5] kbuild: Use relative paths if possible Michal Marek
` (3 preceding siblings ...)
2014-05-09 12:52 ` [PATCH v2 4/5] kbuild: Use relative path when building in the source tree Michal Marek
@ 2014-05-09 12:52 ` Michal Marek
4 siblings, 0 replies; 26+ messages in thread
From: Michal Marek @ 2014-05-09 12:52 UTC (permalink / raw)
To: linux-kbuild; +Cc: linux-kernel, Sam Ravnborg
When doing make O=<subdir>, use '..' to refer to the source tree. This
allows for more readable compiler messages, and, more importantly, it
sets the VPATH to '..', so filenames in WARN_ON() etc. will be shorter.
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
---
v1->v2: No changes
Makefile | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 4da1c4b..9872c53 100644
--- a/Makefile
+++ b/Makefile
@@ -153,7 +153,17 @@ else
_all: modules
endif
-srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),.)
+ifeq ($(KBUILD_SRC),)
+ # building in the source tree
+ srctree := .
+else
+ ifeq ($(KBUILD_SRC)/,$(dir $(CURDIR)))
+ # building in a subdirectory of the source tree
+ srctree := ..
+ else
+ srctree := $(KBUILD_SRC)
+ endif
+endif
objtree := .
src := $(srctree)
obj := $(objtree)
--
1.8.4.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH v2 1/5] firmware: Simplify directory creation
2014-05-09 12:52 ` [PATCH v2 1/5] firmware: Simplify directory creation Michal Marek
@ 2014-05-09 16:51 ` Sam Ravnborg
2014-05-14 20:53 ` Michal Marek
0 siblings, 1 reply; 26+ messages in thread
From: Sam Ravnborg @ 2014-05-09 16:51 UTC (permalink / raw)
To: Michal Marek; +Cc: linux-kbuild, linux-kernel, David Woodhouse
On Fri, May 09, 2014 at 02:52:20PM +0200, Michal Marek wrote:
> When building the firmware blobs, use a simple loop to create
> directories in $(objtree), like in Makefile.build. This simplifies the
> rules and also makes it possible to set $(objtree) to '.' later. Before
> this change, a dependency on $(objtree)/<dir> would be satisfied by
> <dir> in $(srctree).
>
> When installing the firmware blobs, call mkdir like in Makefile.modinst.
>
> Cc: David Woodhouse <dwmw2@infradead.org>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Signed-off-by: Michal Marek <mmarek@suse.cz>
Looks good!
This time I spent a little time to actually look through the code - and it
end up being much simpler than before.
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Sam
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 1/5] firmware: Simplify directory creation
2014-05-09 16:51 ` Sam Ravnborg
@ 2014-05-14 20:53 ` Michal Marek
0 siblings, 0 replies; 26+ messages in thread
From: Michal Marek @ 2014-05-14 20:53 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: linux-kbuild, linux-kernel, David Woodhouse
Dne 9.5.2014 18:51, Sam Ravnborg napsal(a):
> On Fri, May 09, 2014 at 02:52:20PM +0200, Michal Marek wrote:
>> When building the firmware blobs, use a simple loop to create
>> directories in $(objtree), like in Makefile.build. This simplifies the
>> rules and also makes it possible to set $(objtree) to '.' later. Before
>> this change, a dependency on $(objtree)/<dir> would be satisfied by
>> <dir> in $(srctree).
>>
>> When installing the firmware blobs, call mkdir like in Makefile.modinst.
>>
>> Cc: David Woodhouse <dwmw2@infradead.org>
>> Cc: Sam Ravnborg <sam@ravnborg.org>
>> Signed-off-by: Michal Marek <mmarek@suse.cz>
> Looks good!
> This time I spent a little time to actually look through the code - and it
> end up being much simpler than before.
>
> Acked-by: Sam Ravnborg <sam@ravnborg.org>
Thanks. I merged the whole series to kbuild.git#kbuild.
Michal
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 3/5] kbuild: Use relative path for $(objtree)
2014-05-09 12:52 ` [PATCH v2 3/5] kbuild: Use relative path for $(objtree) Michal Marek
@ 2014-06-04 9:03 ` Richard Weinberger
2014-06-04 9:43 ` Michal Marek
0 siblings, 1 reply; 26+ messages in thread
From: Richard Weinberger @ 2014-06-04 9:03 UTC (permalink / raw)
To: Michal Marek; +Cc: linux-kbuild, LKML, Sam Ravnborg, rdunlap
On Fri, May 9, 2014 at 2:52 PM, Michal Marek <mmarek@suse.cz> wrote:
> The main Makefile sets its working directory to the object tree and
> never changes it again. Therefore, we can use '.' instead of the
> absolute path. The only case where we need the absolute path is when
> creating the 'build' symlink in /lib/modules.
>
> Acked-by: Sam Ravnborg <sam@ravnborg.org>
> Signed-off-by: Michal Marek <mmarek@suse.cz>
> ---
> v1->v2: Fix the 'build' symlink
>
> Makefile | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 60ccbfe..480503a 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -154,7 +154,7 @@ _all: modules
> endif
>
> srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR))
> -objtree := $(CURDIR)
> +objtree := .
> src := $(srctree)
> obj := $(objtree)
>
> @@ -1057,7 +1057,7 @@ _modinst_:
> @ln -s $(srctree) $(MODLIB)/source
> @if [ ! $(objtree) -ef $(MODLIB)/build ]; then \
> rm -f $(MODLIB)/build ; \
> - ln -s $(objtree) $(MODLIB)/build ; \
> + ln -s $(CURDIR) $(MODLIB)/build ; \
> fi
> @cp -f $(objtree)/modules.order $(MODLIB)/
> @cp -f $(objtree)/modules.builtin $(MODLIB)/
This commit breaks the of-of-tree build of UML.
CC arch/x86/um/user-offsets.s
/home/rw/linux-next/arch/x86/um/user-offsets.c:21:29: fatal error:
asm/syscalls_64.h: No such file or directory
compilation terminated.
make[2]: *** [arch/x86/um/user-offsets.s] Error 1
make[1]: *** [arch/x86/um/user-offsets.s] Error 2
make: *** [sub-make] Error 2
To reproduce run:
make defconfig ARCH=um O=/mnt/o && make linux ARCH=um O=/mnt/
If there is anything in UML which needs fixing, please tell. :-)
--
Thanks,
//richard
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 3/5] kbuild: Use relative path for $(objtree)
2014-06-04 9:03 ` Richard Weinberger
@ 2014-06-04 9:43 ` Michal Marek
2014-06-04 13:12 ` Michal Marek
0 siblings, 1 reply; 26+ messages in thread
From: Michal Marek @ 2014-06-04 9:43 UTC (permalink / raw)
To: Richard Weinberger; +Cc: linux-kbuild, LKML, Sam Ravnborg, rdunlap
On 2014-06-04 11:03, Richard Weinberger wrote:
> On Fri, May 9, 2014 at 2:52 PM, Michal Marek <mmarek@suse.cz> wrote:
>> The main Makefile sets its working directory to the object tree and
>> never changes it again. Therefore, we can use '.' instead of the
>> absolute path. The only case where we need the absolute path is when
>> creating the 'build' symlink in /lib/modules.
>>
>> Acked-by: Sam Ravnborg <sam@ravnborg.org>
>> Signed-off-by: Michal Marek <mmarek@suse.cz>
>> ---
>> v1->v2: Fix the 'build' symlink
>>
>> Makefile | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 60ccbfe..480503a 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -154,7 +154,7 @@ _all: modules
>> endif
>>
>> srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR))
>> -objtree := $(CURDIR)
>> +objtree := .
>> src := $(srctree)
>> obj := $(objtree)
>>
>> @@ -1057,7 +1057,7 @@ _modinst_:
>> @ln -s $(srctree) $(MODLIB)/source
>> @if [ ! $(objtree) -ef $(MODLIB)/build ]; then \
>> rm -f $(MODLIB)/build ; \
>> - ln -s $(objtree) $(MODLIB)/build ; \
>> + ln -s $(CURDIR) $(MODLIB)/build ; \
>> fi
>> @cp -f $(objtree)/modules.order $(MODLIB)/
>> @cp -f $(objtree)/modules.builtin $(MODLIB)/
>
> This commit breaks the of-of-tree build of UML.
>
> CC arch/x86/um/user-offsets.s
> /home/rw/linux-next/arch/x86/um/user-offsets.c:21:29: fatal error:
> asm/syscalls_64.h: No such file or directory
> compilation terminated.
> make[2]: *** [arch/x86/um/user-offsets.s] Error 1
> make[1]: *** [arch/x86/um/user-offsets.s] Error 2
> make: *** [sub-make] Error 2
>
> To reproduce run:
> make defconfig ARCH=um O=/mnt/o && make linux ARCH=um O=/mnt/
>
> If there is anything in UML which needs fixing, please tell. :-)
I'll have a look, thanks for the report.
Michal
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 3/5] kbuild: Use relative path for $(objtree)
2014-06-04 9:43 ` Michal Marek
@ 2014-06-04 13:12 ` Michal Marek
2014-06-05 15:56 ` Michal Marek
0 siblings, 1 reply; 26+ messages in thread
From: Michal Marek @ 2014-06-04 13:12 UTC (permalink / raw)
To: Richard Weinberger; +Cc: linux-kbuild, LKML, Sam Ravnborg, rdunlap
On 2014-06-04 11:43, Michal Marek wrote:
> On 2014-06-04 11:03, Richard Weinberger wrote:
>> On Fri, May 9, 2014 at 2:52 PM, Michal Marek <mmarek@suse.cz> wrote:
>>> The main Makefile sets its working directory to the object tree and
>>> never changes it again. Therefore, we can use '.' instead of the
>>> absolute path. The only case where we need the absolute path is when
>>> creating the 'build' symlink in /lib/modules.
>>>
>>> Acked-by: Sam Ravnborg <sam@ravnborg.org>
>>> Signed-off-by: Michal Marek <mmarek@suse.cz>
>>> ---
>>> v1->v2: Fix the 'build' symlink
>>>
>>> Makefile | 4 ++--
>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/Makefile b/Makefile
>>> index 60ccbfe..480503a 100644
>>> --- a/Makefile
>>> +++ b/Makefile
>>> @@ -154,7 +154,7 @@ _all: modules
>>> endif
>>>
>>> srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR))
>>> -objtree := $(CURDIR)
>>> +objtree := .
>>> src := $(srctree)
>>> obj := $(objtree)
>>>
>>> @@ -1057,7 +1057,7 @@ _modinst_:
>>> @ln -s $(srctree) $(MODLIB)/source
>>> @if [ ! $(objtree) -ef $(MODLIB)/build ]; then \
>>> rm -f $(MODLIB)/build ; \
>>> - ln -s $(objtree) $(MODLIB)/build ; \
>>> + ln -s $(CURDIR) $(MODLIB)/build ; \
>>> fi
>>> @cp -f $(objtree)/modules.order $(MODLIB)/
>>> @cp -f $(objtree)/modules.builtin $(MODLIB)/
>>
>> This commit breaks the of-of-tree build of UML.
>>
>> CC arch/x86/um/user-offsets.s
>> /home/rw/linux-next/arch/x86/um/user-offsets.c:21:29: fatal error:
>> asm/syscalls_64.h: No such file or directory
>> compilation terminated.
>> make[2]: *** [arch/x86/um/user-offsets.s] Error 1
>> make[1]: *** [arch/x86/um/user-offsets.s] Error 2
>> make: *** [sub-make] Error 2
>>
>> To reproduce run:
>> make defconfig ARCH=um O=/mnt/o && make linux ARCH=um O=/mnt/
>>
>> If there is anything in UML which needs fixing, please tell. :-)
>
> I'll have a look, thanks for the report.
Findings so far: For some reason, syscalls_32.h is generated in the
source tree (which is wrong) and syscalls_64.h is not generated at all.
Looking further.
Also, it looks like make O=/dir bzImage on x86_64 non-um has been broken
even before this commit. 'make all' works fine. Not sure if it is related.
Michal
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 3/5] kbuild: Use relative path for $(objtree)
2014-06-04 13:12 ` Michal Marek
@ 2014-06-05 15:56 ` Michal Marek
2014-06-09 21:12 ` Michal Marek
` (3 more replies)
0 siblings, 4 replies; 26+ messages in thread
From: Michal Marek @ 2014-06-05 15:56 UTC (permalink / raw)
To: Richard Weinberger; +Cc: linux-kbuild, LKML, Sam Ravnborg, rdunlap
On Wed, Jun 04, 2014 at 03:12:33PM +0200, Michal Marek wrote:
> On 2014-06-04 11:43, Michal Marek wrote:
> > On 2014-06-04 11:03, Richard Weinberger wrote:
> >> To reproduce run:
> >> make defconfig ARCH=um O=/mnt/o && make linux ARCH=um O=/mnt/
> >>
> >> If there is anything in UML which needs fixing, please tell. :-)
> >
> > I'll have a look, thanks for the report.
>
> Findings so far: For some reason, syscalls_32.h is generated in the
> source tree (which is wrong) and syscalls_64.h is not generated at all.
> Looking further.
Can you try the below patch? The same pattern is used in the rules for
tools/ and tools/% in the main Makefile, need to look into that as well.
But UML should work now.
Michal
>From d4bc590f8716f7dde6b7bca319097ac30a8cb0b4 Mon Sep 17 00:00:00 2001
From: Michal Marek <mmarek@suse.cz>
Date: Thu, 5 Jun 2014 17:44:44 +0200
Subject: [PATCH] um: Fix for relative objtree when generating x86 headers
In an O= build, rely on the generated Makefile to call the main Makefile
properly. When building in the source tree, we do not need to specify
the -C and O= either. This fixes the problem when $(objtree) is a
relative path and the -C changes the directory.
Reported-by: Richard Weinberger <richard.weinberger@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
---
arch/um/Makefile | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/um/Makefile b/arch/um/Makefile
index 36e658a..e4b1a96 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -111,8 +111,7 @@ endef
KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig
archheaders:
- $(Q)$(MAKE) -C '$(srctree)' KBUILD_SRC= \
- ARCH=$(HEADER_ARCH) O='$(objtree)' archheaders
+ $(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders
archprepare: include/generated/user_constants.h
--
1.8.4.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH v2 3/5] kbuild: Use relative path for $(objtree)
2014-06-05 15:56 ` Michal Marek
@ 2014-06-09 21:12 ` Michal Marek
2014-06-09 21:23 ` Randy Dunlap
` (2 subsequent siblings)
3 siblings, 0 replies; 26+ messages in thread
From: Michal Marek @ 2014-06-09 21:12 UTC (permalink / raw)
To: Richard Weinberger; +Cc: linux-kbuild, LKML, Sam Ravnborg, rdunlap
Dne 5.6.2014 17:56, Michal Marek napsal(a):
> From d4bc590f8716f7dde6b7bca319097ac30a8cb0b4 Mon Sep 17 00:00:00 2001
> From: Michal Marek <mmarek@suse.cz>
> Date: Thu, 5 Jun 2014 17:44:44 +0200
> Subject: [PATCH] um: Fix for relative objtree when generating x86 headers
Oops, this email got trapped in the mail queue on my machine. Can you
please check if the patch fixes your problem? I'd like to add it to the
kbuild branch and send it to Linus.
Thanks,
Michal
>
> In an O= build, rely on the generated Makefile to call the main Makefile
> properly. When building in the source tree, we do not need to specify
> the -C and O= either. This fixes the problem when $(objtree) is a
> relative path and the -C changes the directory.
>
> Reported-by: Richard Weinberger <richard.weinberger@gmail.com>
> Signed-off-by: Michal Marek <mmarek@suse.cz>
> ---
> arch/um/Makefile | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/um/Makefile b/arch/um/Makefile
> index 36e658a..e4b1a96 100644
> --- a/arch/um/Makefile
> +++ b/arch/um/Makefile
> @@ -111,8 +111,7 @@ endef
> KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig
>
> archheaders:
> - $(Q)$(MAKE) -C '$(srctree)' KBUILD_SRC= \
> - ARCH=$(HEADER_ARCH) O='$(objtree)' archheaders
> + $(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders
>
> archprepare: include/generated/user_constants.h
>
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 3/5] kbuild: Use relative path for $(objtree)
2014-06-05 15:56 ` Michal Marek
2014-06-09 21:12 ` Michal Marek
@ 2014-06-09 21:23 ` Randy Dunlap
2014-06-09 22:14 ` Michal Marek
2014-06-10 7:40 ` Geert Uytterhoeven
2017-10-16 10:26 ` Geert Uytterhoeven
3 siblings, 1 reply; 26+ messages in thread
From: Randy Dunlap @ 2014-06-09 21:23 UTC (permalink / raw)
To: Michal Marek, Richard Weinberger; +Cc: linux-kbuild, LKML, Sam Ravnborg
On 06/05/14 08:56, Michal Marek wrote:
> On Wed, Jun 04, 2014 at 03:12:33PM +0200, Michal Marek wrote:
>> On 2014-06-04 11:43, Michal Marek wrote:
>>> On 2014-06-04 11:03, Richard Weinberger wrote:
>>>> To reproduce run:
>>>> make defconfig ARCH=um O=/mnt/o && make linux ARCH=um O=/mnt/
>>>>
>>>> If there is anything in UML which needs fixing, please tell. :-)
>>>
>>> I'll have a look, thanks for the report.
>>
>> Findings so far: For some reason, syscalls_32.h is generated in the
>> source tree (which is wrong) and syscalls_64.h is not generated at all.
>> Looking further.
>
> Can you try the below patch? The same pattern is used in the rules for
> tools/ and tools/% in the main Makefile, need to look into that as well.
> But UML should work now.
>
> Michal
>
> From d4bc590f8716f7dde6b7bca319097ac30a8cb0b4 Mon Sep 17 00:00:00 2001
> From: Michal Marek <mmarek@suse.cz>
> Date: Thu, 5 Jun 2014 17:44:44 +0200
> Subject: [PATCH] um: Fix for relative objtree when generating x86 headers
>
> In an O= build, rely on the generated Makefile to call the main Makefile
> properly. When building in the source tree, we do not need to specify
> the -C and O= either. This fixes the problem when $(objtree) is a
> relative path and the -C changes the directory.
>
> Reported-by: Richard Weinberger <richard.weinberger@gmail.com>
> Signed-off-by: Michal Marek <mmarek@suse.cz>
> ---
> arch/um/Makefile | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/um/Makefile b/arch/um/Makefile
> index 36e658a..e4b1a96 100644
> --- a/arch/um/Makefile
> +++ b/arch/um/Makefile
> @@ -111,8 +111,7 @@ endef
> KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig
>
> archheaders:
> - $(Q)$(MAKE) -C '$(srctree)' KBUILD_SRC= \
> - ARCH=$(HEADER_ARCH) O='$(objtree)' archheaders
> + $(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders
>
> archprepare: include/generated/user_constants.h
>
>
I still get this build error when building uml for i386:
CC arch/x86/um/user-offsets.s
../arch/x86/um/user-offsets.c:14:29: fatal error: asm/syscalls_32.h: No such file or directory
compilation terminated.
make[2]: *** [arch/x86/um/user-offsets.s] Error 1
--
~Randy
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 3/5] kbuild: Use relative path for $(objtree)
2014-06-09 21:23 ` Randy Dunlap
@ 2014-06-09 22:14 ` Michal Marek
2014-06-09 22:24 ` Randy Dunlap
0 siblings, 1 reply; 26+ messages in thread
From: Michal Marek @ 2014-06-09 22:14 UTC (permalink / raw)
To: Randy Dunlap, Richard Weinberger; +Cc: linux-kbuild, LKML, Sam Ravnborg
Dne 9.6.2014 23:23, Randy Dunlap napsal(a):
> On 06/05/14 08:56, Michal Marek wrote:
>> On Wed, Jun 04, 2014 at 03:12:33PM +0200, Michal Marek wrote:
>>> On 2014-06-04 11:43, Michal Marek wrote:
>>>> On 2014-06-04 11:03, Richard Weinberger wrote:
>>>>> To reproduce run:
>>>>> make defconfig ARCH=um O=/mnt/o && make linux ARCH=um O=/mnt/
>>>>>
>>>>> If there is anything in UML which needs fixing, please tell. :-)
>>>>
>>>> I'll have a look, thanks for the report.
>>>
>>> Findings so far: For some reason, syscalls_32.h is generated in the
>>> source tree (which is wrong) and syscalls_64.h is not generated at all.
>>> Looking further.
>>
>> Can you try the below patch? The same pattern is used in the rules for
>> tools/ and tools/% in the main Makefile, need to look into that as well.
>> But UML should work now.
>>
>> Michal
>>
>> From d4bc590f8716f7dde6b7bca319097ac30a8cb0b4 Mon Sep 17 00:00:00 2001
>> From: Michal Marek <mmarek@suse.cz>
>> Date: Thu, 5 Jun 2014 17:44:44 +0200
>> Subject: [PATCH] um: Fix for relative objtree when generating x86 headers
>>
>> In an O= build, rely on the generated Makefile to call the main Makefile
>> properly. When building in the source tree, we do not need to specify
>> the -C and O= either. This fixes the problem when $(objtree) is a
>> relative path and the -C changes the directory.
>>
>> Reported-by: Richard Weinberger <richard.weinberger@gmail.com>
>> Signed-off-by: Michal Marek <mmarek@suse.cz>
>> ---
>> arch/um/Makefile | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/arch/um/Makefile b/arch/um/Makefile
>> index 36e658a..e4b1a96 100644
>> --- a/arch/um/Makefile
>> +++ b/arch/um/Makefile
>> @@ -111,8 +111,7 @@ endef
>> KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig
>>
>> archheaders:
>> - $(Q)$(MAKE) -C '$(srctree)' KBUILD_SRC= \
>> - ARCH=$(HEADER_ARCH) O='$(objtree)' archheaders
>> + $(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders
>>
>> archprepare: include/generated/user_constants.h
>>
>>
>
> I still get this build error when building uml for i386:
>
> CC arch/x86/um/user-offsets.s
> ../arch/x86/um/user-offsets.c:14:29: fatal error: asm/syscalls_32.h: No such file or directory
> compilation terminated.
> make[2]: *** [arch/x86/um/user-offsets.s] Error 1
Thanks for testing the patch. I cannot reproduce it though:
make ARCH=um SUBARCH=i386 O=/dev/shm/li defconfig
make ARCH=um SUBARCH=i386 O=/dev/shm/li
works fine (at least it gets to the point when it starts compiling the
actual kernel source). This is the previous kbuild/kbuild branch (commit
9da0763) with the above fix applied.
Also, you pointed out i386 -- Does it mean that the fix worked for you
on x86_64?
Thanks,
Michal
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 3/5] kbuild: Use relative path for $(objtree)
2014-06-09 22:14 ` Michal Marek
@ 2014-06-09 22:24 ` Randy Dunlap
2014-06-09 22:39 ` Michal Marek
0 siblings, 1 reply; 26+ messages in thread
From: Randy Dunlap @ 2014-06-09 22:24 UTC (permalink / raw)
To: Michal Marek, Richard Weinberger; +Cc: linux-kbuild, LKML, Sam Ravnborg
On 06/09/14 15:14, Michal Marek wrote:
> Dne 9.6.2014 23:23, Randy Dunlap napsal(a):
>> On 06/05/14 08:56, Michal Marek wrote:
>>> On Wed, Jun 04, 2014 at 03:12:33PM +0200, Michal Marek wrote:
>>>> On 2014-06-04 11:43, Michal Marek wrote:
>>>>> On 2014-06-04 11:03, Richard Weinberger wrote:
>>>>>> To reproduce run:
>>>>>> make defconfig ARCH=um O=/mnt/o && make linux ARCH=um O=/mnt/
>>>>>>
>>>>>> If there is anything in UML which needs fixing, please tell. :-)
>>>>>
>>>>> I'll have a look, thanks for the report.
>>>>
>>>> Findings so far: For some reason, syscalls_32.h is generated in the
>>>> source tree (which is wrong) and syscalls_64.h is not generated at all.
>>>> Looking further.
>>>
>>> Can you try the below patch? The same pattern is used in the rules for
>>> tools/ and tools/% in the main Makefile, need to look into that as well.
>>> But UML should work now.
>>>
>>> Michal
>>>
>>> From d4bc590f8716f7dde6b7bca319097ac30a8cb0b4 Mon Sep 17 00:00:00 2001
>>> From: Michal Marek <mmarek@suse.cz>
>>> Date: Thu, 5 Jun 2014 17:44:44 +0200
>>> Subject: [PATCH] um: Fix for relative objtree when generating x86 headers
>>>
>>> In an O= build, rely on the generated Makefile to call the main Makefile
>>> properly. When building in the source tree, we do not need to specify
>>> the -C and O= either. This fixes the problem when $(objtree) is a
>>> relative path and the -C changes the directory.
>>>
>>> Reported-by: Richard Weinberger <richard.weinberger@gmail.com>
>>> Signed-off-by: Michal Marek <mmarek@suse.cz>
>>> ---
>>> arch/um/Makefile | 3 +--
>>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>>
>>> diff --git a/arch/um/Makefile b/arch/um/Makefile
>>> index 36e658a..e4b1a96 100644
>>> --- a/arch/um/Makefile
>>> +++ b/arch/um/Makefile
>>> @@ -111,8 +111,7 @@ endef
>>> KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig
>>>
>>> archheaders:
>>> - $(Q)$(MAKE) -C '$(srctree)' KBUILD_SRC= \
>>> - ARCH=$(HEADER_ARCH) O='$(objtree)' archheaders
>>> + $(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders
>>>
>>> archprepare: include/generated/user_constants.h
>>>
>>>
>>
>> I still get this build error when building uml for i386:
>>
>> CC arch/x86/um/user-offsets.s
>> ../arch/x86/um/user-offsets.c:14:29: fatal error: asm/syscalls_32.h: No such file or directory
>> compilation terminated.
>> make[2]: *** [arch/x86/um/user-offsets.s] Error 1
>
> Thanks for testing the patch. I cannot reproduce it though:
>
> make ARCH=um SUBARCH=i386 O=/dev/shm/li defconfig
> make ARCH=um SUBARCH=i386 O=/dev/shm/li
That doesn't work for me either. Must be a difference somewhere else.
I am using linux-next of 20140606 (latest that I know of) with only your
recent patch applied to it.
> works fine (at least it gets to the point when it starts compiling the
> actual kernel source). This is the previous kbuild/kbuild branch (commit
> 9da0763) with the above fix applied.
>
> Also, you pointed out i386 -- Does it mean that the fix worked for you
> on x86_64?
Yes, it did work on x86_64 for some reason.
--
~Randy
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 3/5] kbuild: Use relative path for $(objtree)
2014-06-09 22:24 ` Randy Dunlap
@ 2014-06-09 22:39 ` Michal Marek
2014-06-09 23:47 ` Randy Dunlap
0 siblings, 1 reply; 26+ messages in thread
From: Michal Marek @ 2014-06-09 22:39 UTC (permalink / raw)
To: Randy Dunlap; +Cc: Richard Weinberger, linux-kbuild, LKML, Sam Ravnborg
On Mon, Jun 09, 2014 at 03:24:11PM -0700, Randy Dunlap wrote:
> On 06/09/14 15:14, Michal Marek wrote:
> > Dne 9.6.2014 23:23, Randy Dunlap napsal(a):
> >> On 06/05/14 08:56, Michal Marek wrote:
> >>> From d4bc590f8716f7dde6b7bca319097ac30a8cb0b4 Mon Sep 17 00:00:00 2001
> >>> From: Michal Marek <mmarek@suse.cz>
> >>> Date: Thu, 5 Jun 2014 17:44:44 +0200
> >>> Subject: [PATCH] um: Fix for relative objtree when generating x86 headers
> >>>
> >>> In an O= build, rely on the generated Makefile to call the main Makefile
> >>> properly. When building in the source tree, we do not need to specify
> >>> the -C and O= either. This fixes the problem when $(objtree) is a
> >>> relative path and the -C changes the directory.
> >>>
> >>> Reported-by: Richard Weinberger <richard.weinberger@gmail.com>
> >>> Signed-off-by: Michal Marek <mmarek@suse.cz>
> >>> ---
> >>> arch/um/Makefile | 3 +--
> >>> 1 file changed, 1 insertion(+), 2 deletions(-)
> >>>
> >>> diff --git a/arch/um/Makefile b/arch/um/Makefile
> >>> index 36e658a..e4b1a96 100644
> >>> --- a/arch/um/Makefile
> >>> +++ b/arch/um/Makefile
> >>> @@ -111,8 +111,7 @@ endef
> >>> KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig
> >>>
> >>> archheaders:
> >>> - $(Q)$(MAKE) -C '$(srctree)' KBUILD_SRC= \
> >>> - ARCH=$(HEADER_ARCH) O='$(objtree)' archheaders
> >>> + $(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders
> >>>
> >>> archprepare: include/generated/user_constants.h
> >>>
> >>>
> >>
> >> I still get this build error when building uml for i386:
> >>
> >> CC arch/x86/um/user-offsets.s
> >> ../arch/x86/um/user-offsets.c:14:29: fatal error: asm/syscalls_32.h: No such file or directory
> >> compilation terminated.
> >> make[2]: *** [arch/x86/um/user-offsets.s] Error 1
> >
> > Thanks for testing the patch. I cannot reproduce it though:
> >
> > make ARCH=um SUBARCH=i386 O=/dev/shm/li defconfig
> > make ARCH=um SUBARCH=i386 O=/dev/shm/li
>
> That doesn't work for me either. Must be a difference somewhere else.
> I am using linux-next of 20140606 (latest that I know of) with only your
> recent patch applied to it.
I checked out next-20140606 and added the fix on top:
$ git cherry-pick d4bc590f8716f7dde6b7bca319097ac30a8cb0b4
[test cfc8100] um: Fix for relative objtree when generating x86 headers
1 file changed, 1 insertion(+), 2 deletions(-)
$ git rev-parse HEAD^{tree}
8fad860b10c2abc86b1ca820a1b9f2a9267e669b
The resulting tree id should be identical to yours (the commit id
depends on time). It still works for me, however:
$ make mrproper
...
$ make ARCH=um SUBARCH=i386 O=/dev/shm/li defconfig
GEN ./Makefile
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
*** Default configuration is based on 'i386_defconfig'
#
# configuration written to .config
#
$ make ARCH=um SUBARCH=i386 O=/dev/shm/li
GEN ./Makefile
scripts/kconfig/conf --silentoldconfig arch/x86/um/Kconfig
CHK include/generated/uapi/linux/version.h
WRAP arch/um/include/generated/asm/scatterlist.h
SYSTBL arch/x86/syscalls/../include/generated/asm/syscalls_32.h
SYSHDR arch/x86/syscalls/../include/generated/uapi/asm/unistd_32.h
SYSHDR arch/x86/syscalls/../include/generated/uapi/asm/unistd_64.h
SYSHDR arch/x86/syscalls/../include/generated/uapi/asm/unistd_x32.h
CC arch/x86/um/user-offsets.s
CHK include/generated/user_constants.h
UPD include/generated/user_constants.h
CHK include/config/kernel.release
UPD include/config/kernel.release
Using /labs/mmarek/linux-2.6 as source for kernel
GEN ./Makefile
CHK include/generated/utsrelease.h
UPD include/generated/utsrelease.h
CC kernel/bounds.s
GEN include/generated/bounds.h
CC arch/um/kernel/asm-offsets.s
GEN include/generated/asm-offsets.h
CALL /labs/mmarek/linux-2.6/scripts/checksyscalls.sh
HOSTCC scripts/mod/mk_elfconfig
MKELF scripts/mod/elfconfig.h
CC scripts/mod/devicetable-offsets.s
GEN scripts/mod/devicetable-offsets.h
HOSTCC scripts/mod/file2alias.o
HOSTCC scripts/mod/modpost.o
HOSTCC scripts/mod/sumversion.o
HOSTLD scripts/mod/modpost
CC init/main.o
... and so on. Can you please post the whole make V=1 log leading to the
failure?
> > Also, you pointed out i386 -- Does it mean that the fix worked for you
> > on x86_64?
>
> Yes, it did work on x86_64 for some reason.
That's great. I will push the fix, since at least on scenario is confirmed to
work.
Thanks,
Michal
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 3/5] kbuild: Use relative path for $(objtree)
2014-06-09 22:39 ` Michal Marek
@ 2014-06-09 23:47 ` Randy Dunlap
2014-06-10 9:02 ` Michal Marek
0 siblings, 1 reply; 26+ messages in thread
From: Randy Dunlap @ 2014-06-09 23:47 UTC (permalink / raw)
To: Michal Marek; +Cc: Richard Weinberger, linux-kbuild, LKML, Sam Ravnborg
On 06/09/14 15:39, Michal Marek wrote:
> On Mon, Jun 09, 2014 at 03:24:11PM -0700, Randy Dunlap wrote:
>> On 06/09/14 15:14, Michal Marek wrote:
>>> Dne 9.6.2014 23:23, Randy Dunlap napsal(a):
>>>> On 06/05/14 08:56, Michal Marek wrote:
>>>>> From d4bc590f8716f7dde6b7bca319097ac30a8cb0b4 Mon Sep 17 00:00:00 2001
>>>>> From: Michal Marek <mmarek@suse.cz>
>>>>> Date: Thu, 5 Jun 2014 17:44:44 +0200
>>>>> Subject: [PATCH] um: Fix for relative objtree when generating x86 headers
>>>>>
>>>>> In an O= build, rely on the generated Makefile to call the main Makefile
>>>>> properly. When building in the source tree, we do not need to specify
>>>>> the -C and O= either. This fixes the problem when $(objtree) is a
>>>>> relative path and the -C changes the directory.
>>>>>
>>>>> Reported-by: Richard Weinberger <richard.weinberger@gmail.com>
>>>>> Signed-off-by: Michal Marek <mmarek@suse.cz>
>>>>> ---
>>>>> arch/um/Makefile | 3 +--
>>>>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>>>>
>>>>> diff --git a/arch/um/Makefile b/arch/um/Makefile
>>>>> index 36e658a..e4b1a96 100644
>>>>> --- a/arch/um/Makefile
>>>>> +++ b/arch/um/Makefile
>>>>> @@ -111,8 +111,7 @@ endef
>>>>> KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig
>>>>>
>>>>> archheaders:
>>>>> - $(Q)$(MAKE) -C '$(srctree)' KBUILD_SRC= \
>>>>> - ARCH=$(HEADER_ARCH) O='$(objtree)' archheaders
>>>>> + $(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders
>>>>>
>>>>> archprepare: include/generated/user_constants.h
>>>>>
>>>>>
>>>>
>>>> I still get this build error when building uml for i386:
>>>>
>>>> CC arch/x86/um/user-offsets.s
>>>> ../arch/x86/um/user-offsets.c:14:29: fatal error: asm/syscalls_32.h: No such file or directory
>>>> compilation terminated.
>>>> make[2]: *** [arch/x86/um/user-offsets.s] Error 1
>>>
>>> Thanks for testing the patch. I cannot reproduce it though:
>>>
>>> make ARCH=um SUBARCH=i386 O=/dev/shm/li defconfig
>>> make ARCH=um SUBARCH=i386 O=/dev/shm/li
>>
>> That doesn't work for me either. Must be a difference somewhere else.
>> I am using linux-next of 20140606 (latest that I know of) with only your
>> recent patch applied to it.
>
> I checked out next-20140606 and added the fix on top:
>
> $ git cherry-pick d4bc590f8716f7dde6b7bca319097ac30a8cb0b4
> [test cfc8100] um: Fix for relative objtree when generating x86 headers
> 1 file changed, 1 insertion(+), 2 deletions(-)
> $ git rev-parse HEAD^{tree}
> 8fad860b10c2abc86b1ca820a1b9f2a9267e669b
>
> The resulting tree id should be identical to yours (the commit id
> depends on time). It still works for me, however:
>
> $ make mrproper
> ...
> $ make ARCH=um SUBARCH=i386 O=/dev/shm/li defconfig
> GEN ./Makefile
> HOSTCC scripts/kconfig/zconf.tab.o
> HOSTLD scripts/kconfig/conf
> *** Default configuration is based on 'i386_defconfig'
> #
> # configuration written to .config
> #
> $ make ARCH=um SUBARCH=i386 O=/dev/shm/li
> GEN ./Makefile
> scripts/kconfig/conf --silentoldconfig arch/x86/um/Kconfig
> CHK include/generated/uapi/linux/version.h
> WRAP arch/um/include/generated/asm/scatterlist.h
> SYSTBL arch/x86/syscalls/../include/generated/asm/syscalls_32.h
> SYSHDR arch/x86/syscalls/../include/generated/uapi/asm/unistd_32.h
> SYSHDR arch/x86/syscalls/../include/generated/uapi/asm/unistd_64.h
> SYSHDR arch/x86/syscalls/../include/generated/uapi/asm/unistd_x32.h
> CC arch/x86/um/user-offsets.s
> CHK include/generated/user_constants.h
> UPD include/generated/user_constants.h
> CHK include/config/kernel.release
> UPD include/config/kernel.release
> Using /labs/mmarek/linux-2.6 as source for kernel
> GEN ./Makefile
> CHK include/generated/utsrelease.h
> UPD include/generated/utsrelease.h
> CC kernel/bounds.s
> GEN include/generated/bounds.h
> CC arch/um/kernel/asm-offsets.s
> GEN include/generated/asm-offsets.h
> CALL /labs/mmarek/linux-2.6/scripts/checksyscalls.sh
> HOSTCC scripts/mod/mk_elfconfig
> MKELF scripts/mod/elfconfig.h
> CC scripts/mod/devicetable-offsets.s
> GEN scripts/mod/devicetable-offsets.h
> HOSTCC scripts/mod/file2alias.o
> HOSTCC scripts/mod/modpost.o
> HOSTCC scripts/mod/sumversion.o
> HOSTLD scripts/mod/modpost
> CC init/main.o
>
> ... and so on. Can you please post the whole make V=1 log leading to the
> failure?
sure. I did mkdir /tmp/O then
make ARCH=um SUBARCH=i386 O=/tmp/O defconfig
make ARCH=um SUBARCH=i386 V=1 O=/tmp/O
make -C /tmp/O \
KBUILD_SRC=/local/lnx/next/linux-next-20140606 \
KBUILD_EXTMOD="" -f /local/lnx/next/linux-next-20140606/Makefile \
make -f /local/lnx/next/linux-next-20140606/Makefile silentoldconfig
make -f /local/lnx/next/linux-next-20140606/scripts/Makefile.build obj=scripts/basic
rm -f .tmp_quiet_recordmcount
ln -fsn /local/lnx/next/linux-next-20140606 source
/bin/sh /local/lnx/next/linux-next-20140606/scripts/mkmakefile \
/local/lnx/next/linux-next-20140606 . 3 15
GEN ./Makefile
mkdir -p include/linux include/config
make -f /local/lnx/next/linux-next-20140606/scripts/Makefile.build obj=scripts/kconfig silentoldconfig
mkdir -p include/generated
scripts/kconfig/conf --silentoldconfig arch/x86/um/Kconfig
set -e; : ' CHK include/generated/uapi/linux/version.h'; mkdir -p include/generated/uapi/linux/; (echo \#define LINUX_VERSION_CODE 200448; echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';) < /local/lnx/next/linux-next-20140606/Makefile > include/generated/uapi/linux/version.h.tmp; if [ -r include/generated/uapi/linux/version.h ] && cmp -s include/generated/uapi/linux/version.h include/generated/uapi/linux/version.h.tmp; then rm -f include/generated/uapi/linux/version.h.tmp; else : ' UPD include/generated/uapi/linux/version.h'; mv -f include/generated/uapi/linux/version.h.tmp include/generated/uapi/linux/version.h; fi
make -f /local/lnx/next/linux-next-20140606/scripts/Makefile.build obj=scripts/basic
(cat /dev/null; ) > scripts/basic/modules.order
rm -f .tmp_quiet_recordmcount
make -f /local/lnx/next/linux-next-20140606/scripts/Makefile.asm-generic \
src=asm obj=arch/um/include/generated/asm
echo "#include <asm-generic/barrier.h>" >arch/um/include/generated/asm/barrier.h
echo "#include <asm-generic/bug.h>" >arch/um/include/generated/asm/bug.h
echo "#include <asm-generic/clkdev.h>" >arch/um/include/generated/asm/clkdev.h
echo "#include <asm-generic/cputime.h>" >arch/um/include/generated/asm/cputime.h
echo "#include <asm-generic/current.h>" >arch/um/include/generated/asm/current.h
echo "#include <asm-generic/delay.h>" >arch/um/include/generated/asm/delay.h
echo "#include <asm-generic/device.h>" >arch/um/include/generated/asm/device.h
echo "#include <asm-generic/emergency-restart.h>" >arch/um/include/generated/asm/emergency-restart.h
echo "#include <asm-generic/exec.h>" >arch/um/include/generated/asm/exec.h
echo "#include <asm-generic/ftrace.h>" >arch/um/include/generated/asm/ftrace.h
echo "#include <asm-generic/futex.h>" >arch/um/include/generated/asm/futex.h
echo "#include <asm-generic/hardirq.h>" >arch/um/include/generated/asm/hardirq.h
echo "#include <asm-generic/hash.h>" >arch/um/include/generated/asm/hash.h
echo "#include <asm-generic/hw_irq.h>" >arch/um/include/generated/asm/hw_irq.h
echo "#include <asm-generic/io.h>" >arch/um/include/generated/asm/io.h
echo "#include <asm-generic/irq_regs.h>" >arch/um/include/generated/asm/irq_regs.h
echo "#include <asm-generic/kdebug.h>" >arch/um/include/generated/asm/kdebug.h
echo "#include <asm-generic/mcs_spinlock.h>" >arch/um/include/generated/asm/mcs_spinlock.h
echo "#include <asm-generic/mutex.h>" >arch/um/include/generated/asm/mutex.h
echo "#include <asm-generic/param.h>" >arch/um/include/generated/asm/param.h
echo "#include <asm-generic/pci.h>" >arch/um/include/generated/asm/pci.h
echo "#include <asm-generic/percpu.h>" >arch/um/include/generated/asm/percpu.h
echo "#include <asm-generic/preempt.h>" >arch/um/include/generated/asm/preempt.h
echo "#include <asm-generic/scatterlist.h>" >arch/um/include/generated/asm/scatterlist.h
echo "#include <asm-generic/sections.h>" >arch/um/include/generated/asm/sections.h
echo "#include <asm-generic/switch_to.h>" >arch/um/include/generated/asm/switch_to.h
echo "#include <asm-generic/topology.h>" >arch/um/include/generated/asm/topology.h
echo "#include <asm-generic/trace_clock.h>" >arch/um/include/generated/asm/trace_clock.h
echo "#include <asm-generic/xor.h>" >arch/um/include/generated/asm/xor.h
make -f /local/lnx/next/linux-next-20140606/scripts/Makefile.asm-generic \
src=uapi/asm obj=arch/um/include/generated/uapi/asm
make KBUILD_SRC= ARCH=x86 archheaders
make -C /local/lnx/next/linux-next-20140606 O=/tmp/O/. archheaders
make -C /tmp/O \
KBUILD_SRC=/local/lnx/next/linux-next-20140606 \
KBUILD_EXTMOD="" -f /local/lnx/next/linux-next-20140606/Makefile \
archheaders
make -f /local/lnx/next/linux-next-20140606/scripts/Makefile.build obj=arch/x86/syscalls all
make -f /local/lnx/next/linux-next-20140606/scripts/Makefile.build obj=scripts build_unifdef
gcc -Wp,-MD,scripts/.unifdef.d -Iscripts -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -I/local/lnx/next/linux-next-20140606/tools/include -o scripts/unifdef /local/lnx/next/linux-next-20140606/scripts/unifdef.c
make -f /local/lnx/next/linux-next-20140606/scripts/Makefile.build obj=arch/x86/um arch/x86/um/user-offsets.s
gcc -Wp,-MD,arch/x86/um/.user-offsets.s.d -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -Wno-maybe-uninitialized -m32 -funit-at-a-time -march=i686 -Wa,-mtune=generic32 -mpreferred-stack-boundary=2 -ffreestanding -D__arch_um__ -Dvmap=kernel_vmap -Din6addr_loopback=kernel_in6addr_loopback -Din6addr_any=kernel_in6addr_any -Dstrrchr=kernel_strrchr -D_LARGEFILE64_SOURCE -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -DCC_HAVE_ASM_GOTO -I/local/lnx/next/linux-next-20140606/arch/um/include/shared -I/local/lnx/next/linux-next-20140606/arch/x86/um/shared -I/local/lnx/next/linux-next-20140606/arch/um/include/shared/skas -D_FILE_OFFSET_BITS=64 -idira
fter include -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -Iarch/x86/include/generated -fverbose-asm -S -o arch/x86/um/user-offsets.s /local/lnx/next/linux-next-20140606/arch/x86/um/user-offsets.c
/local/lnx/next/linux-next-20140606/arch/x86/um/user-offsets.c:14:29: fatal error: asm/syscalls_32.h: No such file or directory
compilation terminated.
make[2]: *** [arch/x86/um/user-offsets.s] Error 1
make[1]: *** [arch/x86/um/user-offsets.s] Error 2
make: *** [sub-make] Error 2
>
>>> Also, you pointed out i386 -- Does it mean that the fix worked for you
>>> on x86_64?
>>
>> Yes, it did work on x86_64 for some reason.
>
> That's great. I will push the fix, since at least on scenario is confirmed to
> work.
--
~Randy
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 3/5] kbuild: Use relative path for $(objtree)
2014-06-05 15:56 ` Michal Marek
2014-06-09 21:12 ` Michal Marek
2014-06-09 21:23 ` Randy Dunlap
@ 2014-06-10 7:40 ` Geert Uytterhoeven
2014-06-10 8:17 ` Michal Marek
2017-10-16 10:26 ` Geert Uytterhoeven
3 siblings, 1 reply; 26+ messages in thread
From: Geert Uytterhoeven @ 2014-06-10 7:40 UTC (permalink / raw)
To: Michal Marek
Cc: Richard Weinberger, linux-kbuild, LKML, Sam Ravnborg, Randy Dunlap
Hi Michael,
On Thu, Jun 5, 2014 at 5:56 PM, Michal Marek <mmarek@suse.cz> wrote:
> --- a/arch/um/Makefile
> +++ b/arch/um/Makefile
> @@ -111,8 +111,7 @@ endef
> KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig
>
> archheaders:
> - $(Q)$(MAKE) -C '$(srctree)' KBUILD_SRC= \
> - ARCH=$(HEADER_ARCH) O='$(objtree)' archheaders
> + $(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders
Should the logic in https://lkml.org/lkml/2014/6/1/17 be changed as well?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 3/5] kbuild: Use relative path for $(objtree)
2014-06-10 7:40 ` Geert Uytterhoeven
@ 2014-06-10 8:17 ` Michal Marek
0 siblings, 0 replies; 26+ messages in thread
From: Michal Marek @ 2014-06-10 8:17 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Richard Weinberger, linux-kbuild, LKML, Sam Ravnborg, Randy Dunlap
On 2014-06-10 09:40, Geert Uytterhoeven wrote:
> Hi Michael,
>
> On Thu, Jun 5, 2014 at 5:56 PM, Michal Marek <mmarek@suse.cz> wrote:
>> --- a/arch/um/Makefile
>> +++ b/arch/um/Makefile
>> @@ -111,8 +111,7 @@ endef
>> KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig
>>
>> archheaders:
>> - $(Q)$(MAKE) -C '$(srctree)' KBUILD_SRC= \
>> - ARCH=$(HEADER_ARCH) O='$(objtree)' archheaders
>> + $(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders
>
> Should the logic in https://lkml.org/lkml/2014/6/1/17 be changed as well?
I haven't tried it, but I don't see a problem with the added make
invocations:
+ $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \
+ SRCARCH=$(HEADER_ARCH) src=asm \
+ obj=arch/$(HEADER_ARCH)/include/generated/asm
+ $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \
+ SRCARCH=$(HEADER_ARCH) src=uapi/asm \
+ obj=arch/$(HEADER_ARCH)/include/generated/uapi/asm
The problem with the first make was the directory change (-C ...), which
broke the relative paths. These two just spawn another make in the
current directory, so it should be fine.
Michal
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 3/5] kbuild: Use relative path for $(objtree)
2014-06-09 23:47 ` Randy Dunlap
@ 2014-06-10 9:02 ` Michal Marek
2014-06-10 14:09 ` Randy Dunlap
0 siblings, 1 reply; 26+ messages in thread
From: Michal Marek @ 2014-06-10 9:02 UTC (permalink / raw)
To: Randy Dunlap; +Cc: Richard Weinberger, linux-kbuild, LKML, Sam Ravnborg
On 2014-06-10 01:47, Randy Dunlap wrote:
> sure. I did mkdir /tmp/O then
> make ARCH=um SUBARCH=i386 O=/tmp/O defconfig
> make ARCH=um SUBARCH=i386 V=1 O=/tmp/O
So I tried with the exact same paths and it worked for me:
$ mkdir -p /local/lnx/next/linux-next-20140606
$ git archive d4bc590f8716f7dde6b7bca319097ac30a8cb0b4 | tar xf - -C
/local/lnx/next/linux-next-20140606/
$ cd /local/lnx/next/linux-next-20140606/
$ make ARCH=um SUBARCH=i386 O=/tmp/O defconfig
$ make ARCH=um SUBARCH=i386 V=1 O=/tmp/O
and it worked.
> make KBUILD_SRC= ARCH=x86 archheaders
> make -C /local/lnx/next/linux-next-20140606 O=/tmp/O/. archheaders
> make -C /tmp/O \
> KBUILD_SRC=/local/lnx/next/linux-next-20140606 \
> KBUILD_EXTMOD="" -f /local/lnx/next/linux-next-20140606/Makefile \
> archheaders
> make -f /local/lnx/next/linux-next-20140606/scripts/Makefile.build obj=arch/x86/syscalls all
Here, it should do
/bin/sh
'/local/lnx/next/linux-next-20140606/arch/x86/syscalls/syscallhdr.sh'
'/local/lnx/next/linux-next-20140606/arch/x86/syscalls/syscall_32.tbl'
'arch/x86/syscalls/../include/generated/uapi/asm/unistd_32.h' 'i386' '' ''
/bin/sh
'/local/lnx/next/linux-next-20140606/arch/x86/syscalls/syscallhdr.sh'
'/local/lnx/next/linux-next-20140606/arch/x86/syscalls/syscall_64.tbl'
'arch/x86/syscalls/../include/generated/uapi/asm/unistd_64.h'
'common,64' '' ''
/bin/sh
'/local/lnx/next/linux-next-20140606/arch/x86/syscalls/syscallhdr.sh'
'/local/lnx/next/linux-next-20140606/arch/x86/syscalls/syscall_64.tbl'
'arch/x86/syscalls/../include/generated/uapi/asm/unistd_x32.h'
'common,x32' '' '__X32_SYSCALL_BIT'
/bin/sh
'/local/lnx/next/linux-next-20140606/arch/x86/syscalls/syscalltbl.sh'
/local/lnx/next/linux-next-20140606/arch/x86/syscalls/syscall_32.tbl
arch/x86/syscalls/../include/generated/asm/syscalls_32.h
which is not happening in your case for some reason. Can you please
check if you have some stale files in include/generated in the *source*
tree?
git ls-file -o --directory
It could be that there is some include/generated directory from a
previous in-tree build.
Michal
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 3/5] kbuild: Use relative path for $(objtree)
2014-06-10 9:02 ` Michal Marek
@ 2014-06-10 14:09 ` Randy Dunlap
2014-06-10 14:30 ` Michal Marek
0 siblings, 1 reply; 26+ messages in thread
From: Randy Dunlap @ 2014-06-10 14:09 UTC (permalink / raw)
To: Michal Marek; +Cc: Richard Weinberger, linux-kbuild, LKML, Sam Ravnborg
On 06/10/14 02:02, Michal Marek wrote:
> On 2014-06-10 01:47, Randy Dunlap wrote:
>> sure. I did mkdir /tmp/O then
>> make ARCH=um SUBARCH=i386 O=/tmp/O defconfig
>> make ARCH=um SUBARCH=i386 V=1 O=/tmp/O
>
> So I tried with the exact same paths and it worked for me:
> $ mkdir -p /local/lnx/next/linux-next-20140606
> $ git archive d4bc590f8716f7dde6b7bca319097ac30a8cb0b4 | tar xf - -C
> /local/lnx/next/linux-next-20140606/
> $ cd /local/lnx/next/linux-next-20140606/
> $ make ARCH=um SUBARCH=i386 O=/tmp/O defconfig
> $ make ARCH=um SUBARCH=i386 V=1 O=/tmp/O
>
> and it worked.
>
>
>> make KBUILD_SRC= ARCH=x86 archheaders
>> make -C /local/lnx/next/linux-next-20140606 O=/tmp/O/. archheaders
>> make -C /tmp/O \
>> KBUILD_SRC=/local/lnx/next/linux-next-20140606 \
>> KBUILD_EXTMOD="" -f /local/lnx/next/linux-next-20140606/Makefile \
>> archheaders
>> make -f /local/lnx/next/linux-next-20140606/scripts/Makefile.build obj=arch/x86/syscalls all
>
> Here, it should do
>
> /bin/sh
> '/local/lnx/next/linux-next-20140606/arch/x86/syscalls/syscallhdr.sh'
> '/local/lnx/next/linux-next-20140606/arch/x86/syscalls/syscall_32.tbl'
> 'arch/x86/syscalls/../include/generated/uapi/asm/unistd_32.h' 'i386' '' ''
> /bin/sh
> '/local/lnx/next/linux-next-20140606/arch/x86/syscalls/syscallhdr.sh'
> '/local/lnx/next/linux-next-20140606/arch/x86/syscalls/syscall_64.tbl'
> 'arch/x86/syscalls/../include/generated/uapi/asm/unistd_64.h'
> 'common,64' '' ''
> /bin/sh
> '/local/lnx/next/linux-next-20140606/arch/x86/syscalls/syscallhdr.sh'
> '/local/lnx/next/linux-next-20140606/arch/x86/syscalls/syscall_64.tbl'
> 'arch/x86/syscalls/../include/generated/uapi/asm/unistd_x32.h'
> 'common,x32' '' '__X32_SYSCALL_BIT'
> /bin/sh
> '/local/lnx/next/linux-next-20140606/arch/x86/syscalls/syscalltbl.sh'
> /local/lnx/next/linux-next-20140606/arch/x86/syscalls/syscall_32.tbl
> arch/x86/syscalls/../include/generated/asm/syscalls_32.h
>
> which is not happening in your case for some reason. Can you please
> check if you have some stale files in include/generated in the *source*
> tree?
>
> git ls-file -o --directory
I'm not using git, just tarballs. I don't have an include/generated
subdirectory at all in my source tree.
However, today's linux-next builds OK for me (both i386 and x86_64),
so let's go with your patch.
> It could be that there is some include/generated directory from a
> previous in-tree build.
--
~Randy
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 3/5] kbuild: Use relative path for $(objtree)
2014-06-10 14:09 ` Randy Dunlap
@ 2014-06-10 14:30 ` Michal Marek
0 siblings, 0 replies; 26+ messages in thread
From: Michal Marek @ 2014-06-10 14:30 UTC (permalink / raw)
To: Randy Dunlap; +Cc: Richard Weinberger, linux-kbuild, LKML, Sam Ravnborg
On 2014-06-10 16:09, Randy Dunlap wrote:
> I'm not using git, just tarballs. I don't have an include/generated
> subdirectory at all in my source tree.
>
> However, today's linux-next builds OK for me (both i386 and x86_64),
> so let's go with your patch.
OK, then let's hope this does not reoccur.
Michal
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 3/5] kbuild: Use relative path for $(objtree)
2014-06-05 15:56 ` Michal Marek
` (2 preceding siblings ...)
2014-06-10 7:40 ` Geert Uytterhoeven
@ 2017-10-16 10:26 ` Geert Uytterhoeven
2017-10-16 10:28 ` Geert Uytterhoeven
2017-10-25 12:21 ` Masahiro Yamada
3 siblings, 2 replies; 26+ messages in thread
From: Geert Uytterhoeven @ 2017-10-16 10:26 UTC (permalink / raw)
To: Michal Marek
Cc: Richard Weinberger, linux-kbuild, LKML, Sam Ravnborg, Randy Dunlap
Hi Michal,
On Thu, Jun 5, 2014 at 5:56 PM, Michal Marek <mmarek@suse.cz> wrote:
> On Wed, Jun 04, 2014 at 03:12:33PM +0200, Michal Marek wrote:
>> On 2014-06-04 11:43, Michal Marek wrote:
>> > On 2014-06-04 11:03, Richard Weinberger wrote:
>> >> To reproduce run:
>> >> make defconfig ARCH=um O=/mnt/o && make linux ARCH=um O=/mnt/
>> >>
>> >> If there is anything in UML which needs fixing, please tell. :-)
>> >
>> > I'll have a look, thanks for the report.
>>
>> Findings so far: For some reason, syscalls_32.h is generated in the
>> source tree (which is wrong) and syscalls_64.h is not generated at all.
>> Looking further.
>
> Can you try the below patch? The same pattern is used in the rules for
> tools/ and tools/% in the main Makefile, need to look into that as well.
> But UML should work now.
>
> Michal
>
> From d4bc590f8716f7dde6b7bca319097ac30a8cb0b4 Mon Sep 17 00:00:00 2001
> From: Michal Marek <mmarek@suse.cz>
> Date: Thu, 5 Jun 2014 17:44:44 +0200
> Subject: [PATCH] um: Fix for relative objtree when generating x86 headers
>
> In an O= build, rely on the generated Makefile to call the main Makefile
> properly. When building in the source tree, we do not need to specify
> the -C and O= either. This fixes the problem when $(objtree) is a
> relative path and the -C changes the directory.
>
> Reported-by: Richard Weinberger <richard.weinberger@gmail.com>
> Signed-off-by: Michal Marek <mmarek@suse.cz>
> ---
> arch/um/Makefile | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/um/Makefile b/arch/um/Makefile
> index 36e658a..e4b1a96 100644
> --- a/arch/um/Makefile
> +++ b/arch/um/Makefile
> @@ -111,8 +111,7 @@ endef
> KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig
>
> archheaders:
> - $(Q)$(MAKE) -C '$(srctree)' KBUILD_SRC= \
> - ARCH=$(HEADER_ARCH) O='$(objtree)' archheaders
> + $(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders
>
> archprepare: include/generated/user_constants.h
This now commit d4bc590f8716f7dd ("um: Fix for relative objtree when
generating x86 headers").
When using O=, the build enters an infinite loop on v4.14-rc5.
With V=1:
make KBUILD_SRC= ARCH=x86 archheaders
make -C /scratch/geert/linux/linux
O=/scratch/geert/build/linux-uml-amd64/. archheaders
make -C /scratch/geert/build/linux-uml-amd64
KBUILD_SRC=/scratch/geert/linux/linux \
-f /scratch/geert/linux/linux/Makefile archheaders
make KBUILD_SRC= ARCH=x86 archheaders
make -C /scratch/geert/linux/linux
O=/scratch/geert/build/linux-uml-amd64/. archheaders
make -C /scratch/geert/build/linux-uml-amd64
KBUILD_SRC=/scratch/geert/linux/linux \
-f /scratch/geert/linux/linux/Makefile archheaders
...
As it's been a (long) while I buily UML, I started a bisect, which pointed to
the commit above.
The problem actually already happened on commit d4bc590f8716f7dd, so this
has been broken since v3.16:
make KBUILD_SRC= ARCH=x86 archheaders
make -C /scratch/geert/linux/linux
O=/scratch/geert/build/linux-uml-amd64/. archheaders
make -C /scratch/geert/build/linux-uml-amd64 \
KBUILD_SRC=/scratch/geert/linux/linux \
KBUILD_EXTMOD="" -f /scratch/geert/linux/linux/Makefile \
archheaders
make KBUILD_SRC= ARCH=x86 archheaders
make -C /scratch/geert/linux/linux
O=/scratch/geert/build/linux-uml-amd64/. archheaders
make -C /scratch/geert/build/linux-uml-amd64 \
KBUILD_SRC=/scratch/geert/linux/linux \
KBUILD_EXTMOD="" -f /scratch/geert/linux/linux/Makefile \
archheaders
...
Unfortunately reverting that commit doesn't help, as that causes the
failure that
commit was supposed to fix:
/scratch/geert/linux/linux/arch/x86/um/user-offsets.c:19:29: fatal
error: asm/syscalls_64.h: No such file or directory
#include <asm/syscalls_64.h>
^
compilation terminated.
/scratch/geert/linux/linux/scripts/Makefile.build:154: recipe for
target 'arch/x86/um/user-offsets.s' failed
Do you have any clue? Thanks!
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 3/5] kbuild: Use relative path for $(objtree)
2017-10-16 10:26 ` Geert Uytterhoeven
@ 2017-10-16 10:28 ` Geert Uytterhoeven
2017-10-25 12:21 ` Masahiro Yamada
1 sibling, 0 replies; 26+ messages in thread
From: Geert Uytterhoeven @ 2017-10-16 10:28 UTC (permalink / raw)
To: Michal Marek
Cc: Richard Weinberger, linux-kbuild, LKML, Sam Ravnborg, Randy Dunlap
Hi Michal,
(new SuSE address)
On Mon, Oct 16, 2017 at 12:26 PM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> On Thu, Jun 5, 2014 at 5:56 PM, Michal Marek <mmarek@suse.cz> wrote:
>> On Wed, Jun 04, 2014 at 03:12:33PM +0200, Michal Marek wrote:
>>> On 2014-06-04 11:43, Michal Marek wrote:
>>> > On 2014-06-04 11:03, Richard Weinberger wrote:
>>> >> To reproduce run:
>>> >> make defconfig ARCH=um O=/mnt/o && make linux ARCH=um O=/mnt/
>>> >>
>>> >> If there is anything in UML which needs fixing, please tell. :-)
>>> >
>>> > I'll have a look, thanks for the report.
>>>
>>> Findings so far: For some reason, syscalls_32.h is generated in the
>>> source tree (which is wrong) and syscalls_64.h is not generated at all.
>>> Looking further.
>>
>> Can you try the below patch? The same pattern is used in the rules for
>> tools/ and tools/% in the main Makefile, need to look into that as well.
>> But UML should work now.
>>
>> Michal
>>
>> From d4bc590f8716f7dde6b7bca319097ac30a8cb0b4 Mon Sep 17 00:00:00 2001
>> From: Michal Marek <mmarek@suse.cz>
>> Date: Thu, 5 Jun 2014 17:44:44 +0200
>> Subject: [PATCH] um: Fix for relative objtree when generating x86 headers
>>
>> In an O= build, rely on the generated Makefile to call the main Makefile
>> properly. When building in the source tree, we do not need to specify
>> the -C and O= either. This fixes the problem when $(objtree) is a
>> relative path and the -C changes the directory.
>>
>> Reported-by: Richard Weinberger <richard.weinberger@gmail.com>
>> Signed-off-by: Michal Marek <mmarek@suse.cz>
>> ---
>> arch/um/Makefile | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/arch/um/Makefile b/arch/um/Makefile
>> index 36e658a..e4b1a96 100644
>> --- a/arch/um/Makefile
>> +++ b/arch/um/Makefile
>> @@ -111,8 +111,7 @@ endef
>> KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig
>>
>> archheaders:
>> - $(Q)$(MAKE) -C '$(srctree)' KBUILD_SRC= \
>> - ARCH=$(HEADER_ARCH) O='$(objtree)' archheaders
>> + $(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders
>>
>> archprepare: include/generated/user_constants.h
>
> This now commit d4bc590f8716f7dd ("um: Fix for relative objtree when
> generating x86 headers").
>
> When using O=, the build enters an infinite loop on v4.14-rc5.
> With V=1:
>
> make KBUILD_SRC= ARCH=x86 archheaders
> make -C /scratch/geert/linux/linux
> O=/scratch/geert/build/linux-uml-amd64/. archheaders
> make -C /scratch/geert/build/linux-uml-amd64
> KBUILD_SRC=/scratch/geert/linux/linux \
> -f /scratch/geert/linux/linux/Makefile archheaders
> make KBUILD_SRC= ARCH=x86 archheaders
> make -C /scratch/geert/linux/linux
> O=/scratch/geert/build/linux-uml-amd64/. archheaders
> make -C /scratch/geert/build/linux-uml-amd64
> KBUILD_SRC=/scratch/geert/linux/linux \
> -f /scratch/geert/linux/linux/Makefile archheaders
> ...
>
> As it's been a (long) while I buily UML, I started a bisect, which pointed to
> the commit above.
> The problem actually already happened on commit d4bc590f8716f7dd, so this
> has been broken since v3.16:
>
> make KBUILD_SRC= ARCH=x86 archheaders
> make -C /scratch/geert/linux/linux
> O=/scratch/geert/build/linux-uml-amd64/. archheaders
> make -C /scratch/geert/build/linux-uml-amd64 \
> KBUILD_SRC=/scratch/geert/linux/linux \
> KBUILD_EXTMOD="" -f /scratch/geert/linux/linux/Makefile \
> archheaders
> make KBUILD_SRC= ARCH=x86 archheaders
> make -C /scratch/geert/linux/linux
> O=/scratch/geert/build/linux-uml-amd64/. archheaders
> make -C /scratch/geert/build/linux-uml-amd64 \
> KBUILD_SRC=/scratch/geert/linux/linux \
> KBUILD_EXTMOD="" -f /scratch/geert/linux/linux/Makefile \
> archheaders
> ...
>
> Unfortunately reverting that commit doesn't help, as that causes the
> failure that
> commit was supposed to fix:
>
> /scratch/geert/linux/linux/arch/x86/um/user-offsets.c:19:29: fatal
> error: asm/syscalls_64.h: No such file or directory
> #include <asm/syscalls_64.h>
> ^
> compilation terminated.
> /scratch/geert/linux/linux/scripts/Makefile.build:154: recipe for
> target 'arch/x86/um/user-offsets.s' failed
>
> Do you have any clue? Thanks!
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 3/5] kbuild: Use relative path for $(objtree)
2017-10-16 10:26 ` Geert Uytterhoeven
2017-10-16 10:28 ` Geert Uytterhoeven
@ 2017-10-25 12:21 ` Masahiro Yamada
1 sibling, 0 replies; 26+ messages in thread
From: Masahiro Yamada @ 2017-10-25 12:21 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Richard Weinberger, linux-kbuild, LKML, Sam Ravnborg,
Randy Dunlap, Michal Marek
Hi Geert,
(+CC Michal's new address)
2017-10-16 19:26 GMT+09:00 Geert Uytterhoeven <geert@linux-m68k.org>:
> Hi Michal,
>
> On Thu, Jun 5, 2014 at 5:56 PM, Michal Marek <mmarek@suse.cz> wrote:
>> On Wed, Jun 04, 2014 at 03:12:33PM +0200, Michal Marek wrote:
>>> On 2014-06-04 11:43, Michal Marek wrote:
>>> > On 2014-06-04 11:03, Richard Weinberger wrote:
>>> >> To reproduce run:
>>> >> make defconfig ARCH=um O=/mnt/o && make linux ARCH=um O=/mnt/
>>> >>
>>> >> If there is anything in UML which needs fixing, please tell. :-)
>>> >
>>> > I'll have a look, thanks for the report.
>>>
>>> Findings so far: For some reason, syscalls_32.h is generated in the
>>> source tree (which is wrong) and syscalls_64.h is not generated at all.
>>> Looking further.
>>
>> Can you try the below patch? The same pattern is used in the rules for
>> tools/ and tools/% in the main Makefile, need to look into that as well.
>> But UML should work now.
>>
>> Michal
>>
>> From d4bc590f8716f7dde6b7bca319097ac30a8cb0b4 Mon Sep 17 00:00:00 2001
>> From: Michal Marek <mmarek@suse.cz>
>> Date: Thu, 5 Jun 2014 17:44:44 +0200
>> Subject: [PATCH] um: Fix for relative objtree when generating x86 headers
>>
>> In an O= build, rely on the generated Makefile to call the main Makefile
>> properly. When building in the source tree, we do not need to specify
>> the -C and O= either. This fixes the problem when $(objtree) is a
>> relative path and the -C changes the directory.
>>
>> Reported-by: Richard Weinberger <richard.weinberger@gmail.com>
>> Signed-off-by: Michal Marek <mmarek@suse.cz>
>> ---
>> arch/um/Makefile | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/arch/um/Makefile b/arch/um/Makefile
>> index 36e658a..e4b1a96 100644
>> --- a/arch/um/Makefile
>> +++ b/arch/um/Makefile
>> @@ -111,8 +111,7 @@ endef
>> KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig
>>
>> archheaders:
>> - $(Q)$(MAKE) -C '$(srctree)' KBUILD_SRC= \
>> - ARCH=$(HEADER_ARCH) O='$(objtree)' archheaders
>> + $(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders
>>
>> archprepare: include/generated/user_constants.h
>
> This now commit d4bc590f8716f7dd ("um: Fix for relative objtree when
> generating x86 headers").
>
> When using O=, the build enters an infinite loop on v4.14-rc5.
Strange. I can not reproduce this.
For example, the following command works fine for me.
make ARCH=um O=foo/bar defconfig all
Could you share the command you input?
> With V=1:
>
> make KBUILD_SRC= ARCH=x86 archheaders
> make -C /scratch/geert/linux/linux
> O=/scratch/geert/build/linux-uml-amd64/. archheaders
> make -C /scratch/geert/build/linux-uml-amd64
> KBUILD_SRC=/scratch/geert/linux/linux \
> -f /scratch/geert/linux/linux/Makefile archheaders
> make KBUILD_SRC= ARCH=x86 archheaders
> make -C /scratch/geert/linux/linux
> O=/scratch/geert/build/linux-uml-amd64/. archheaders
> make -C /scratch/geert/build/linux-uml-amd64
> KBUILD_SRC=/scratch/geert/linux/linux \
> -f /scratch/geert/linux/linux/Makefile archheaders
> ...
>
> As it's been a (long) while I buily UML, I started a bisect, which pointed to
> the commit above.
> The problem actually already happened on commit d4bc590f8716f7dd, so this
> has been broken since v3.16:
>
> make KBUILD_SRC= ARCH=x86 archheaders
> make -C /scratch/geert/linux/linux
> O=/scratch/geert/build/linux-uml-amd64/. archheaders
> make -C /scratch/geert/build/linux-uml-amd64 \
> KBUILD_SRC=/scratch/geert/linux/linux \
> KBUILD_EXTMOD="" -f /scratch/geert/linux/linux/Makefile \
> archheaders
> make KBUILD_SRC= ARCH=x86 archheaders
> make -C /scratch/geert/linux/linux
> O=/scratch/geert/build/linux-uml-amd64/. archheaders
> make -C /scratch/geert/build/linux-uml-amd64 \
> KBUILD_SRC=/scratch/geert/linux/linux \
> KBUILD_EXTMOD="" -f /scratch/geert/linux/linux/Makefile \
> archheaders
> ...
>
> Unfortunately reverting that commit doesn't help, as that causes the
> failure that
> commit was supposed to fix:
>
> /scratch/geert/linux/linux/arch/x86/um/user-offsets.c:19:29: fatal
> error: asm/syscalls_64.h: No such file or directory
> #include <asm/syscalls_64.h>
> ^
> compilation terminated.
> /scratch/geert/linux/linux/scripts/Makefile.build:154: recipe for
> target 'arch/x86/um/user-offsets.s' failed
>
> Do you have any clue? Thanks!
>
> Gr{oetje,eeting}s,
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2017-10-25 12:22 UTC | newest]
Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-09 12:52 [PATCH v2 0/5] kbuild: Use relative paths if possible Michal Marek
2014-05-09 12:52 ` [PATCH v2 1/5] firmware: Simplify directory creation Michal Marek
2014-05-09 16:51 ` Sam Ravnborg
2014-05-14 20:53 ` Michal Marek
2014-05-09 12:52 ` [PATCH v2 2/5] firmware: Use $(quote) in the Makefile Michal Marek
2014-05-09 12:52 ` [PATCH v2 3/5] kbuild: Use relative path for $(objtree) Michal Marek
2014-06-04 9:03 ` Richard Weinberger
2014-06-04 9:43 ` Michal Marek
2014-06-04 13:12 ` Michal Marek
2014-06-05 15:56 ` Michal Marek
2014-06-09 21:12 ` Michal Marek
2014-06-09 21:23 ` Randy Dunlap
2014-06-09 22:14 ` Michal Marek
2014-06-09 22:24 ` Randy Dunlap
2014-06-09 22:39 ` Michal Marek
2014-06-09 23:47 ` Randy Dunlap
2014-06-10 9:02 ` Michal Marek
2014-06-10 14:09 ` Randy Dunlap
2014-06-10 14:30 ` Michal Marek
2014-06-10 7:40 ` Geert Uytterhoeven
2014-06-10 8:17 ` Michal Marek
2017-10-16 10:26 ` Geert Uytterhoeven
2017-10-16 10:28 ` Geert Uytterhoeven
2017-10-25 12:21 ` Masahiro Yamada
2014-05-09 12:52 ` [PATCH v2 4/5] kbuild: Use relative path when building in the source tree Michal Marek
2014-05-09 12:52 ` [PATCH v2 5/5] kbuild: Use relative path when building in a subdir of " Michal Marek
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).