2013-03-22 11:29:44

by Jon Medhurst (Tixy)

[permalink] [raw]
Subject: [BUG] mod/file2alias: build error in devicetable-offsets.c [was: asm/types.h Header file wont get generated while building uImage ?]

On Fri, 2013-03-08 at 13:31 +0530, Prabhakar Lad wrote:
> Usually for building uImage I follow this steps,
> 1: do a clean distclean
> 2: make ARCH=arm CROSS_COMPILE=xxx xxxdefconfig
> 3: make ARCH=arm CROSS_COMPILE=xxx uImage
>
> This used to work until 3.8, for 3.9 I see the following error:
>
> HOSTCC scripts/genksyms/parse.tab.o
> In file included from include/linux/types.h:5:0,
> from include/linux/mod_devicetable.h:11,
> from scripts/mod/devicetable-offsets.c:2:
> include/uapi/linux/types.h:4:23: fatal error: asm/types.h: No such
> file or directory
> compilation terminated.
>
> Well this get fixed if do make ARCH=arm
> CROSS_COMPILE=arm-none-linux-gnueabi- headers_install
> and the build the uImage.

I am seeing a similar problem.

This appears to be introduced by commit 6543becf (mod/file2alias: make
modalias generation safe for cross compiling). More specifically a race
condition between the generation of devicetable-offsets.h and the
generation of asm/types.h by scripts/Makefile.asm-generic.

For builds which succeed I see this order:

WRAP arch/arm/include/generated/asm/types.h
[...]
GEN include/generated/asm-offsets.h

and for those which fail:

CC scripts/mod/devicetable-offsets.s
In file included from include/linux/types.h:5:0,
from include/linux/mod_devicetable.h:11,
from scripts/mod/devicetable-offsets.c:2:
include/uapi/linux/types.h:4:23: fatal error: asm/types.h: No such file or directory
[...]
WRAP arch/arm/include/generated/asm/types.h

These makefile and scripts are a bit beyond my immediate understanding
so can't suggest a fix.

--
Tixy


2013-03-30 19:46:21

by Andreas Schwab

[permalink] [raw]
Subject: Re: [BUG] mod/file2alias: build error in devicetable-offsets.c [was: asm/types.h Header file wont get generated while building uImage ?]

"Jon Medhurst (Tixy)" <[email protected]> writes:

> For builds which succeed I see this order:
>
> WRAP arch/arm/include/generated/asm/types.h
> [...]
> GEN include/generated/asm-offsets.h
>
> and for those which fail:
>
> CC scripts/mod/devicetable-offsets.s
> In file included from include/linux/types.h:5:0,
> from include/linux/mod_devicetable.h:11,
> from scripts/mod/devicetable-offsets.c:2:
> include/uapi/linux/types.h:4:23: fatal error: asm/types.h: No such file or directory
> [...]
> WRAP arch/arm/include/generated/asm/types.h

Does that help?

diff --git a/Makefile b/Makefile
index a5f3203..2a484db 100644
--- a/Makefile
+++ b/Makefile
@@ -512,7 +512,8 @@ ifeq ($(KBUILD_EXTMOD),)
# Carefully list dependencies so we do not try to build scripts twice
# in parallel
PHONY += scripts
-scripts: scripts_basic include/config/auto.conf include/config/tristate.conf
+scripts: scripts_basic include/config/auto.conf include/config/tristate.conf \
+ asm-generic
$(Q)$(MAKE) $(build)=$(@)

# Objects we will link into vmlinux / subdirs we need to visit

Andreas.

--
Andreas Schwab, [email protected]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."

2013-04-02 11:20:34

by Jon Medhurst (Tixy)

[permalink] [raw]
Subject: Re: [BUG] mod/file2alias: build error in devicetable-offsets.c [was: asm/types.h Header file wont get generated while building uImage ?]

