linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Keith Owens <kaos@ocs.com.au>
To: linux-kernel@vger.kernel.org
Cc: torvalds@transmeta.com
Subject: [patch] 2.4.12 optionally prevent kbuild reading /usr/include
Date: Tue, 16 Oct 2001 17:17:45 +1000	[thread overview]
Message-ID: <21371.1003216665@kao2.melbourne.sgi.com> (raw)

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


                 reply	other threads:[~2001-10-16  7:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=21371.1003216665@kao2.melbourne.sgi.com \
    --to=kaos@ocs.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).