Skip to contentSkip to conversation

Support arch/$ARCH/include in kbuild

PATCH New Sam Ravnborg 2 participants 13 messages Jun 21, 2008 – Jun 26, 2008 Kbuild

lore
Share & tools
lore
#0 lore raw

Linus hinted that he liked to have all arch specific header files moved from include/asm-$ARCH to arch/$ARCH/include/asm.

The following two patches implement the basic support for this.

I have used sparc for my testing and to some degree I also used i386.

For sparc I just had to do a simple:

mkdir -p arch/sparc/include/asm
mv include/asm-sparc/* arch/sparc/include/asm

to build sparc with the new directory layout.

For i386 I had to do a few trivial path fixes in arch/x86/Makefile and to fix the include of unistd_32.h in one place to fix the build.

I expect a few additional bits to show up when people start to move their header files but this should be a good starting point.

To support arch/$ARCH/include/ was done in two steps.

First was to teach make headers_* about the new layout. And second step was to get the build fixed with the new layout.

Patches are on top of kbuild-next.git and follows.

Sam

#1 lore raw

PATCH 1/1 kbuild: prepare headers_* for arch/$ARCH/include

From dbe54b86ff10b0f6d0a5d1b8e706696f87b9b42a Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <[email protected]>
Date: Sat, 21 Jun 2008 00:24:17 +0200
Subject: [PATCH] kbuild: prepare headers_* for arch/$ARCH/include

Factor out the headers_*_all support to a seperate shell script and add support for arch specific header files can be located in either

arch/$ARCH/include/asm
or
include/asm-$ARCH/

---
 Makefile           |   37 ++++++++++++++++++-------------------
 scripts/headers.sh |   41 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+), 19 deletions(-)
 create mode 100755 scripts/headers.sh
Makefile +18 -19
index 309f49d..e309a87 100644
@@ -205,6 +205,9 @@ ifeq ($(ARCH),x86_64)
         SRCARCH := x86
 endif
 
+# Where to locate arch specific headers
+hdr-arch       := $(SRCARCH)
+
 KCONFIG_CONFIG	?= .config
 
 # SHELL used by kbuild
@@ -1000,43 +1003,39 @@ depend dep:
 #Default location for installed headers
 export INSTALL_HDR_PATH = $(objtree)/usr
 
-hdr-filter := generic um ppc sparc64 cris
-hdr-archs  := $(filter-out $(hdr-filter),                           \
-                  $(patsubst $(srctree)/include/asm-%/Kbuild,%,     \
-                      $(wildcard $(srctree)/include/asm-*/Kbuild)))
 hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
+# Find out where the Kbuild file is located to support
+# arch/$(ARCH)/include/asm
+hdr-dir = $(strip                                                         \
+          $(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/asm/Kbuild), \
+               arch/$(hdr-arch)/include/asm, include/asm-$(hdr-arch)))
+
+# If we do an all arch process set dst to asm-$(hdr-arch)
+hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm)
 
 PHONY += __headers
 __headers: include/linux/version.h scripts_basic FORCE
 	$(Q)$(MAKE) $(build)=scripts scripts/unifdef
 
 PHONY += headers_install_all
-headers_install_all: __headers
-	$(Q)$(MAKE) $(hdr-inst)=include
-	$(Q)set -e; for arch in $(hdr-archs); do \
-	 $(MAKE) $(hdr-inst)=include/asm-$$arch   \
-	         SRCARCH=$$arch dst=include/asm-$$arch;  \
-	 done
+headers_install_all:
+	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/headers.sh install
 
 PHONY += headers_install
 headers_install: __headers
-	$(if $(wildcard $(srctree)/include/asm-$(SRCARCH)/Kbuild),, \
-	$(error Headers not exportable for this architecture ($(SRCARCH))))
+	$(if $(wildcard $(srctree)/$(hdr-dir)/Kbuild),, \
+	$(error Headers not exportable for the $(SRCARCH) architecture))
 	$(Q)$(MAKE) $(hdr-inst)=include