On Sat, 2013-03-30 at 20:46 +0100, Andreas Schwab wrote:
> "Jon Medhurst (Tixy)" <[email protected]> writes:
>
> > For builds which succeed I see this order:
> >
> > WRAP arch/arm/include/generated/asm/types.h
> > [...]
> > GEN include/generated/asm-offsets.h
> >
> > and for those which fail:
> >
> > CC scripts/mod/devicetable-offsets.s
> > In file included from include/linux/types.h:5:0,
> > from include/linux/mod_devicetable.h:11,
> > from scripts/mod/devicetable-offsets.c:2:
> > include/uapi/linux/types.h:4:23: fatal error: asm/types.h: No such file or directory
> > [...]
> > WRAP arch/arm/include/generated/asm/types.h
>
> Does that help?

It's rather difficult to be certain as I've only seen it in our daily
automated builds but I forced the failure on my local PC by adding
'sleep 2' to the rules in scripts/Makefile.asm-generic and doing a build
with -j4. Then after applying the below fix I couldn't reproduce the
failure. I'll add the fix to the trees our automated builds use and
report if I see any other issues but I don't anticipate any.

Thanks for looking at this.


> diff --git a/Makefile b/Makefile
> index a5f3203..2a484db 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -512,7 +512,8 @@ ifeq ($(KBUILD_EXTMOD),)
> # Carefully list dependencies so we do not try to build scripts twice
> # in parallel
> PHONY += scripts
> -scripts: scripts_basic include/config/auto.conf include/config/tristate.conf
> +scripts: scripts_basic include/config/auto.conf include/config/tristate.conf \
> + asm-generic
> $(Q)$(MAKE) $(build)=$(@)
>
> # Objects we will link into vmlinux / subdirs we need to visit
>
> Andreas.
>

--
Tixy

2013-04-02 12:45:32

by Lad, Prabhakar

[permalink] [raw]
Subject: Re: [BUG] mod/file2alias: build error in devicetable-offsets.c [was: asm/types.h Header file wont get generated while building uImage ?]

Hi Andreas,

On Sun, Mar 31, 2013 at 1:16 AM, Andreas Schwab <[email protected]> wrote:
> "Jon Medhurst (Tixy)" <[email protected]> writes:
>
>> For builds which succeed I see this order:
>>
>> WRAP arch/arm/include/generated/asm/types.h
>> [...]
>> GEN include/generated/asm-offsets.h
>>
>> and for those which fail:
>>
>> CC scripts/mod/devicetable-offsets.s
>> In file included from include/linux/types.h:5:0,
>> from include/linux/mod_devicetable.h:11,
>> from scripts/mod/devicetable-offsets.c:2:
>> include/uapi/linux/types.h:4:23: fatal error: asm/types.h: No such file or directory
>> [...]
>> WRAP arch/arm/include/generated/asm/types.h
>
> Does that help?
>
> diff --git a/Makefile b/Makefile
> index a5f3203..2a484db 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -512,7 +512,8 @@ ifeq ($(KBUILD_EXTMOD),)
> # Carefully list dependencies so we do not try to build scripts twice
> # in parallel
> PHONY += scripts
> -scripts: scripts_basic include/config/auto.conf include/config/tristate.conf
> +scripts: scripts_basic include/config/auto.conf include/config/tristate.conf \
> + asm-generic
> $(Q)$(MAKE) $(build)=$(@)
>
> # Objects we will link into vmlinux / subdirs we need to visit
>
This works thanks for the patch!

Reported-by: Lad, Prabhakar <[email protected]>
Tested-by: Lad, Prabhakar <[email protected]>

Regards,
--Prabhakar

> Andreas.
>
> --
> Andreas Schwab, [email protected]
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
> "And now for something completely different."

2013-04-09 12:15:25

by Lad, Prabhakar

[permalink] [raw]
Subject: Re: [BUG] mod/file2alias: build error in devicetable-offsets.c [was: asm/types.h Header file wont get generated while building uImage ?]

Hi Andreas

