Re: [PATCH v2 3/5] kbuild: Use relative path for $(objtree)

From: Randy Dunlap
Date: Mon Jun 09 2014 - 17:23:41 EST


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@xxxxxxx>
> 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@xxxxxxxxx>
> Signed-off-by: Michal Marek <mmarek@xxxxxxx>
> ---
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/