-	$(Q)$(MAKE) $(hdr-inst)=include/asm-$(SRCARCH) dst=include/asm
+	$(Q)$(MAKE) $(hdr-inst)=$(hdr-dir) $(hdr-dst)
 
 PHONY += headers_check_all
 headers_check_all: headers_install_all
-	$(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1
-	$(Q)set -e; for arch in $(hdr-archs); do \
-	 $(MAKE) SRCARCH=$$arch $(hdr-inst)=include/asm-$$arch HDRCHECK=1 ;\
-	 done
+	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/headers.sh check
 
 PHONY += headers_check
 headers_check: headers_install
 	$(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1
-	$(Q)$(MAKE) $(hdr-inst)=include/asm-$(SRCARCH) \
-	            dst=include/asm HDRCHECK=1
+	$(Q)$(MAKE) $(hdr-inst)=$(hdr-dir) $(hdr-dst) HDRCHECK=1
 
 # ---------------------------------------------------------------------------
 # Modules
scripts/headers.sh new file +41 -0

41 lines not on this page · raw message

Signature · 1 line
1.5.4.1.143.ge7e51
#2 lore raw

PATCH 1/1 kbuild: support arch/$ARCH/include/...

In reply to Sam Ravnborg

From d888d09887a0231e494e7009d855bd3e3c35bfd9 Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <[email protected]>
Date: Sat, 21 Jun 2008 01:07:38 +0200
Subject: [PATCH] kbuild: support arch/$ARCH/include/...

Unconditionally add arch/$ARCH/include to the gcc search path. Create asm symlink only when we need them
Save asm-offset in include/asm
Delete include/asm during mrproper being it a link or a directory

---
 Kbuild   |    2 +-
 Makefile |   35 ++++++++++++++++++++---------------
 2 files changed, 21 insertions(+), 16 deletions(-)
Kbuild +1 -1
index e750e9c..254a6af 100644
@@ -43,7 +43,7 @@ $(obj)/$(bounds-file): kernel/bounds.s Kbuild
 # 2) Generate asm-offsets.h
 #
 
-offsets-file := include/asm-$(SRCARCH)/asm-offsets.h
+offsets-file := include/asm/asm-offsets.h
 
 always  += $(offsets-file)
 targets += $(offsets-file)
Makefile +20 -15
index e309a87..70dc0a8 100644
@@ -329,7 +329,8 @@ AFLAGS_KERNEL	=
 # Needed to be compatible with the O= option
 LINUXINCLUDE    := -Iinclude \
                    $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \
-		   -include include/linux/autoconf.h
+                   -I$(srctree)/arch/$(hdr-arch)/include               \
+                   -include include/linux/autoconf.h
 
 KBUILD_CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE)
 
@@ -921,7 +922,9 @@ ifneq ($(KBUILD_SRC),)
 		/bin/false; \
 	fi;
 	$(Q)if [ ! -d include2 ]; then mkdir -p include2; fi;
-	$(Q)ln -fsn $(srctree)/include/asm-$(SRCARCH) include2/asm
+	$(Q)if [ -e $(srctree)/include/asm-$(SRCARCH)/system.h ]; then  \
+	    ln -fsn $(srctree)/include/asm-$(SRCARCH) include2/asm;     \
+	    fi
 endif
 
 # prepare2 creates a makefile if using a separate output directory
@@ -949,19 +952,21 @@ export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH)
 # Detect this and ask user to run make mrproper
 
 include/asm: FORCE
-	$(Q)set -e; asmlink=`readlink include/asm | cut -d '-' -f 2`;   \
-	if [ -L include/asm ]; then                                     \
-		if [ "$$asmlink" != "$(SRCARCH)" ]; then                \
+	$(Q)set -e; asmlink=`readlink include/asm | cut -d '-' -f 2`;      \
+	if [ -L include/asm ]; then                                        \
+		if [ "$$asmlink" != "$(SRCARCH)" ]; then                   \
 			echo "ERROR: the symlink $@ points to asm-$$asmlink but asm-$(SRCARCH) was expected"; \
 			echo "       set ARCH or save .config and run 'make mrproper' to fix it";             \
