autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gcc version ID in autoconf


From: Rainer Orth
Subject: Re: gcc version ID in autoconf
Date: 24 Jul 2003 13:25:48 +0200

Paul Eggert <address@hidden> writes:

> Harlan Stenn <address@hidden> writes:
> 
> > Apparently there is a bug in gcc-3.1 regarding -pipe; it causes "configure"
> > to just hang.
> > 
> > Is there a better way to detect the version of gcc in autoconf other than
> > parse the output of  "gcc --version" so I can avoid testing for -pipe when
> > I see that version of gcc?
> 
> I'd check for the bug directly.  Invoke 'gcc -pipe' in one subprocess,
> and have another one sleep for 5 seconds and then kill the first
> subprocess.  Check the exit status of the first subprocess.

It's a bit more involved than that: it fails for me in the following
circumstances:

conftest.c is

#include <net/if.h>

Then gcc -c -g -pipe conftest.c

just hangs after giving errors on Solaris 8/SPARC when using gcc 3.1:

In file included from conftest.c:1:
/usr/include/net/if.h:58: parse error before "ushort_t"
/usr/include/net/if.h:88: parse error before '}' token
/usr/include/net/if.h:225: field `ifa_addr' has incomplete type
/usr/include/net/if.h:227: field `ifu_broadaddr' has incomplete type
/usr/include/net/if.h:228: field `ifu_dstaddr' has incomplete type
/usr/include/net/if.h:234: confused by earlier errors, bailing out

It works if you omit -g, though.  On Solaris 9/SPARC, the identical binary
works even with -g:

In file included from conftest.c:1:
/usr/include/net/if.h:58: parse error before "ushort_t"
/usr/include/net/if.h:88: parse error before '}' token
/usr/include/net/if.h:232: field `ifa_addr' has incomplete type
/usr/include/net/if.h:234: field `ifu_broadaddr' has incomplete type
/usr/include/net/if.h:235: field `ifu_dstaddr' has incomplete type
/usr/include/net/if.h:241: confused by earlier errors, bailing out
/usr/ccs/bin/as: "<stdin>", line 32: error: unterminated string
/usr/ccs/bin/as: "<stdin>": error: invalid number of operands

With gcc 3.3.1 and 3.4, all is fine, even on Solaris 8.  So this seems to
be a combination of a gcc bug and (maybe) a bug in the native Solaris 8
assembler.

Since the conditions are so involved, I have already suggested to just omit
adding -pipe automatically and just let the user do it if he really needs
to.  Compared to the time it takes to configure ntp, compile time is
minimal and the small increase caused by omitting -pipe doesn't seem worth
the trouble to correctly test for those involved conditions.

        Rainer




reply via email to

[Prev in Thread] Current Thread [Next in Thread]