Date: Wed, 16 Sep 2015 04:19:14 +0300 From: Dmitry Marakasov <amdmi3@amdmi3.ru> To: Baptiste Daroussin <bapt@FreeBSD.org> Cc: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: Re: svn commit: r397026 - head/Mk/Uses Message-ID: <20150916011914.GG3910@hades.panopticon> In-Reply-To: <20150915222216.GA35129@ivaldir.etoilebsd.net> References: <201509152124.t8FLOgeN003164@repo.freebsd.org> <20150915222216.GA35129@ivaldir.etoilebsd.net>
next in thread | previous in thread | raw e-mail | index | archive | help
* Baptiste Daroussin (bapt@FreeBSD.org) wrote: > On Tue, Sep 15, 2015 at 09:24:42PM +0000, Dmitry Marakasov wrote: > > Author: amdmi3 > > Date: Tue Sep 15 21:24:42 2015 > > New Revision: 397026 > > URL: https://svnweb.freebsd.org/changeset/ports/397026 > > > > Log: > > - Use -isystem instead of -I to add ${LOCALBASE}/include to the list of header search paths > > > > First, this prevents ports which use strict -Werror settings from > > build failures in third party headers (real life example is > > devel/pructl which uses -Werror -Weverything and fails in libedit > > header on actually harmless padding warning). > > > > Second, this prevents ports which install headers from picking up > > their own headers from LOCALBASE instead of using ones from WRKDIR, > > which leads to any kind of problems when upgrading via ports. > > > > PR: 203101 > > Approved by: bapt > > Differential Revision: D3618 > > Just to give a bit more information. > Both clang and gcc will lookup for includes (cross building case taken appart) > in that order: > > 1. -Isomthing > 2. -isystem something > 3. /usr/include (plus internal path) > > Meaning some ports were messed up by the fact we used to add -I${LOCALBASE} in > *FLAGS and their build system also providing -I. by having a lookup path that > looks like the following: > > 1. -I${LOCALBASE}/include (first in the CFLAG) > 2. -I. > 3. -isystem > 4. internal > > Meaning if a header is both in the localbase (older version already installed) > and in sources (newer version) the older version will be used which can result > in a lot of different breakage (either silent wrong macros definitions) or > noisy: building errors and other kind of crap. And to clarify even a bit more, if a single directory is specified as both -I and -isystem, e.g. -I/usr/local/include -I. -isystem /usr/local/include -I is actually ignored. That is, this example will leed to the following lookup: 1. -I. 2. -isystem /usr/local/include 3. internal Thus USES=localbase should reliably save us from the case where port build picks up this ports' includes from LOCALBASE instead of WRKDIR. -- Dmitry Marakasov . 55B5 0596 FF1E 8D84 5F56 9510 D35A 80DD F9D2 F77D amdmi3@amdmi3.ru ..: jabber: amdmi3@jabber.ru http://amdmi3.ru
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150916011914.GG3910>