* [patch] 2.4.12 optionally prevent kbuild reading /usr/include
@ 2001-10-16 7:17 Keith Owens
0 siblings, 0 replies; only message in thread
From: Keith Owens @ 2001-10-16 7:17 UTC (permalink / raw)
To: linux-kernel; +Cc: torvalds
A few bits of kernel code are incorrectly reading from /usr/include,
giving different results on different distributions. kbuild 2.5 will
prevent this, all include files must be in the kernel tree. The patch
below (for 2.4.12 but fits 2.4.13-pre3) defines kbuild_2_4_nostdinc.
Linus, please add to 2.4.13-prex.
The various maintainers can optionally check that their code is not
reading from outside the kernel, see the comments in the patch. I
strongly recommend that maintainers check their code now, even if it is
only on their own machine. There is no need to patch the sub Makefiles
in Linus's tree, as long as the code has been tested.
Based on a suggestion by Christoph Hellwig.
Index: 12.1/Makefile
--- 12.1/Makefile Thu, 11 Oct 2001 20:11:18 +1000 kaos (linux-2.4/T/c/50_Makefile 1.1.2.15.1.2.2.25.2.2.1.17.1.4.1.29.1.4 644)
+++ 12.1(w)/Makefile Tue, 16 Oct 2001 17:08:15 +1000 kaos (linux-2.4/T/c/50_Makefile 1.1.2.15.1.2.2.25.2.2.1.17.1.4.1.29.1.4 644)
@@ -240,6 +240,16 @@ MRPROPER_DIRS = \
include arch/$(ARCH)/Makefile
+# Optional cflags for kbuild 2.4, to prevent individual files or an entire
+# directory including files from outside the kernel. To control an individual
+# file, use CFLAGS_foo.o += $(kbuild_2_4_nostdinc), to control an entire
+# directory use EXTRA_CFLAGS += $(kbuild_2_4_nostdinc). In kbuild 2.5 the
+# default is to forbid includes from outside the kernel tree, you can use this
+# variable in kbuild 2.4 to ensure that your code is clean before 2.5. KAO.
+
+kbuild_2_4_nostdinc := -nostdinc $(shell $(CC) -print-search-dirs | sed -ne 's/install: \(.*\)/-I \1include/gp')
+export kbuild_2_4_nostdinc
+
export CPPFLAGS CFLAGS AFLAGS
export NETWORKS DRIVERS LIBS HEAD LDFLAGS LINKFLAGS MAKEBOOT ASFLAGS
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-10-16 7:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-10-16 7:17 [patch] 2.4.12 optionally prevent kbuild reading /usr/include Keith Owens
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox