* [PATCH] documentation: build source files in Documentation sub-dir
@ 2008-04-03 19:45 Randy Dunlap
2008-04-08 20:46 ` Andrew Morton
0 siblings, 1 reply; 9+ messages in thread
From: Randy Dunlap @ 2008-04-03 19:45 UTC (permalink / raw)
To: lkml; +Cc: linux-kbuild, samr, akpm
From: Randy Dunlap <randy.dunlap@oracle.com>
Currently source files in the Documentation/ sub-dir can easily bit-rot
since they are not generally buildable, either because they are hidden
in text files or because there are no Makefile rules for them.
This needs to be fixed so that the source files remain usable and good
examples of code instead of bad examples.
Add the ability to build source files that are in the Documentation/ dir.
Add to Kconfig as "BUILD_DOCSRC" config symbol.
Use "CONFIG_BUILD_DOCSRC=1 make ..." to build objects from the
Documentation/ sources. Or enable BUILD_DOCSRC in the *config system.
The Makefiles use $objdir/usr/include for header files, so doing
"make headers_install" is required. This is done for you if you enable
CONFIG_HEADERS_CHECK=y.
Note: needs documentation-move-spidev_fdx-example-to-its-own-source-file.patch
from -mm patchset.
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
---
Documentation/DocBook/Makefile | 7 +++++++
Documentation/Makefile | 3 +++
Documentation/accounting/Makefile | 10 ++++++++++
Documentation/auxdisplay/Makefile | 10 ++++++++++
Documentation/connector/Makefile | 9 +++++++++
Documentation/filesystems/configfs/Makefile | 1 +
Documentation/ia64/Makefile | 8 ++++++++
Documentation/networking/Makefile | 8 ++++++++
Documentation/pcmcia/Makefile | 10 ++++++++++
Documentation/spi/Makefile | 11 +++++++++++
Documentation/video4linux/Makefile | 8 ++++++++
Documentation/vm/Makefile | 8 ++++++++
Documentation/watchdog/src/Makefile | 8 ++++++++
Makefile | 5 ++++-
lib/Kconfig.debug | 8 ++++++++
15 files changed, 113 insertions(+), 1 deletion(-)
create mode 100644 Documentation/Makefile
create mode 100644 Documentation/accounting/Makefile
--- /dev/null
+++ lin2625-rc8-docsrc/Documentation/Makefile
@@ -0,0 +1,3 @@
+obj-m := DocBook/ accounting/ auxdisplay/ connector/ \
+ filesystems/configfs/ ia64/ networking/ \
+ pcmcia/ spi/ video4linux/ vm/ watchdog/src/
--- /dev/null
+++ lin2625-rc8-docsrc/Documentation/accounting/Makefile
@@ -0,0 +1,10 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := getdelays
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
+
+HOSTCFLAGS_getdelays.o += -I$(srctree)/usr/include
--- lin2625-rc8-docsrc.orig/Makefile
+++ lin2625-rc8-docsrc/Makefile
@@ -806,6 +806,9 @@ endif
ifdef CONFIG_SAMPLES
$(Q)$(MAKE) $(build)=samples
endif
+ifdef CONFIG_BUILD_DOCSRC
+ $(Q)$(MAKE) $(build)=Documentation
+endif
$(call vmlinux-modpost)
$(call if_changed_rule,vmlinux__)
$(Q)rm -f .old_version
@@ -1114,7 +1117,7 @@ MRPROPER_FILES += .config .config.old in
#
clean: rm-dirs := $(CLEAN_DIRS)
clean: rm-files := $(CLEAN_FILES)
-clean-dirs := $(addprefix _clean_,$(srctree) $(vmlinux-alldirs))
+clean-dirs := $(addprefix _clean_,$(srctree) $(vmlinux-alldirs) Documentation)
PHONY += $(clean-dirs) clean archclean
$(clean-dirs):
--- lin2625-rc8-docsrc.orig/Documentation/DocBook/Makefile
+++ lin2625-rc8-docsrc/Documentation/DocBook/Makefile
@@ -101,6 +101,13 @@ C-procfs-example = procfs_example.xml
C-procfs-example2 = $(addprefix $(obj)/,$(C-procfs-example))
$(obj)/procfs-guide.xml: $(C-procfs-example2)
+# List of programs to build
+##oops, this is a kernel module::hostprogs-y := procfs_example
+obj-m += procfs_example.o
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
+
notfoundtemplate = echo "*** You have to install docbook-utils or xmlto ***"; \
exit 1
db2xtemplate = db2TYPE -o $(dir $@) $<
--- /dev/null
+++ lin2625-rc8-docsrc/Documentation/auxdisplay/Makefile
@@ -0,0 +1,10 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := cfag12864b-example
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
+
+HOSTCFLAGS_cfag12864b-example.o += -I$(srctree)/usr/include
--- /dev/null
+++ lin2625-rc8-docsrc/Documentation/connector/Makefile
@@ -0,0 +1,9 @@
+obj-m += cn_test.o
+
+# List of programs to build
+hostprogs-y := ucon
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
+
+HOSTCFLAGS_ucon.o += -I$(srctree)/usr/include
--- /dev/null
+++ lin2625-rc8-docsrc/Documentation/ia64/Makefile
@@ -0,0 +1,8 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := aliasing-test
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
--- /dev/null
+++ lin2625-rc8-docsrc/Documentation/networking/Makefile
@@ -0,0 +1,8 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := ifenslave
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
--- /dev/null
+++ lin2625-rc8-docsrc/Documentation/pcmcia/Makefile
@@ -0,0 +1,10 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := crc32hash
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
+
+HOSTCFLAGS_crc32hash.o += -I$(srctree)/usr/include
--- /dev/null
+++ lin2625-rc8-docsrc/Documentation/spi/Makefile
@@ -0,0 +1,11 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := spidev_test spidev_fdx
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
+
+HOSTCFLAGS_spidev_test.o += -I$(srctree)/usr/include
+HOSTCFLAGS_spidev_fdx.o += -I$(srctree)/usr/include
--- /dev/null
+++ lin2625-rc8-docsrc/Documentation/video4linux/Makefile
@@ -0,0 +1,8 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := v4lgrab
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
--- /dev/null
+++ lin2625-rc8-docsrc/Documentation/vm/Makefile
@@ -0,0 +1,8 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := slabinfo
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
--- /dev/null
+++ lin2625-rc8-docsrc/Documentation/watchdog/src/Makefile
@@ -0,0 +1,8 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := watchdog-simple watchdog-test
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
--- /dev/null
+++ lin2625-rc8-docsrc/Documentation/filesystems/configfs/Makefile
@@ -0,0 +1 @@
+obj-m += configfs_example.o
--- lin2625-rc8-docsrc.orig/lib/Kconfig.debug
+++ lin2625-rc8-docsrc/lib/Kconfig.debug
@@ -621,4 +621,12 @@ config PROVIDE_OHCI1394_DMA_INIT
See Documentation/debugging-via-ohci1394.txt for more information.
+menuconfig BUILD_DOCSRC
+ bool "Build targets in Documentation/ tree"
+ help
+ This option attempts to build objects from the source files in the
+ kernel Documentation/ tree.
+
+ Say N if you are unsure.
+
source "samples/Kconfig"
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] documentation: build source files in Documentation sub-dir
2008-04-03 19:45 [PATCH] documentation: build source files in Documentation sub-dir Randy Dunlap
@ 2008-04-08 20:46 ` Andrew Morton
2008-04-09 19:35 ` [PATCH v2] " Randy Dunlap
0 siblings, 1 reply; 9+ messages in thread
From: Andrew Morton @ 2008-04-08 20:46 UTC (permalink / raw)
To: Randy Dunlap; +Cc: lkml, linux-kbuild, samr
On Thu, 3 Apr 2008 12:45:29 -0700 Randy Dunlap <randy.dunlap@oracle.com> wrote:
> Currently source files in the Documentation/ sub-dir can easily bit-rot
> since they are not generally buildable, either because they are hidden
> in text files or because there are no Makefile rules for them.
> This needs to be fixed so that the source files remain usable and good
> examples of code instead of bad examples.
>
> Add the ability to build source files that are in the Documentation/ dir.
> Add to Kconfig as "BUILD_DOCSRC" config symbol.
>
> Use "CONFIG_BUILD_DOCSRC=1 make ..." to build objects from the
> Documentation/ sources. Or enable BUILD_DOCSRC in the *config system.
>
> The Makefiles use $objdir/usr/include for header files, so doing
> "make headers_install" is required. This is done for you if you enable
> CONFIG_HEADERS_CHECK=y.
>
> Note: needs documentation-move-spidev_fdx-example-to-its-own-source-file.patch
> from -mm patchset.
argh, I'm getting several warnings and at least two build errors from this.
One is:
In file included from /usr/src/devel/usr/include/linux/netlink.h:5,
from /usr/src/devel/usr/include/linux/genetlink.h:4,
from Documentation/accounting/getdelays.c:26:
/usr/src/devel/usr/include/linux/types.h:166: error: expected specifier-qualifier-list before '__kernel_daddr_t'
(i386 allmodconfig).
I think I'll disable this patch for now..
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2] documentation: build source files in Documentation sub-dir
2008-04-08 20:46 ` Andrew Morton
@ 2008-04-09 19:35 ` Randy Dunlap
2008-04-09 21:54 ` Andrew Morton
2008-04-09 22:52 ` Nick Andrew
0 siblings, 2 replies; 9+ messages in thread
From: Randy Dunlap @ 2008-04-09 19:35 UTC (permalink / raw)
To: Andrew Morton; +Cc: lkml, linux-kbuild, samr
On Tue, 8 Apr 2008 13:46:13 -0700 Andrew Morton wrote:
> On Thu, 3 Apr 2008 12:45:29 -0700 Randy Dunlap <randy.dunlap@oracle.com> wrote:
>
> > Currently source files in the Documentation/ sub-dir can easily bit-rot
> > since they are not generally buildable, either because they are hidden
> > in text files or because there are no Makefile rules for them.
> > This needs to be fixed so that the source files remain usable and good
> > examples of code instead of bad examples.
> >
> > Add the ability to build source files that are in the Documentation/ dir.
> > Add to Kconfig as "BUILD_DOCSRC" config symbol.
> >
> > Use "CONFIG_BUILD_DOCSRC=1 make ..." to build objects from the
> > Documentation/ sources. Or enable BUILD_DOCSRC in the *config system.
> >
> > The Makefiles use $objdir/usr/include for header files, so doing
> > "make headers_install" is required. This is done for you if you enable
> > CONFIG_HEADERS_CHECK=y.
> >
> > Note: needs documentation-move-spidev_fdx-example-to-its-own-source-file.patch
> > from -mm patchset.
>
> argh, I'm getting several warnings and at least two build errors from this.
> One is:
>
> In file included from /usr/src/devel/usr/include/linux/netlink.h:5,
> from /usr/src/devel/usr/include/linux/genetlink.h:4,
> from Documentation/accounting/getdelays.c:26:
> /usr/src/devel/usr/include/linux/types.h:166: error: expected specifier-qualifier-list before '__kernel_daddr_t'
>
> (i386 allmodconfig).
>
> I think I'll disable this patch for now..
Oh drat and curses.
Change all -I$(srctree) in Makefiles to -I$(objtree).
New (full) patch file with only that change is below.
I can send a patch with only those changes if you prefer that.
Cross-build using O= works now.
---
From: Randy Dunlap <randy.dunlap@oracle.com>
Currently source files in the Documentation/ sub-dir can easily bit-rot
since they are not generally buildable, either because they are hidden
in text files or because there are no Makefile rules for them.
This needs to be fixed so that the source files remain usable and good
examples of code instead of bad examples.
Add the ability to build source files that are in the Documentation/ dir.
Add to Kconfig as "BUILD_DOCSRC" config symbol.
Use "CONFIG_BUILD_DOCSRC=1 make ..." to build objects from the
Documentation/ sources. Or enable BUILD_DOCSRC in the *config system.
The Makefiles use $objdir/usr/include for header files, so doing
"make headers_install" is required. This is done for you if you enable
CONFIG_HEADERS_CHECK=y.
Note: needs documentation-move-spidev_fdx-example-to-its-own-source-file.patch
from -mm patchset.
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
---
Documentation/DocBook/Makefile | 7 +++++++
Documentation/Makefile | 3 +++
Documentation/accounting/Makefile | 10 ++++++++++
Documentation/auxdisplay/Makefile | 10 ++++++++++
Documentation/connector/Makefile | 9 +++++++++
Documentation/filesystems/configfs/Makefile | 1 +
Documentation/ia64/Makefile | 8 ++++++++
Documentation/networking/Makefile | 8 ++++++++
Documentation/pcmcia/Makefile | 10 ++++++++++
Documentation/spi/Makefile | 11 +++++++++++
Documentation/video4linux/Makefile | 8 ++++++++
Documentation/vm/Makefile | 8 ++++++++
Documentation/watchdog/src/Makefile | 8 ++++++++
Makefile | 5 ++++-
lib/Kconfig.debug | 8 ++++++++
15 files changed, 113 insertions(+), 1 deletion(-)
create mode 100644 Documentation/Makefile
create mode 100644 Documentation/accounting/Makefile
--- /dev/null
+++ lin2625-rc8-docsrc/Documentation/Makefile
@@ -0,0 +1,3 @@
+obj-m := DocBook/ accounting/ auxdisplay/ connector/ \
+ filesystems/configfs/ ia64/ networking/ \
+ pcmcia/ spi/ video4linux/ vm/ watchdog/src/
--- /dev/null
+++ lin2625-rc8-docsrc/Documentation/accounting/Makefile
@@ -0,0 +1,10 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := getdelays
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
+
+HOSTCFLAGS_getdelays.o += -I$(objtree)/usr/include
--- lin2625-rc8-docsrc.orig/Makefile
+++ lin2625-rc8-docsrc/Makefile
@@ -806,6 +806,9 @@ endif
ifdef CONFIG_SAMPLES
$(Q)$(MAKE) $(build)=samples
endif
+ifdef CONFIG_BUILD_DOCSRC
+ $(Q)$(MAKE) $(build)=Documentation
+endif
$(call vmlinux-modpost)
$(call if_changed_rule,vmlinux__)
$(Q)rm -f .old_version
@@ -1114,7 +1117,7 @@ MRPROPER_FILES += .config .config.old in
#
clean: rm-dirs := $(CLEAN_DIRS)
clean: rm-files := $(CLEAN_FILES)
-clean-dirs := $(addprefix _clean_,$(srctree) $(vmlinux-alldirs))
+clean-dirs := $(addprefix _clean_,$(srctree) $(vmlinux-alldirs) Documentation)
PHONY += $(clean-dirs) clean archclean
$(clean-dirs):
--- lin2625-rc8-docsrc.orig/Documentation/DocBook/Makefile
+++ lin2625-rc8-docsrc/Documentation/DocBook/Makefile
@@ -101,6 +101,13 @@ C-procfs-example = procfs_example.xml
C-procfs-example2 = $(addprefix $(obj)/,$(C-procfs-example))
$(obj)/procfs-guide.xml: $(C-procfs-example2)
+# List of programs to build
+##oops, this is a kernel module::hostprogs-y := procfs_example
+obj-m += procfs_example.o
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
+
notfoundtemplate = echo "*** You have to install docbook-utils or xmlto ***"; \
exit 1
db2xtemplate = db2TYPE -o $(dir $@) $<
--- /dev/null
+++ lin2625-rc8-docsrc/Documentation/auxdisplay/Makefile
@@ -0,0 +1,10 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := cfag12864b-example
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
+
+HOSTCFLAGS_cfag12864b-example.o += -I$(objtree)/usr/include
--- /dev/null
+++ lin2625-rc8-docsrc/Documentation/connector/Makefile
@@ -0,0 +1,9 @@
+obj-m += cn_test.o
+
+# List of programs to build
+hostprogs-y := ucon
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
+
+HOSTCFLAGS_ucon.o += -I$(objtree)/usr/include
--- /dev/null
+++ lin2625-rc8-docsrc/Documentation/ia64/Makefile
@@ -0,0 +1,8 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := aliasing-test
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
--- /dev/null
+++ lin2625-rc8-docsrc/Documentation/networking/Makefile
@@ -0,0 +1,8 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := ifenslave
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
--- /dev/null
+++ lin2625-rc8-docsrc/Documentation/pcmcia/Makefile
@@ -0,0 +1,10 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := crc32hash
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
+
+HOSTCFLAGS_crc32hash.o += -I$(objtree)/usr/include
--- /dev/null
+++ lin2625-rc8-docsrc/Documentation/spi/Makefile
@@ -0,0 +1,11 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := spidev_test spidev_fdx
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
+
+HOSTCFLAGS_spidev_test.o += -I$(objtree)/usr/include
+HOSTCFLAGS_spidev_fdx.o += -I$(objtree)/usr/include
--- /dev/null
+++ lin2625-rc8-docsrc/Documentation/video4linux/Makefile
@@ -0,0 +1,8 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := v4lgrab
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
--- /dev/null
+++ lin2625-rc8-docsrc/Documentation/vm/Makefile
@@ -0,0 +1,8 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := slabinfo
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
--- /dev/null
+++ lin2625-rc8-docsrc/Documentation/watchdog/src/Makefile
@@ -0,0 +1,8 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := watchdog-simple watchdog-test
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
--- /dev/null
+++ lin2625-rc8-docsrc/Documentation/filesystems/configfs/Makefile
@@ -0,0 +1 @@
+obj-m += configfs_example.o
--- lin2625-rc8-docsrc.orig/lib/Kconfig.debug
+++ lin2625-rc8-docsrc/lib/Kconfig.debug
@@ -621,4 +621,12 @@ config PROVIDE_OHCI1394_DMA_INIT
See Documentation/debugging-via-ohci1394.txt for more information.
+menuconfig BUILD_DOCSRC
+ bool "Build targets in Documentation/ tree"
+ help
+ This option attempts to build objects from the source files in the
+ kernel Documentation/ tree.
+
+ Say N if you are unsure.
+
source "samples/Kconfig"
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] documentation: build source files in Documentation sub-dir
2008-04-09 19:35 ` [PATCH v2] " Randy Dunlap
@ 2008-04-09 21:54 ` Andrew Morton
2008-04-11 0:56 ` Randy Dunlap
2008-04-09 22:52 ` Nick Andrew
1 sibling, 1 reply; 9+ messages in thread
From: Andrew Morton @ 2008-04-09 21:54 UTC (permalink / raw)
To: Randy Dunlap
Cc: linux-kernel, linux-kbuild, sam, Ingo Molnar, Thomas Gleixner
On Wed, 9 Apr 2008 12:35:51 -0700
Randy Dunlap <randy.dunlap@oracle.com> wrote:
> On Tue, 8 Apr 2008 13:46:13 -0700 Andrew Morton wrote:
>
> > On Thu, 3 Apr 2008 12:45:29 -0700 Randy Dunlap <randy.dunlap@oracle.com> wrote:
> >
> > > Currently source files in the Documentation/ sub-dir can easily bit-rot
> > > since they are not generally buildable, either because they are hidden
> > > in text files or because there are no Makefile rules for them.
> > > This needs to be fixed so that the source files remain usable and good
> > > examples of code instead of bad examples.
> > >
> > > Add the ability to build source files that are in the Documentation/ dir.
> > > Add to Kconfig as "BUILD_DOCSRC" config symbol.
> > >
> > > Use "CONFIG_BUILD_DOCSRC=1 make ..." to build objects from the
> > > Documentation/ sources. Or enable BUILD_DOCSRC in the *config system.
> > >
> > > The Makefiles use $objdir/usr/include for header files, so doing
> > > "make headers_install" is required. This is done for you if you enable
> > > CONFIG_HEADERS_CHECK=y.
> > >
> > > Note: needs documentation-move-spidev_fdx-example-to-its-own-source-file.patch
> > > from -mm patchset.
> >
> > argh, I'm getting several warnings and at least two build errors from this.
> > One is:
> >
> > In file included from /usr/src/devel/usr/include/linux/netlink.h:5,
> > from /usr/src/devel/usr/include/linux/genetlink.h:4,
> > from Documentation/accounting/getdelays.c:26:
> > /usr/src/devel/usr/include/linux/types.h:166: error: expected specifier-qualifier-list before '__kernel_daddr_t'
> >
> > (i386 allmodconfig).
> >
> > I think I'll disable this patch for now..
>
> Oh drat and curses.
>
> Change all -I$(srctree) in Makefiles to -I$(objtree).
> New (full) patch file with only that change is below.
> I can send a patch with only those changes if you prefer that.
>
> Cross-build using O= works now.
I wasn't using O=.
It turns out that this is breakage introduced by git-x86.patch.
Reproducible via:
setenv ARCH i386
make mrproper
make allmodconfig
gcc -I$(/bin/pwd)/include Documentation/accounting/getdelays.c -o getdelays
In file included from /usr/src/devel/include/linux/netlink.h:5,
from /usr/src/devel/include/linux/genetlink.h:4,
from Documentation/accounting/getdelays.c:26:
/usr/src/devel/include/linux/types.h:203: error: expected specifier-qualifier-list before '__kernel_daddr_t'
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] documentation: build source files in Documentation sub-dir
2008-04-09 19:35 ` [PATCH v2] " Randy Dunlap
2008-04-09 21:54 ` Andrew Morton
@ 2008-04-09 22:52 ` Nick Andrew
2008-04-09 23:53 ` Randy Dunlap
1 sibling, 1 reply; 9+ messages in thread
From: Nick Andrew @ 2008-04-09 22:52 UTC (permalink / raw)
To: Randy Dunlap; +Cc: Andrew Morton, lkml, linux-kbuild, samr
On Wed, Apr 09, 2008 at 12:35:51PM -0700, Randy Dunlap wrote:
> +##oops, this is a kernel module::hostprogs-y := procfs_example
Is this intentional? It looks like you commented-out a mistake.
Nick.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] documentation: build source files in Documentation sub-dir
2008-04-09 22:52 ` Nick Andrew
@ 2008-04-09 23:53 ` Randy Dunlap
0 siblings, 0 replies; 9+ messages in thread
From: Randy Dunlap @ 2008-04-09 23:53 UTC (permalink / raw)
To: Nick Andrew; +Cc: Andrew Morton, lkml, linux-kbuild, samr
Nick Andrew wrote:
> On Wed, Apr 09, 2008 at 12:35:51PM -0700, Randy Dunlap wrote:
>> +##oops, this is a kernel module::hostprogs-y := procfs_example
>
> Is this intentional? It looks like you commented-out a mistake.
Nope. I have no idea where that came from. Fixed in my patches.
Thanks.
--
~Randy
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] documentation: build source files in Documentation sub-dir
2008-04-09 21:54 ` Andrew Morton
@ 2008-04-11 0:56 ` Randy Dunlap
2008-04-11 1:11 ` Andrew Morton
0 siblings, 1 reply; 9+ messages in thread
From: Randy Dunlap @ 2008-04-11 0:56 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-kernel, linux-kbuild, sam, Ingo Molnar, Thomas Gleixner
On Wed, 9 Apr 2008 14:54:09 -0700 Andrew Morton wrote:
> On Wed, 9 Apr 2008 12:35:51 -0700
> Randy Dunlap <randy.dunlap@oracle.com> wrote:
>
> > On Tue, 8 Apr 2008 13:46:13 -0700 Andrew Morton wrote:
> >
> > > On Thu, 3 Apr 2008 12:45:29 -0700 Randy Dunlap <randy.dunlap@oracle.com> wrote:
> > >
> > > > Currently source files in the Documentation/ sub-dir can easily bit-rot
> > > > since they are not generally buildable, either because they are hidden
> > > > in text files or because there are no Makefile rules for them.
> > > > This needs to be fixed so that the source files remain usable and good
> > > > examples of code instead of bad examples.
> > > >
> > > > Add the ability to build source files that are in the Documentation/ dir.
> > > > Add to Kconfig as "BUILD_DOCSRC" config symbol.
> > > >
> > > > Use "CONFIG_BUILD_DOCSRC=1 make ..." to build objects from the
> > > > Documentation/ sources. Or enable BUILD_DOCSRC in the *config system.
> > > >
> > > > The Makefiles use $objdir/usr/include for header files, so doing
> > > > "make headers_install" is required. This is done for you if you enable
> > > > CONFIG_HEADERS_CHECK=y.
> > > >
> > > > Note: needs documentation-move-spidev_fdx-example-to-its-own-source-file.patch
> > > > from -mm patchset.
> > >
> > > argh, I'm getting several warnings and at least two build errors from this.
> > > One is:
> > >
> > > In file included from /usr/src/devel/usr/include/linux/netlink.h:5,
> > > from /usr/src/devel/usr/include/linux/genetlink.h:4,
> > > from Documentation/accounting/getdelays.c:26:
> > > /usr/src/devel/usr/include/linux/types.h:166: error: expected specifier-qualifier-list before '__kernel_daddr_t'
> > >
> > > (i386 allmodconfig).
> > >
> > > I think I'll disable this patch for now..
> >
> > Oh drat and curses.
> >
> > Change all -I$(srctree) in Makefiles to -I$(objtree).
> > New (full) patch file with only that change is below.
> > I can send a patch with only those changes if you prefer that.
> >
> > Cross-build using O= works now.
>
> I wasn't using O=.
>
> It turns out that this is breakage introduced by git-x86.patch.
> Reproducible via:
>
> setenv ARCH i386
> make mrproper
> make allmodconfig
> gcc -I$(/bin/pwd)/include Documentation/accounting/getdelays.c -o getdelays
>
> In file included from /usr/src/devel/include/linux/netlink.h:5,
> from /usr/src/devel/include/linux/genetlink.h:4,
> from Documentation/accounting/getdelays.c:26:
> /usr/src/devel/include/linux/types.h:203: error: expected specifier-qualifier-list before '__kernel_daddr_t'
Those __kernel_* types shouldn't be used outside of the #ifdef __KERNEL__
block, should they?
Patch below fixes kernel side for me. Don't have any idea what it
may do to userspace users of the header file.
---
include/linux/types.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- mmotm-2008-0410-0157.orig/include/linux/types.h
+++ mmotm-2008-0410-0157/include/linux/types.h
@@ -200,8 +200,8 @@ typedef u32 resource_size_t;
#endif /* __KERNEL__ */
struct ustat {
- __kernel_daddr_t f_tfree;
- __kernel_ino_t f_tinode;
+ daddr_t f_tfree;
+ ino_t f_tinode;
char f_fname[6];
char f_fpack[6];
};
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] documentation: build source files in Documentation sub-dir
2008-04-11 0:56 ` Randy Dunlap
@ 2008-04-11 1:11 ` Andrew Morton
2008-04-13 14:05 ` Thomas Gleixner
0 siblings, 1 reply; 9+ messages in thread
From: Andrew Morton @ 2008-04-11 1:11 UTC (permalink / raw)
To: Randy Dunlap
Cc: linux-kernel, linux-kbuild, sam, Ingo Molnar, Thomas Gleixner
On Thu, 10 Apr 2008 17:56:30 -0700 Randy Dunlap <randy.dunlap@oracle.com> wrote:
> On Wed, 9 Apr 2008 14:54:09 -0700 Andrew Morton wrote:
>
> > make allmodconfig
> > gcc -I$(/bin/pwd)/include Documentation/accounting/getdelays.c -o getdelays
> >
> > In file included from /usr/src/devel/include/linux/netlink.h:5,
> > from /usr/src/devel/include/linux/genetlink.h:4,
> > from Documentation/accounting/getdelays.c:26:
> > /usr/src/devel/include/linux/types.h:203: error: expected specifier-qualifier-list before '__kernel_daddr_t'
>
>
> Those __kernel_* types shouldn't be used outside of the #ifdef __KERNEL__
> block, should they?
>
> Patch below fixes kernel side for me. Don't have any idea what it
> may do to userspace users of the header file.
>
> ---
> include/linux/types.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> --- mmotm-2008-0410-0157.orig/include/linux/types.h
> +++ mmotm-2008-0410-0157/include/linux/types.h
> @@ -200,8 +200,8 @@ typedef u32 resource_size_t;
> #endif /* __KERNEL__ */
>
> struct ustat {
> - __kernel_daddr_t f_tfree;
> - __kernel_ino_t f_tinode;
> + daddr_t f_tfree;
> + ino_t f_tinode;
> char f_fname[6];
> char f_fpack[6];
> };
hm.
It'd be nice to know how git-x86 managed to make this happen. I haven't
looked, apart from noting that it doesn't seem to touch any of the relevant
files.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] documentation: build source files in Documentation sub-dir
2008-04-11 1:11 ` Andrew Morton
@ 2008-04-13 14:05 ` Thomas Gleixner
0 siblings, 0 replies; 9+ messages in thread
From: Thomas Gleixner @ 2008-04-13 14:05 UTC (permalink / raw)
To: Andrew Morton; +Cc: Randy Dunlap, linux-kernel, linux-kbuild, sam, Ingo Molnar
On Thu, 10 Apr 2008, Andrew Morton wrote:
> > struct ustat {
> > - __kernel_daddr_t f_tfree;
> > - __kernel_ino_t f_tinode;
> > + daddr_t f_tfree;
> > + ino_t f_tinode;
> > char f_fname[6];
> > char f_fpack[6];
> > };
>
> hm.
>
> It'd be nice to know how git-x86 managed to make this happen. I haven't
> looked, apart from noting that it doesn't seem to touch any of the relevant
> files.
Hmm, something must define __KERNEL_STRICT_NAMES to make this happen,
but there is nothing in the entire kernel tree which defines it.
Thanks,
tglx
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2008-04-13 14:05 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-03 19:45 [PATCH] documentation: build source files in Documentation sub-dir Randy Dunlap
2008-04-08 20:46 ` Andrew Morton
2008-04-09 19:35 ` [PATCH v2] " Randy Dunlap
2008-04-09 21:54 ` Andrew Morton
2008-04-11 0:56 ` Randy Dunlap
2008-04-11 1:11 ` Andrew Morton
2008-04-13 14:05 ` Thomas Gleixner
2008-04-09 22:52 ` Nick Andrew
2008-04-09 23:53 ` Randy Dunlap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox