[CMake] Regression between 2.4.8 and 2.6.2 for the macada version of the gcc compiler

Alan W. Irwin irwin at beluga.phys.uvic.ca
Thu Jan 29 20:36:37 EST 2009


On 2009-01-29 13:46-0500 Brad King wrote:

> Hendrik Sattler wrote:
>> Martin Costabel schrieb:
>>> Alan W. Irwin wrote:
>>> []
>>>> Is there a better gcc option then -v to find out the _actual_ linker
>>>> being
>>>> used?
>>> Use -Wl,-v :-)
>>>
>>> On 10.4, if you run gcc -dynamiclib, the linking is managed by
>>> /usr/bin/libtool which in turn calls /usr/bin/ld, and /usr/bin/libtool
>>> understands the -current_version flag. On the other hand, /usr/bin/ld
>>> does not understand "-current_version", it wants
>>> "-dylib_current_version", which it gets fed by /usr/bin/libtool, but
>>> "-dylib_current_version" is not understood by /usr/bin/libtool. Clear? ;-)
>>
>> Well, gcc-4.3.2 documentation says to use "-current_version" which gets
>> passed to the linker, not "-Wl,-current_version". Maybe it adapts the
>> the option to the program actually being called? If not, that should be
>> reported as bug against gcc.
>
> Thanks.  I've committed a fix to Darwin.cmake to remove the -Wl, part:
>
> /cvsroot/CMake/CMake/Modules/Platform/Darwin.cmake,v  <--
> Modules/Platform/Darwin.cmake
> new revision: 1.55; previous revision: 1.54
>
> Alan, please have the user try the patch below to 2.6.2.
>
> -Brad
>
> diff --git cmake-2.6.2-orig/Modules/Platform/Darwin.cmake cmake-2.6.2/Modules/Platform/Darwin.cmake
> index c0a8600..da54cd7 100644
> --- cmake-2.6.2-orig/Modules/Platform/Darwin.cmake
> +++ cmake-2.6.2/Modules/Platform/Darwin.cmake
> @@ -27,8 +27,8 @@ SET(CMAKE_SHARED_MODULE_SUFFIX ".so")
> SET(CMAKE_MODULE_EXISTS 1)
> SET(CMAKE_DL_LIBS "")
>
> -SET(CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG -Wl,-compatibility_version,)
> -SET(CMAKE_C_OSX_CURRENT_VERSION_FLAG -Wl,-current_version,)
> +SET(CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ")
> +SET(CMAKE_C_OSX_CURRENT_VERSION_FLAG "-current_version ")
> SET(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")
> SET(CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}")

That works perfectly for him both for the simple test and the PLplot build!

Thanks, Henrik, for being sharp-eyed enough to spot that
-compatibility_version and  -current_version were what appeared in
the gcc documentation (I also confirm this with "info gcc") and not the
-Wl, variants used by 2.6.x Darwin.cmake up to now.

Brad, I hope this fix gets into 2.6.3.

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
__________________________


More information about the CMake mailing list