This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Dealing with compilers that pretend to be GCC

On 19/01/2012 16:51, Ludovic CourtÃs wrote:

> Right.  But how would you write feature tests that would check (1)
> whether the GNU C language is supported, 

  Try and compile a conftest that uses it.  If you wanted a possibly
over-engineered solution, write one conftest for each feature of GNU C that
you might want to use; otherwise maybe just write one conftest that uses as
many different features as you can think of.

> and (2) whether GCC plug-ins are supported?

  Write a conftest that actually compiles a minimal basic gcc plugin, attempts
to invoke the compiler with it, and looks for it to output "Hello world" or
whatever.  That could be tricky because I guess you won't be able to use
libtool at configure time.  Maybe you could just try invoking the compiler
with the right options to load the lto-plugin, check that that works, then
invoke it with a -plugin option pointing to a non-existent file name and make
sure that that fails, just to be sure that the compiler is actually using the
option flag and not just ignoring it.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]