[CMake] Regression between 2.4.8 and 2.6.2 for the macada version of the gcc compiler
Brad King
brad.king at kitware.com
Thu Jan 29 13:46:37 EST 2009
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}")
More information about the CMake
mailing list