-			exit 1;                                         \
-		fi;                                                     \
-	else                                                            \
-		echo '  SYMLINK $@ -> include/asm-$(SRCARCH)';          \
-		if [ ! -d include ]; then                               \
-			mkdir -p include;                               \
-		fi;                                                     \
-		ln -fsn asm-$(SRCARCH) $@;                              \
+			exit 1;                                            \
+		fi;                                                        \
+	else                                                               \
+		if [ -e $(srctree)/include/asm-$(SRCARCH)/system.h ]; then \
+			echo '  SYMLINK $@ -> include/asm-$(SRCARCH)';     \
+			if [ ! -d include ]; then                          \
+				mkdir -p include;                          \
+			fi;                                                \
+			ln -fsn asm-$(SRCARCH) $@;                         \
+		fi                                                         \
 	fi
 
 # Generate some files
@@ -1120,8 +1125,8 @@ CLEAN_FILES +=	vmlinux System.map \
                 .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map
 
 # Directories & files removed with 'make mrproper'
-MRPROPER_DIRS  += include/config include2 usr/include
-MRPROPER_FILES += .config .config.old include/asm .version .old_version \
+MRPROPER_DIRS  += include/config include2 usr/include include/asm
+MRPROPER_FILES += .config .config.old .version .old_version             \
                   include/linux/autoconf.h include/linux/version.h      \
                   include/linux/utsrelease.h                            \
                   include/linux/bounds.h include/asm*/asm-offsets.h     \
Signature · 1 line
1.5.4.1.143.ge7e51
#3 lore raw
In reply to Sam Ravnborg
Quoted 2 lines

Patches are on top of kbuild-next.git and follows.

Just to make it crystal clear.
These patches are for comment and I will await feedback before pushing to kbuild-next.git (and thus -next).

And archs are not forced to move their header files now. They can wait until it fits their schedule.

Sam

#4 lore raw
In reply to Sam Ravnborg
Quoted 26 lines · Sam Ravnborg

Linus hinted that he liked to have all arch specific header files moved from include/asm-$ARCH to arch/$ARCH/include/asm.

The following two patches implement the basic support for this.

I have used sparc for my testing and to some degree I also used i386.

For sparc I just had to do a simple:

mkdir -p arch/sparc/include/asm
mv include/asm-sparc/* arch/sparc/include/asm

to build sparc with the new directory layout.

For i386 I had to do a few trivial path fixes in arch/x86/Makefile and to fix the include of unistd_32.h in one place to fix the build.

I expect a few additional bits to show up when people start to move their header files but this should be a good starting point.

Quoted 7 lines

To support arch/$ARCH/include/ was done in two steps.

First was to teach make headers_* about the new layout. And second step was to get the build fixed with the new layout.

Patches are on top of kbuild-next.git and follows.

I redid this and ended up with 5 small patches.

Sam Ravnborg (5):
kbuild: prepare headers_* for arch/$ARCH/include
kbuild: include/asm may be a file - fix mrproper for this
kbuild: support arch/$ARCH/include for tags, cscope
kbuild: asm symlink support for arch/$ARCH/include
kbuild: add arch/$ARCH/include to search path

This patchset is tested a more than
the previous one and is now also pushed out
to kbuild-next.git so it will apprear in -next shortly.

There were a few bugs around the symlink handling
and make tags is now also functional.
So I consider this ready for merging.

Any comments are welcome!
Patches will follow as reply to this one, but they are only sent to kbuild and lkml.

Sam

#5 lore raw

PATCH 1/5 kbuild: prepare headers_* for arch/$ARCH/include

Factor out the headers_*_all support to a seperate shell script and add support for arch specific header files can be located in either

arch/$ARCH/include/asm
or
include/asm-$ARCH/

In "make help" always display the headers_* targets.

---
 Makefile           |   49 ++++++++++++++++++++++---------------------------
 scripts/headers.sh |   41 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+), 27 deletions(-)
 create mode 100755 scripts/headers.sh
Makefile +22 -27
index 309f49d..4ea5189 100644
@@ -205,6 +205,9 @@ ifeq ($(ARCH),x86_64)
         SRCARCH := x86
 endif
 
+# Where to locate arch specific headers
+hdr-arch       := $(SRCARCH)
+
 KCONFIG_CONFIG	?= .config
 
 # SHELL used by kbuild
@@ -1000,43 +1003,39 @@ depend dep:
 #Default location for installed headers
 export INSTALL_HDR_PATH = $(objtree)/usr
 
-hdr-filter := generic um ppc sparc64 cris
-hdr-archs  := $(filter-out $(hdr-filter),                           \
-                  $(patsubst $(srctree)/include/asm-%/Kbuild,%,     \
-                      $(wildcard $(srctree)/include/asm-*/Kbuild)))
 hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
