[CMake] universal binary problems on mac

Bill Hoffman bill.hoffman at kitware.com
Tue Feb 6 12:23:30 EST 2007


Mike Jackson wrote:
>
>
> On Feb 6, 2007, at 10:39 AM, Bill Hoffman wrote:
>
>> Hi,
>>
>> So, the mac we run our cmake dashboards was "updated".  This caused 
>> the cmake dashboard to start to fail. The problem seems to be a 
>> change in the behavior of the lipo command.  Note, Xcode was not updated
>>
>> I think that this bug may have been fixed:
>>
>> http://lists.apple.com/archives/xcode-users/2006/Mar/msg00630.html
>>
>> Basically, the Xcode projects that cmake generates creates universal 
>> binaries by building all the code twice, then it combines static 
>> libraries into one "fat" library.  The error is as follows :
>> http://www.cmake.org/Testing/Sites/dashmacmini2.kitware/Darwin-Tiger-Xcode21-univ/20070206-0100-Nightly/BuildError.html 
>>
>>
>> /usr/bin/ld: warning -F: directory name 
>> (/.../CMake-Xcode/bin/Release) does not exist
>> /usr/bin/ld: table of contents for archive: 
>> /.../CMake-Xcode/Source/Release/libCMakeLib.a is out of date; rerun 
>> ranlib(1) (can't load from it)
>> /usr/bin/ld: table of contents for archive: 
>> /.../CMake-Xcode/Source/kwsys/Release/libcmsys.a is out of date; 
>> rerun ranlib(1) (can't load from it)
>> *collect2: ld returned 1 exit status*
>>
>>
>> I can add a build phase that runs ranlib after each library is 
>> created if universal binaries are requested, but this will slow the 
>> build. This seems like an Xcode bug.
>>
>> Have any of you OSX users out there seen this?
>>
>> The /usr/bin/lipo has a date of Aug 9 18:05 and is 149408 in size.
>> The Xcode is 2.2.
>>
>>
>> -Bill
>>
>
>
> There was recently some traffic on the Xcode users lists about 
> building UB from Make/AutoTools based projects.
>
> http://lists.apple.com/archives/Xcode-users/2007/Feb/msg00076.html
>
> Basically Xcode builds each arch into its own subdirectory (i386-32, 
> i386-64, ppc32, ppc64), then uses lipo to put together the resulting 
> binaries. Maybe Cmake can take this approach also.
>
> Also,
>    There is a long thread at
>
> http://lists.apple.com/archives/Xcode-users/2007/Jan/msg00304.html
>
> that discusses how to build UB with AutoTools based projects. Pay 
> attention to the posts by Bill Bumgarner as he works for Apple and he 
> has been down this path before. He has extremely good advice about how 
> to tackle this problem and what to look out for.
>
> I know this does not actually answer the question at hand but does 
> offer some advice.
The problem is not with the make based approach, the problem is with the 
Xcode approach.  Makefiles are working just fine with CMake and UB.  It 
is the Xcode approach that is broken.

-Bill



More information about the CMake mailing list