[LLVMdev] Just got bitten by accidentally using the wrong gcc

Joachim Durchholz jo at durchholz.org
Thu Mar 20 15:43:38 PDT 2008

Am Donnerstag, den 20.03.2008, 15:27 -0700 schrieb Shantonu Sen:
> llvm's ./configure already does that for gcc < 3.
> What are valid versions? Exactly 4.0 and 4.2? 4.0 and >=4.2?

There's a list at http://llvm.org/docs/GettingStarted.html#brokengcc so
there is a reasonable basis.
The list isn't comprehensive, of course, and will likely grow in the
future. OTOH extending it as new problems come up should be easy to do.

> dnl Verify that GCC is version 3.0 or higher
> if test "$GCC" = "yes"
> then
>    AC_COMPILE_IFELSE([[#if !defined(__GNUC__) || __GNUC__ < 3
> #error Unsupported GCC version
> #endif
> ]], [], [AC_MSG_ERROR([gcc 3.x required, but you have a lower  
> version])])
> fi

It might be simpler (and faster) to check the output of gcc -v.
Extending the list to other tools would be easier, too.

Anybody able to give model code for that?


More information about the llvm-dev mailing list