+# Find out where the Kbuild file is located to support
+# arch/$(ARCH)/include/asm
+hdr-dir = $(strip                                                         \
+          $(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/asm/Kbuild), \
+               arch/$(hdr-arch)/include/asm, include/asm-$(hdr-arch)))
+
+# If we do an all arch process set dst to asm-$(hdr-arch)
+hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm)
 
 PHONY += __headers
 __headers: include/linux/version.h scripts_basic FORCE
 	$(Q)$(MAKE) $(build)=scripts scripts/unifdef
 
 PHONY += headers_install_all
-headers_install_all: __headers
-	$(Q)$(MAKE) $(hdr-inst)=include
-	$(Q)set -e; for arch in $(hdr-archs); do \
-	 $(MAKE) $(hdr-inst)=include/asm-$$arch   \
-	         SRCARCH=$$arch dst=include/asm-$$arch;  \
-	 done
+headers_install_all:
+	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/headers.sh install
 
 PHONY += headers_install
 headers_install: __headers
-	$(if $(wildcard $(srctree)/include/asm-$(SRCARCH)/Kbuild),, \
-	$(error Headers not exportable for this architecture ($(SRCARCH))))
+	$(if $(wildcard $(srctree)/$(hdr-dir)/Kbuild),, \
+	$(error Headers not exportable for the $(SRCARCH) architecture))
 	$(Q)$(MAKE) $(hdr-inst)=include
-	$(Q)$(MAKE) $(hdr-inst)=include/asm-$(SRCARCH) dst=include/asm
+	$(Q)$(MAKE) $(hdr-inst)=$(hdr-dir) $(hdr-dst)
 
 PHONY += headers_check_all
 headers_check_all: headers_install_all
