Date: Sun, 3 Jul 2011 16:15:09 +0200 From: Robert Millan <rmh@debian.org> To: Benjamin Kaduk <kaduk@mit.edu> Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] Remove -nostdinc in aicasm Message-ID: <CAOfDtXPM_=-8-KQDcUbkqCvYDj2=KcMmDS06J0C00ecRViRXpQ@mail.gmail.com> In-Reply-To: <CAOfDtXPS6VAAVXtencXdzQ_VmHQT3=pkm7AB9_Po4tqGW49T0A@mail.gmail.com> References: <CAOfDtXNRwaa8VrnhXZsgFb3uPTFPxZYXtLWX3WHMAq8PQaP7Wg@mail.gmail.com> <alpine.GSO.1.10.1107021120450.6818@multics.mit.edu> <CAOfDtXPS6VAAVXtencXdzQ_VmHQT3=pkm7AB9_Po4tqGW49T0A@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
2011/7/2 Robert Millan <rmh@debian.org>:
> 2011/7/2 Benjamin Kaduk <kaduk@mit.edu>:
>> There is a functional difference between '-nostdinc -I/usr/include -I.' even
>> when the standard include search path is just /usr/include -- the standard
>> include paths are always searched last (unless -nostdinc is given), even if
>> they are explicitly listed on the command line. If there are conflicting
>> definitions in /usr/local/foo.h and ./foo.h, this gimmick can be necessary
>> to pull in the correct version. (I've needed to do this when packaging
>> software for the freebsd ports collection, though with /usr/local/include
>> replacing '.'.)
>
> In this case I'd rather be safe than sorry and use -iwithprefix or
> -isystem `gcc --print-file-name=` on GCC only.
I hope this patch is better. Please have a look.
--
Robert Millan
[-- Attachment #2 --]
Index: sys/dev/aic7xxx/aicasm/Makefile
===================================================================
--- sys/dev/aic7xxx/aicasm/Makefile (revision 223721)
+++ sys/dev/aic7xxx/aicasm/Makefile (working copy)
@@ -26,6 +26,13 @@
NOSTDINC= -nostdinc
CFLAGS+= ${NOSTDINC} -I/usr/include -I.
+# This is needed when using upstream GCC (whose <stddef.h>, etc, are
+# not re-enabled by -I/usr/inclde).
+.if ${CC:T:Mclang} != "clang"
+GCCINCDIR!= gcc --print-file-name=
+CFLAGS+= -I${GCCINCDIR}/include -I${GCCINCDIR}/include-fixed
+.endif
+
.ifdef MAKESRCPATH
CFLAGS+= -I${MAKESRCPATH}
.endif
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOfDtXPM_=-8-KQDcUbkqCvYDj2=KcMmDS06J0C00ecRViRXpQ>
