[Unison-hackers] Help building OSX GUI

Alan Schmitt alan.schmitt at polytechnique.org
Wed May 6 13:18:54 EDT 2009


On 6 mai 09, at 17:48, Martin von Gagern wrote:

> Alan Schmitt wrote:
>> On 5 mai 09, at 15:14, Martin von Gagern wrote:
>>> Undefined symbols:
>>> "_chmod$UNIX2003", referenced from:
>>>     _setFileInfos in unison-blob.o
>>>     _setFileInfos in unison-blob.o
>>>
>>> You shouldn't have to rebuild ocaml just to get a certain command  
>>> line
>>> argument passed on to the C compiler. The -ccopt flag does that. It
>>> might be that code compiled from ocaml source files does introduce
>>> additional dependencies if you don't rebuild ocaml, but as this  
>>> hasn't
>>> been a problem for me, I'll not worry about it here.
>>
>> The problem is the following: to provide a binary that work on both  
>> 10.4
>> and 10.5, one needs to say so when compiling both unison and ocaml.  
>> If
>> you use a Leopard-only ocaml when building a Tiger+Leopard Unison,  
>> you
>> get the above error (because ocaml libraries use Leopard-only  
>> symbols).
>
> Above as above, the one I quoted? That shouldn't be the case, because
> the above error message was caused by C files, where ocamlopt only
> invokes gcc, so what ocaml itself is built against should not matter.

It matters, because ocamlopt links the cmx files produced with the  
ocaml standard library (and other libraries, such as the unix one, if  
required). If the compiled ocaml library mentions Leopard specific  
symbols (because its C parts were compiled without specifying a target  
OS, thus by default it's the current OS), then when linking everything  
together, there is a mismatch between this 10.5 standard library and  
the requirement for the whole binary to be 10.4 or above. Is it clearer?

>> You were able to build a 10.4 build with a 10.5 ocaml?
>
> Probably not. I were able to get a 10.4 build with the ocaml fink
> installed and I didn't want to bother with. Upon closer inspection, it
> seems that fink does build this against the 10.4 SDK. At lkeast  
> there is
> some mentioning of MACOSX_DEPLOYMENT_TARGET 10.4 in the build info.

So it's a 10.4 ocaml (or to be specific: the C parts of the libraries  
are compiled as 10.4).

>> In any case, the approach is sound
>> and I would agree to incorporate the patch, as soon as doing a "make
>> MINOSXVERSION=10.4" fails with the undefined symbols above if using a
>> 10.5 ocaml.
>
> I don't have a ocaml for 10.5 around. If you do, can you give it a  
> try?

I don't either, but I could try to find one. I'll take a note of it.

> Why make the failure a requirement? If it doesn't fail, that might be
> because ocaml, even though it itself was build for 10.5, might  
> decide to
> be nice and only use 10.4 symbols in the objects it produces. I don't
> see anything wrong with that, even though I believe it's unlikely. In
> any case, if that should happen, then a 10.5 ocaml would be able to
> build unison binaries ready to run on 10.4, and I'd be happy with that
> as well. So I'd say yes, it will probably fail as you outlined, but if
> it doesn't, then that's even better.

As I said earlier, it's not the objects it produces but the library  
that were built when building ocaml, and unless they are compiled as  
10.4 they will reference problematic symbols.

Alan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
Url : http://lists.seas.upenn.edu/pipermail/unison-hackers/attachments/20090506/9fde249a/PGP-0001.sig


More information about the Unison-hackers mailing list