-	$(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1
-	$(Q)set -e; for arch in $(hdr-archs); do \
-	 $(MAKE) SRCARCH=$$arch $(hdr-inst)=include/asm-$$arch HDRCHECK=1 ;\
-	 done
+	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/headers.sh check
 
 PHONY += headers_check
 headers_check: headers_install
 	$(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1
-	$(Q)$(MAKE) $(hdr-inst)=include/asm-$(SRCARCH) \
-	            dst=include/asm HDRCHECK=1
+	$(Q)$(MAKE) $(hdr-inst)=$(hdr-dir) $(hdr-dst) HDRCHECK=1
 
 # ---------------------------------------------------------------------------
 # Modules
@@ -1217,21 +1216,17 @@ help:
 	@echo  '  cscope	  - Generate cscope index'
 	@echo  '  kernelrelease	  - Output the release version string'
 	@echo  '  kernelversion	  - Output the version stored in Makefile'
-	@if [ -r $(srctree)/include/asm-$(SRCARCH)/Kbuild ]; then \
-	 echo  '  headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \
+	@echo  '  headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \
 	 echo  '                    (default: $(INSTALL_HDR_PATH))'; \
-	 fi
-	@echo  ''
+	 echo  ''
 	@echo  'Static analysers'
 	@echo  '  checkstack      - Generate a list of stack hogs'
 	@echo  '  namespacecheck  - Name space analysis on compiled kernel'
 	@echo  '  versioncheck    - Sanity check on version.h usage'
 	@echo  '  includecheck    - Check for duplicate included header files'
 	@echo  '  export_report   - List the usages of all exported symbols'
-	@if [ -r $(srctree)/include/asm-$(SRCARCH)/Kbuild ]; then \
-	 echo  '  headers_check   - Sanity check on exported headers'; \
-	 fi
-	@echo  ''
+	@echo  '  headers_check   - Sanity check on exported headers'; \
+	 echo  ''
 	@echo  'Kernel packaging:'
 	@$(MAKE) $(build)=$(package-dir) help
 	@echo  ''
scripts/headers.sh new file +41 -0

41 lines not on this page · raw message

Signature · 1 line
1.5.4.1.143.ge7e51
#7 lore raw

PATCH 2/5 kbuild: include/asm may be a file - fix mrproper for this

In reply to Sam Ravnborg

I upcoming patch include/asm is a directory when we do a "make O=..." build, so teach mrproper to handle this

---
 Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -2
index 4ea5189..ef30745 100644
@@ -1120,8 +1120,8 @@ CLEAN_FILES +=	vmlinux System.map \
                 .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map
 
 # Directories & files removed with 'make mrproper'
-MRPROPER_DIRS  += include/config include2 usr/include
-MRPROPER_FILES += .config .config.old include/asm .version .old_version \
+MRPROPER_DIRS  += include/config include2 usr/include include/asm
+MRPROPER_FILES += .config .config.old .version .old_version             \
                   include/linux/autoconf.h include/linux/version.h      \
                   include/linux/utsrelease.h                            \
                   include/linux/bounds.h include/asm*/asm-offsets.h     \
Signature · 1 line
1.5.4.1.143.ge7e51
#8 lore raw

PATCH 3/5 kbuild: support arch/$ARCH/include for tags, cscope

In reply to Sam Ravnborg
---
 Makefile |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
Makefile +5 -1
index ef30745..115eb48 100644
@@ -1399,7 +1399,11 @@ define find-sources
 	       \( -name config -o -name 'asm-*' \) -prune \
 	       -o -name $1 -print; \
 	  for arch in $(ALLINCLUDE_ARCHS) ; do \
-	       find $(__srctree)include/asm-$${arch} $(RCS_FIND_IGNORE) \
+	       test -e $(__srctree)include/asm-$${arch} && \
+                 find $(__srctree)include/asm-$${arch} $(RCS_FIND_IGNORE) \
+	            -name $1 -print; \
+	       test -e $(__srctree)arch/$${arch}/include/asm && \
+	         find $(__srctree)arch/$${arch}/include/asm $(RCS_FIND_IGNORE) \
 	            -name $1 -print; \
 	  done ; \
 	  find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \
Signature · 1 line
1.5.4.1.143.ge7e51
#9 lore raw

PATCH 4/5 kbuild: asm symlink support for arch/$ARCH/include

In reply to Sam Ravnborg

Adjust the asm symlink support so we do not create the symlink unless really needed.
We check the precense of include/asm-$ARCH by checking for the system.h file. We may end up with a stale directory so it is not enough to check if the directory is present.

For "make O=..." build if we see that asm is a symlink then it is deleted. This happens when we apply this patch to a kernel with a valid build - so we do not require a "make mrproper".

---
 Kbuild   |    2 +-
 Makefile |   50 ++++++++++++++++++++++++++++++++++++--------------
 2 files changed, 37 insertions(+), 15 deletions(-)
Kbuild +1 -1
index e750e9c..254a6af 100644
@@ -43,7 +43,7 @@ $(obj)/$(bounds-file): kernel/bounds.s Kbuild
 # 2) Generate asm-offsets.h
 #
 
-offsets-file := include/asm-$(SRCARCH)/asm-offsets.h
+offsets-file := include/asm/asm-offsets.h
 
 always  += $(offsets-file)
 targets += $(offsets-file)
Makefile +36 -14

65 lines not on this page · raw message

Signature · 1 line
1.5.4.1.143.ge7e51
#10 lore raw

PATCH 5/5 kbuild: add arch/$ARCH/include to search path

In reply to Sam Ravnborg

This patch conclude the support for

arch/$ARCH/include

Note: The individual architectures will most likely require
a few minor patches to support locating header files in arch/$ARCH/include

Testing shows that it worked out-of-the-box for sparc, but x86 requireds a few trivial changes in the
arch specific Makefile (and one include path needs to be adjusted).

---
 Makefile |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Makefile +2 -1
index aac0ae0..2628295 100644
@@ -329,7 +329,8 @@ AFLAGS_KERNEL	=
 # Needed to be compatible with the O= option
 LINUXINCLUDE    := -Iinclude \
                    $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \
-		   -include include/linux/autoconf.h
+                   -I$(srctree)/arch/$(hdr-arch)/include               \
+                   -include include/linux/autoconf.h
 
 KBUILD_CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE)
 
Signature · 1 line
1.5.4.1.143.ge7e51
#6 lore raw

Re: [PATCH 1/5] kbuild: prepare headers_* for arch/$ARCH/include

In reply to Sam Ravnborg

scripts/headers.sh line 28

Quoted 11 lines · Sam Ravnborg
scripts/headers.sh new file +11 -0
+# Do not try this architecture
+drop="generic um ppc sparc64 cris"
+
+archs=$(ls ${srctree}/arch)
+
+for arch in ${archs}; do
+	case ${arch} in
+	um)        # no userspace export
+		;;
+	ppc)       # headers exported by powerpc
+		;;

