autoconf
[Top][All Lists]
Advanced

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

Question about autoconfig configure tests and interprocedural optimizati


From: Cox, Robert
Subject: Question about autoconfig configure tests and interprocedural optimization
Date: Fri, 28 Sep 2007 16:38:20 -0700

Hello list members,

 

We've run into a difficulty using autoconf with the Intel compiler, and
would like to know if there is any known workaround or someone has an
idea on how to handle this issue.

 

The autoconf tool generates a configure script, which when invoked,
creates a number of tests which are compiled and linked to see if
certain system functions are available.  For example, the test for the
existence of mkstemps() on our system looks like:

 

// Lots of headers and includes

 

char (*f) () = mktemps; 

int 

main()

{

  return f != mktemps; 

  ;

 return 0; 

} 

 

The intent of such a test is to fail with an unresolved reference to
mktemps if mktemps is not available.  This works OK with the Intel
compiler as long as we do not compile it with -ipo, but when we do, the
compiler notices that the "f != mktemps" is always false and simplifies
the program to 

 

main()

{

  return 0;

} 

 

which makes it useless as a test for whether mkstemps() is actually
available.

 

So ... here are some questions: 

(1)    Is there anyway to specify that these conftests actually get
compiled with a different optimization level (like  -O0), rather than
with the flags (CFLAGS, CXXFLAGS, LDFLAGS) that are passed to build the
application?

(2)    What are  the chances we could get the "f != mktemps" test
replaced by something like "(void *)(-1) != mktemps" which would not get
optimized away at -ipo?  (We also considered asking for "0 != mktemps",
but worried that we might be able to optimize this away as well, if not
today, at some time in the future.  Does someone have a suggestion for a
better test?

(3)    Is there a known, relatively painless (having to run sed on on
the resulting config file or come up with literal assignments for the
test results for every one of the system function tests NOT relatively
painless) workaround for this issue?  

(4)    Can we specify a different compiler for the conftests (like
Microsoft Visual Studio or GCC) than we do for the application build
(Intel compiler)?

(5)    Any other suggestions?

-- Thanks in advance, 

    Robert Cox

    Project Lead: Interprocedural Optimizations 

    Intel Compiler Lab 

 

 

 



reply via email to

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