Skip to contentSkip to conversation

asm/types.h Header file wont get generated while building uImage ?

PATCH In review Prabhakar Lad 4 participants 9 messages Mar 8, 2013 – Apr 10, 2013 Kbuild

lore
Share & tools
lore
#0 lore raw

Hi,

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.

Is it the same way now its going to be followed or is it I am missing something ?
(For reference I have used da8xx_omapl_defconfig config when I faced this issue)

Regards,
--Prabhakar

#1 lore raw

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

Quoted 15 lines · Prabhakar Lad

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.

Quoted 3 lines

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.

Signature · 1 line
Tixy
#2 lore raw

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

Quoted 8 lines · Jon Medhurst (Tixy)

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:

Quoted 7 lines

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?

Makefile +2 -1
index a5f3203..2a484db 100644
@@ -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.

Signature · 3 lines
Andreas Schwab, schwab at linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#3 lore raw

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

Quoted 18 lines · Andreas Schwab
Quoted 8 lines · Jon Medhurst (Tixy)

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:

Quoted 7 lines

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

Quoted 1 line

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.

Quoted 17 lines
Makefile +2 -1
index a5f3203..2a484db 100644
@@ -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.

Signature · 1 line
Tixy
author Tested-by
#4 lore raw

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

In reply to Andreas Schwab

Hi Andreas,

Quoted 26 lines · Andreas Schwab
Quoted 8 lines · Jon Medhurst (Tixy)

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:

Quoted 7 lines

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?

Makefile +0 -0
index a5f3203..2a484db 100644

Makefile ifeq ($(KBUILD_EXTMOD),) · line 519

Quoted 9 lines
Makefile +2 -1
@@ -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!

Regards,
--Prabhakar

Quoted 6 lines

Andreas.

--
Andreas Schwab, schwab at linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

#5 lore raw

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

In reply to Andreas Schwab

Hi Andreas

Quoted 26 lines · Andreas Schwab
Quoted 8 lines · Jon Medhurst (Tixy)

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:

Quoted 7 lines

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?

Makefile +0 -0
index a5f3203..2a484db 100644

Makefile ifeq ($(KBUILD_EXTMOD),) · line 519

Quoted 9 lines
Makefile +2 -1
@@ -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

Quoted 6 lines

Andreas.

--
Andreas Schwab, schwab at linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

#6 lore raw

PATCH 1/1 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").

---

Quoted 1 line · Prabhakar Lad

Whats the status of it ?

I think it has sufficiently been tested by now.

Andreas.

---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile +2 -1
index 6db672b..11157bd 100644
@@ -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
Signature · 7 lines
1.8.2.1


-- 
Andreas Schwab, schwab at linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
author Tested-by on v1 1/1
#7 lore raw

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

Quoted 4 lines · Andreas Schwab

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

Regards,
--Prabhakar

Quoted 34 lines

---

Quoted 1 line · Prabhakar Lad

Whats the status of it ?

I think it has sufficiently been tested by now.

Andreas.

---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile +2 -2
index 6db672b..11157bd 100644
@@ -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, schwab at linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

#8 lore raw

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

In reply to Andreas Schwab
Quoted 10 lines · Andreas Schwab

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

---

Quoted 1 line · Prabhakar Lad

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