On Sun, Mar 31, 2013 at 1:16 AM, Andreas Schwab <[email protected]> wrote:
> "Jon Medhurst (Tixy)" <[email protected]> writes:
>
>> For builds which succeed I see this order:
>>
>> WRAP arch/arm/include/generated/asm/types.h
>> [...]
>> GEN include/generated/asm-offsets.h
>>
>> and for those which fail:
>>
>> CC scripts/mod/devicetable-offsets.s
>> In file included from include/linux/types.h:5:0,
>> from include/linux/mod_devicetable.h:11,
>> from scripts/mod/devicetable-offsets.c:2:
>> include/uapi/linux/types.h:4:23: fatal error: asm/types.h: No such file or directory
>> [...]
>> WRAP arch/arm/include/generated/asm/types.h
>
> Does that help?
>
> diff --git a/Makefile b/Makefile
> index a5f3203..2a484db 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -512,7 +512,8 @@ ifeq ($(KBUILD_EXTMOD),)
> # Carefully list dependencies so we do not try to build scripts twice
> # in parallel
> PHONY += scripts
> -scripts: scripts_basic include/config/auto.conf include/config/tristate.conf
> +scripts: scripts_basic include/config/auto.conf include/config/tristate.conf \
> + asm-generic
> $(Q)$(MAKE) $(build)=$(@)
>
> # Objects we will link into vmlinux / subdirs we need to visit
>
Whats the status of it ?

Regards,
--Prabhakar

> Andreas.
>
> --
> Andreas Schwab, [email protected]
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
> "And now for something completely different."

2013-04-09 17:57:06

by Andreas Schwab

[permalink] [raw]
Subject: [PATCH] kbuild: generate generic headers before recursing into scripts

The headers are now needed inside scripts/mod since 6543bec
("mod/file2alias: make modalias generation safe for cross compiling").

Signed-off-by: Andreas Schwab <[email protected]>
---
Prabhakar Lad <[email protected]> writes:

> Whats the status of it ?

I think it has sufficiently been tested by now.

Andreas.
---
Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 6db672b..11157bd 100644
--- a/Makefile
+++ b/Makefile
@@ -513,7 +513,8 @@ ifeq ($(KBUILD_EXTMOD),)
# Carefully list dependencies so we do not try to build scripts twice
# in parallel
PHONY += scripts
-scripts: scripts_basic include/config/auto.conf include/config/tristate.conf
+scripts: scripts_basic include/config/auto.conf include/config/tristate.conf \
+ asm-generic
$(Q)$(MAKE) $(build)=$(@)

# Objects we will link into vmlinux / subdirs we need to visit
--
1.8.2.1


--
Andreas Schwab, [email protected]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."

2013-04-10 04:40:16

by Lad, Prabhakar

[permalink] [raw]
Subject: Re: [PATCH] kbuild: generate generic headers before recursing into scripts

On Tue, Apr 9, 2013 at 11:27 PM, Andreas Schwab <[email protected]> wrote:
> The headers are now needed inside scripts/mod since 6543bec
> ("mod/file2alias: make modalias generation safe for cross compiling").
>
> Signed-off-by: Andreas Schwab <[email protected]>

Reported-by: Lad, Prabhakar <[email protected]>
Tested-by: Lad, Prabhakar <[email protected]>

Regards,
--Prabhakar

> ---
> Prabhakar Lad <[email protected]> writes:
>
>> Whats the status of it ?
>
> I think it has sufficiently been tested by now.
>
> Andreas.
> ---
> Makefile | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index 6db672b..11157bd 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -513,7 +513,8 @@ ifeq ($(KBUILD_EXTMOD),)
> # Carefully list dependencies so we do not try to build scripts twice
> # in parallel
> PHONY += scripts
> -scripts: scripts_basic include/config/auto.conf include/config/tristate.conf
> +scripts: scripts_basic include/config/auto.conf include/config/tristate.conf \
> + asm-generic
> $(Q)$(MAKE) $(build)=$(@)
>
> # Objects we will link into vmlinux / subdirs we need to visit
> --
> 1.8.2.1
>
>
> --
> Andreas Schwab, [email protected]
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
> "And now for something completely different."

2013-04-10 07:56:30

by Michal Marek

[permalink] [raw]
Subject: Re: [PATCH] kbuild: generate generic headers before recursing into scripts

On 9.4.2013 19:57, Andreas Schwab wrote:
> The headers are now needed inside scripts/mod since 6543bec
> ("mod/file2alias: make modalias generation safe for cross compiling").
>
> Signed-off-by: Andreas Schwab <[email protected]>
> ---
> Prabhakar Lad <[email protected]> writes:
>
>> Whats the status of it ?
>
> I think it has sufficiently been tested by now.

Thanks a lot, I added it to kbuild.git#rc-fixes.

Michal