Note that arch/ppc is scheduled for removal with the 2.6.27 merge window, so you may want to leave it out right away.

	Arnd <><
#11 lore raw
In reply to Sam Ravnborg
Quoted 3 lines · Sam Ravnborg

Any comments are welcome!
Patches will follow as reply to this one, but they are only sent to kbuild and lkml.

I think you need to fix up all instances of #include <asm-$ARCH/$FILE>,

grep ^#[:ws:]*include.*[\"\<]asm-[^g].*/ git-ls-files

Documentation/lguest/lguest.c:#include "asm-x86/bootparam.h" arch/ia64/ia32/audit.c:#include <asm-x86/unistd_32.h> arch/ia64/kernel/asm-offsets.c:#include <asm-ia64/processor.h> arch/ia64/kernel/asm-offsets.c:#include <asm-ia64/ptrace.h> arch/ia64/kernel/asm-offsets.c:#include <asm-ia64/siginfo.h> arch/ia64/kernel/asm-offsets.c:#include <asm-ia64/sigcontext.h> arch/ia64/kernel/asm-offsets.c:#include <asm-ia64/mca.h> arch/ia64/kernel/jprobes.S:#include <asm-ia64/break.h> arch/mips/mips-boards/generic/amon.c:#include <asm-mips/addrspace.h> arch/mips/mips-boards/generic/amon.c:#include <asm-mips/mips-boards/launch.h> arch/mips/mips-boards/generic/amon.c:#include <asm-mips/mipsmtregs.h> arch/powerpc/platforms/86xx/mpc86xx_smp.c:#include <asm-powerpc/mpic.h> arch/sparc64/kernel/compat_audit.c:#include <asm-sparc/unistd.h> arch/um/sys-x86_64/syscall_table.c:#include <asm-x86/unistd_64.h> arch/um/sys-x86_64/syscall_table.c:#include <asm-x86/unistd_64.h> drivers/char/agp/parisc-agp.c:#include <asm-parisc/parisc-device.h> drivers/char/agp/parisc-agp.c:#include <asm-parisc/ropes.h> drivers/infiniband/hw/ehca/ehca_reqs.c:#include <asm-powerpc/system.h> drivers/s390/net/qeth_core_main.c:#include <asm-s390/ebcdic.h> drivers/s390/net/qeth_core_main.c:#include <asm-s390/io.h> include/asm-arm/arch-omap/board.h:#include <asm-arm/arch-omap/board-nokia.h> include/asm-blackfin/gpio.h:#include <asm-blackfin/mach-bf548/gpio.h> include/asm-m68knommu: lots of #include <asm-m68k/*> include/asm-parisc/ropes.h:#include <asm-parisc/parisc-device.h> include/asm-powerpc/irqflags.h:#include <asm-powerpc/hw_irq.h> include/asm-sparc64: lots of #include <asm-sparc/*>

