[CMake] CC, CXX, and FC environment variable regression in 2.8.1-rc4

Alan W. Irwin irwin at beluga.phys.uvic.ca
Sun Mar 14 16:47:53 EDT 2010


On 2010-03-14 15:28-0400 Bill Hoffman wrote:

> Perhaps adding the flags causes the compiler to be mis-identified somehow. 
> Can you run with the gcc -g -fvisibility=hidden, and without on a very simple 
> C only project.  Then send me the binary trees from both.  I am suspecting 
> there will be some sort of error in the compiler id code.

Better yet, let me send you a simple test case project (attached) where
you can easily demonstrate and investigate this issue for yourself.

Note, if you use

export CC='gcc -g'

all is well with this simple test case, and the -fPIC flag is used
appropriately.

However,

export CC='gcc -g -g'

triggers the bug with cmake-2.8.1-rc4.  (i.e., the -fPIC flag is incorrectly
dropped).  I didn't use -fvisibility=hidden for the second flag because
this simple project is not set up for that, and there should be no harm in 
simply repeating the -g flag.  But from my bad PLplot build result with

export CC='gcc -g -fvisibility=hidden'

I expect the dropped -fPIC problem will occur whenever there are two flags
of any kind.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_c_library_build.tar.gz
Type: application/octet-stream
Size: 1024 bytes
Desc: simple test project that illustrates dropped -fPIC bug
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100314/84a416f9/attachment.obj>


More information about the CMake mailing list