svn commit: r397026 - head/Mk/Uses
Dmitry Marakasov
amdmi3 at amdmi3.ru
Wed Sep 16 01:20:10 UTC 2015
* Baptiste Daroussin (bapt at 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 at amdmi3.ru ..: jabber: amdmi3 at jabber.ru http://amdmi3.ru
More information about the svn-ports-head
mailing list