most of these are obvious, the interesting ones being sparc64, m68knommu and arch/um as well as arch/ia64/ia32/audit.c.

The best idea I have for sparc64 and m68knommu would be to use "gcc -Iarch/sparc64/include -Iarch/sparc/include" and then remove the respective files from sparc64. On m68knommu, this works as well, except for the pci.h and setup.h files that include the m68k one and then do some more.

	Arnd <><
#12 lore raw
Quoted 37 lines · Arnd Bergmann
Quoted 3 lines · Sam Ravnborg

Any comments are welcome!
Patches will follow as reply to this one, but they are only sent to kbuild and lkml.

I think you need to fix up all instances of #include <asm-$ARCH/$FILE>,

grep ^#[:ws:]*include.*[\"\<]asm-[^g].*/ git-ls-files

Documentation/lguest/lguest.c:#include "asm-x86/bootparam.h" arch/ia64/ia32/audit.c:#include <asm-x86/unistd_32.h> arch/ia64/kernel/asm-offsets.c:#include <asm-ia64/processor.h> arch/ia64/kernel/asm-offsets.c:#include <asm-ia64/ptrace.h> arch/ia64/kernel/asm-offsets.c:#include <asm-ia64/siginfo.h> arch/ia64/kernel/asm-offsets.c:#include <asm-ia64/sigcontext.h> arch/ia64/kernel/asm-offsets.c:#include <asm-ia64/mca.h> arch/ia64/kernel/jprobes.S:#include <asm-ia64/break.h> arch/mips/mips-boards/generic/amon.c:#include <asm-mips/addrspace.h> arch/mips/mips-boards/generic/amon.c:#include <asm-mips/mips-boards/launch.h> arch/mips/mips-boards/generic/amon.c:#include <asm-mips/mipsmtregs.h> arch/powerpc/platforms/86xx/mpc86xx_smp.c:#include <asm-powerpc/mpic.h> arch/sparc64/kernel/compat_audit.c:#include <asm-sparc/unistd.h> arch/um/sys-x86_64/syscall_table.c:#include <asm-x86/unistd_64.h> arch/um/sys-x86_64/syscall_table.c:#include <asm-x86/unistd_64.h> drivers/char/agp/parisc-agp.c:#include <asm-parisc/parisc-device.h> drivers/char/agp/parisc-agp.c:#include <asm-parisc/ropes.h> drivers/infiniband/hw/ehca/ehca_reqs.c:#include <asm-powerpc/system.h> drivers/s390/net/qeth_core_main.c:#include <asm-s390/ebcdic.h> drivers/s390/net/qeth_core_main.c:#include <asm-s390/io.h> include/asm-arm/arch-omap/board.h:#include <asm-arm/arch-omap/board-nokia.h> include/asm-blackfin/gpio.h:#include <asm-blackfin/mach-bf548/gpio.h> include/asm-m68knommu: lots of #include <asm-m68k/*> include/asm-parisc/ropes.h:#include <asm-parisc/parisc-device.h> include/asm-powerpc/irqflags.h:#include <asm-powerpc/hw_irq.h> include/asm-sparc64: lots of #include <asm-sparc/*>

Quoted 8 lines

most of these are obvious, the interesting ones being sparc64, m68knommu and arch/um as well as arch/ia64/ia32/audit.c.

The best idea I have for sparc64 and m68knommu would be to use "gcc -Iarch/sparc64/include -Iarch/sparc/include" and then remove the respective files from sparc64. On m68knommu, this works as well, except for the pci.h and setup.h files that include the m68k one and then do some more.

For sparc64 I have taken a bit more drastic approach and I am merging the header files of sparc and sparc64.

My goal is to get sparc converted to use arch/sparc/include/asm for 2.6.27.

Sam