[Xapian-devel] Xapian core build failure under gcc 2.95

Olly Betts olly at survex.com
Mon Jan 19 08:17:49 GMT 2009


On Fri, Jan 16, 2009 at 01:02:22PM +1300, David Sainty wrote:
> I don't think gcc's behaviour here is universally true of all compilers 
> (implying the source directory as an include path entry), but in saying 
> that I'm not sure of a counterexample either.

I've successfully compiled Xapian with quite a few different compilers
without encountering problems with this (at least GCC, Intel, Sun, HP,
SGI).

My understanding is that #include with "" implicitly adds the source
directory to the search path (whereas #include with <> doesn't).

I'm reluctant to start coding around behaviour which compilers *might*
have, as that's a very open-ended list.

But if anyone has actual evidence of a compiler which doesn't behave this
way, we probably need to explicitly add -I options for several other
subdirectories which rely on this behaviour.

> Obviously 2.95(.4) has the required behaviour in some form, but is
> confused by the #line lines.

My guess is that this is because it uses a separate preprocessor and
relies on "#line" in the preprocessor output to tell the compiler the
filename of the source file.  GCC 2.95 is adding the source directory
to the search path but is confused as to what the source directory
is.

This is the patch I've actually applied to trunk, which fixes up "#line"
directives rather than nuking them (depcomp parses preprocessor output
for "#line" so we no longer need that workaround):

http://trac.xapian.org/changeset/11823/trunk/xapian-core/queryparser/Makefile.mk?format=diff&new=11823

I'd be grateful if you could try this (it should apply to 1.0.10 cleanly).
If it works I'll backport it for 1.0.11.

> Yeah, it's in use on some old systems that are long long overdue for 
> updates. A separate project is working on that, but it's not a variable 
> I can control. Essentially it's the usual reasons - the more important 
> the server the harder it is to regularly maintain it :)

OK.  I guess that's a minor argument for keeping GCC 2.95 support,
though it's problematic that we aren't regularly testing it.  At some
point we're going to have to just start telling people to upgrade.

Cheers,
    Olly



More information about the Xapian-devel mailing list