Version française
Home     About     Download     Resources     Contact us    
Browse thread
building 64bit ocaml from cvs on mac osx leopard
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From:
Subject: Re: [Caml-list] building 64bit ocaml from cvs on mac osx leopard
Excerpts from Joel Reymont's message of Fri Mar 06 11:40:13 +0100 2009:
> 
> On Mar 5, 2009, at 4:08 PM, Andres Varon wrote:
> 
> > I don't think that it compiles the way it is now. It seems to me  
> > that there was a version merge error and asmcomp/amd64/emit.mlp has  
> > repeated definitions  of emit_call and emit_jump.
> 
> 
> Here's the offending part of asmcomp/amd64/emit.mlp.
> 
> The two load_symbol_addr are equivalent and the only difference in the  
> rest is the Mac OSX check. /More after the code/
> 
> let emit_call s =
>    if !Clflags.dlcode && not macosx
>    then `call    {emit_symbol s}@PLT`
>    else `call    {emit_symbol s}`
> 
> let emit_jump s =
>    if !Clflags.dlcode && not macosx
>    then `jmp     {emit_symbol s}@PLT`
>    else `jmp     {emit_symbol s}`
> 
> let load_symbol_addr s =
>    if !Clflags.dlcode
>    then `movq    {emit_symbol s}@GOTPCREL(%rip)`
>    else if !pic_code
>    then `leaq    {emit_symbol s}(%rip)`
>    else `movq    ${emit_symbol s}`
> 
> 
> let emit_call s =
>    if !Clflags.dlcode
>    then `call    {emit_symbol s}@PLT`
>    else `call    {emit_symbol s}`
> 
> let emit_jump s =
>    if !Clflags.dlcode
>    then `jmp     {emit_symbol s}@PLT`
>    else `jmp     {emit_symbol s}`
> 
> let load_symbol_addr s =
>    if !Clflags.dlcode
>    then `movq    {emit_symbol s}@GOTPCREL(%rip)`
>    else if !pic_code
>    then `leaq    {emit_symbol s}(%rip)`
>    else `movq    ${emit_symbol s}`

The second part of this code have to be removed,
this is an undesirable behavior of merging some CVS branches.

However the CVS HEAD is not supposed to be as stable as the ocaml3110 branch.

> On my system dlcode is true and so is macosx so it should note be  
> taking the PLT branch. There's also this ocamlbuild rule for building  
> asmcomp/emit.ml from asmcomp/amd64/emit.mlp
> 
> let emit_mlp = "asmcomp"/C.arch/(if ccomptype = "msvc" then  
> "emit_nt.mlp" else "emit.mlp") in
> rule "emit.mlp"
>    ~prod:"asmcomp/emit.ml"
>    ~deps:[emit_mlp; "tools/cvt_emit.byte"]
>    begin fun _ _ ->
>      Cmd(S[ocamlrun; P"tools/cvt_emit.byte"; Sh "<"; P emit_mlp;
>            Sh">"; Px"asmcomp/emit.ml"])
>    end;;
> 
> I believe the issue is that distclean.sh does not remove ocamlopt in  
> the root of the ocaml source distribution. I was able to get past the  
> PLT error once I removed ocamlopt from the root of the tree and  
> modified asmcomp/amd64/emit.mlp to remove the second set of emit_call  
> and emit_jump functions that do not include Mac OSX checks.
> 
> I got a different error from fastworld.sh now and it does not seem to  
> be related to 64 bits.
> 
> + boot/ocamlyacc -v ocamldoc/odoc_text_parser.mly
> 5 shift/reduce conflicts.
> + ./ocamlc.opt -nostdlib -c -g -w Ale -warn-error Ale -I toplevel -pp  
> 'boot/ocamlrun camlp4/boot/camlp4boot.byte' -I camlp4 -I stdlib -I  
> camlp4/Camlp4Top -I camlp4/build -o camlp4/Camlp4Top/Top.cmo camlp4/ 
> Camlp4Top/Top.ml
> File "camlp4/Camlp4Top/Top.ml", line 37, characters 4-26:
> Error: Unbound value Toploop.print_location

This last error is rather strange, and I can't reproduce it, maybe it's
another strange build state error?

-- 
Nicolas Pouillard