Order-of-includes issue building newlib [ RE: Build error CVS head ]

Dave Korn dave.korn@artimi.com
Sun Jun 17 03:34:00 GMT 2007

On 17 June 2007 03:41, Dave Korn wrote:

> On 17 June 2007 01:34, Brian Dessent wrote:
>> Dave Korn wrote:

>>> /usr/build/src-winsup/newlib/libc/search/tdelete.c:34: error: `node_t'
>>> undeclared (first use in this function)
>> Likely culprit seems to be
>> <http://sourceware.org/ml/cygwin-cvs/2007-q2/msg00033.html> and the
>> removal of node_t.
>   Indirectly; the actual problem is that an internal winsup/cygwin header
> by the name 'search.h' is overriding the desired internal newlib/libc
> 'search.h' header during compilation of newlib/libc.  There's not
> intrinsically a problem with newlib and cygwin each having a separate
> 'search.h' just so long as each one, while compiling, finds its own one
> first in the include search path - in this particular case, files from
> .../winsup/cygwin/include should not come earlier in the search path than
> files from .../newlib/libc/include while compiling newlib (but they should
> while compiling cygwin).        

  I think this arises because configure.host (line 508) first does this:

	CC="${CC} -I${cygwin_srcdir}/include"

then later, configure (line 10884) does this:

  CC_FOR_NEWLIB="${CC} -I$PWD/targ-include

although it's also possible that the intention of configure.host is that
cygwin include headers are /meant/ to override newlib's own ones, in which
case Corinna's patch should have kept the private stuff.

Can't think of a witty .sigline today....

More information about the Newlib mailing list