[phobos] 64 & 32 bit libraries for OSX
Michel Fortin
michel.fortin at michelf.com
Tue Nov 8 20:31:44 PST 2011
Le 2011-11-08 à 22:19, Michel Fortin a écrit :
> Le 2011-11-08 à 20:45, Walter Bright a écrit :
>
>> On Linux, the 64 bit and 32 bit libraries exist along separate paths, and we put both paths on the command to the linker:
>>
>> DFLAGS=-I%@P%/../../src/phobos -I%@P%/../../src/druntime/import -L-L%@P%/../lib32 -L-L%@P%/../lib64
>> -L--no-warn-search-mismatch -L--export-dynamic
>>
>> However, attempting to do this on OSX fails (using -L-no_arch_warnings instead of -L--no-warn-search-mismatch). It apparently always tries to link in the first library found, not the first one with matching architecture.
>>
>> What is the right way on OSX to do a dual-architecture library?
>
> Fuse both architectures into one "fat" file using lipo:
>
> lipo lib32/libphobos.a lib64/libphobos.a -create -output lib/libphobos.a
Also, you should do the same for the compiler binary file, assuming you release a 64-bit version of the compiler too. Instead of having separate 32 and 64 bit executables in separate folders, merge them into one using lipo.
--
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/
More information about the phobos
mailing list