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

Ivan Levashew I.Levashew at bluebottle.com
Thu Feb 12 00:09:54 EST 2009


Alan W. Irwin wrote:
> 
>> I suspect the ada/gcc compiler calls ld directly without passing through
>> /usr/bin/libtool. If this is true, changing "-current_version" to
>> "-dylib_current_version" should solve the problem.
> 
> In Darwin.cmake, this user changed
> 
> SET(CMAKE_C_OSX_CURRENT_VERSION_FLAG -Wl,-current_version,)
> to
> SET(CMAKE_C_OSX_CURRENT_VERSION_FLAG -Wl,-dylib_current_version,)
> 
> and got 2.6.2 build success with the simple example.
> 
> He then went on to try and build PLplot, but ran into
> 
> /usr/bin/ld: unknown flag: -compatibility_version
> collect2: ld returned 1 exit status
> 
> Darwin.cmake sets
> 
> SET(CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG -Wl,-compatibility_version,)
> SET(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG 
> "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")
> 
> but I cannot figure out how (and in what context) these variables are used,
> and the macada user has currently not provided further details of the above
> error.  (If necessary, I could get the context from him, and set up a 
> simple
> test to illustrate the problem, but it appears Brad foretold that
> compatibility version would be an issue as well so a special test may not
> be necessary to investigate this error any further.)
> 
> This user then changed Darwin.cmake following Brad's compatibility version
> workaround advice:
> 
> SET(CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG)
> SET(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG)
> 
> and PLplot built using CMake-2.6.2 without any further problems!
> 
> My thanks to Brad and Martin for helping this user get this far.
> 
> Brad, do you now have enough information to permanently fix the
> -current_version and -compatibility_version issues for macada gcc for the
> forthcoming 2.6.3 release or do you need more information from this user?
> Also, if there is some patched version of Darwin.cmake you would like 
> him to
> try, I would be happy to pass it on to him.
> 

See my message on gmane.comp.lang.ada.macosx:

http://mid.gmane.org/gmu2r1%24edm%242%40ger.gmane.org

 >>> Jerry wrote:
 >>>> according to the gcc documentation the names of the options are
 >>>> -compatibility_version and -current_version without the -Wl, i.e.,
 >>>> these options are meant to be interpreted by gcc rather than passed
 >>>> directly to the linker."
 >>>>
 >>>> Jerry
 >>>>
 >> On Feb 8, 2009, at 9:12 PM, Ivan Levashew wrote:
 >>
 >>> Hmmm... Right, ld expects some other options. According to my ld man
 >>> page, -dylib_compatibility_version number and -dylib_current_version
 >>> number must be used instead. So far:
 >>>
 >>> # gcc -compatibility_version @@@
 >>> equals to
 >>> # gcc -Wl,-dylib_compatibility_version,@@@
 >>>
 >>> and
 >>>
 >>> # gcc -current_version @@@
 >>> equals to
 >>> # gcc -Wl,-dylib_current_version,@@@
 >>>
 >>> And this should also work with MacAda
 >>>
 > Jerry wrote:
 >> Thanks for the information, Ivan. I think the PLplot and cmake people
 >> consider the problem solved but I'll make sure they get your note.
 >>
 >
 > I've found their solution.
 >
 > 
http://mid.gmane.org/alpine.DEB.2.00.0901290855280.17157%40ybpnyubfg.ybpnyqbznva 

 >
 > Alan W. Irwin wrote:
 >> In Darwin.cmake, this user [Jerry] changed
 >>
 >> SET(CMAKE_C_OSX_CURRENT_VERSION_FLAG -Wl,-current_version,)
 >> to
 >> SET(CMAKE_C_OSX_CURRENT_VERSION_FLAG -Wl,-dylib_current_version,)
 >>
 >> and got 2.6.2 build success with the simple example.
 >>
 >> He then went on to try and build PLplot, but ran into
 >>
 >> /usr/bin/ld: unknown flag: -compatibility_version
 >> collect2: ld returned 1 exit status
I wrote:
 >
 > Strange enough, why don't they do the same for compatibility_version ?
 >
 > According to
 >
 > http://mid.gmane.org/4981F98D.4040305%40kitware.com
 >
 > they have deleted '-Wl,' as opposed to inserting 'dylib_'.

-- 
If you want to get to the top, you have to start at the bottom



More information about the CMake mailing list