Version française
Home     About     Download     Resources     Contact us    
Browse thread
Trying out Ocaml CVS HEAD
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Dario Teixeira <darioteixeira@y...>
Subject: Re: [Caml-list] Trying out Ocaml CVS HEAD
> 
> I've been able to reproduce the problem in byte-code only, when the main 
> program is linked in -custom mode. The reason is that the -Wl,-E was not 
> passed to the linker. This is now fixed in the CVS. (For a quick test, 
> you can try to pass "-ccopt -Wl,-E" explicitly to ocamlc when linking.)
> 
> For the native-code, I don't know. Can you show me the command line 
> passed to the linker (ocamlopt -verbose)? You should see -Wl,-E.
> If you compile with -noautolink, you must add "-ccopt -Wl,-E" manually.
> 

Hi Alain,

Thanks for the help.  I have recompiled the Ocaml compiler using the latest
CVS, and bytecode now seems to work fine.  As for native code, I am still
having some problems.  There's a subset of modules that load fine, but
also one module that produces an error message when the main programme
attempts to load it.  As far as I can tell, what distinguishes this
problematic module from the ones that work fine is the fact that its cmxs
file is built from a large number of cmx files, whereas the cmxs from a
"good" module is built from a single cmx.

Here are the compiler lines that build the cmx and cmxs for a good module:
(note the "-dlcode" used to build the cmx and the "-dlcode -shared -linkall"
used to link the cmxs)

ocamlfind ocamlopt  -thread -package netstring,camlzip,sqlite3 -I ../lwt -I
../baselib -I ../http -I ../xmlp4 -I ../server -I ../extensions -I ../eliom 
-dlcode -c deflatemod.ml

ocamlfind ocamlopt  -thread -package netstring,camlzip,sqlite3 -I ../lwt -I
../baselib -I ../http -I ../xmlp4 -I ../server -I ../extensions -I ../eliom
-dlcode -shared -linkall -o deflatemod.cmxs deflatemod.cmx


The lines for the problematic module are (almost) identical, except that the
order of arguments is not the same, and the linking stage takes multiple cmx
arguments instead of just one:

ocamlfind ocamlopt -dlcode -verbose -thread -package netstring,cryptokit -I
../lwt -I ../baselib -I ../http -I ../xmlp4 -I
../server -I ../extensions -I ../eliom -shared -linkall -o eliom.cmxs \
        error_pages.cmx \
        eliommod_sessiongroups.cmx eliom_common.cmx \
        eliommod_gc.cmx eliommod_persess.cmx \
        eliommod_sessadmin.cmx eliommod_cookies.cmx  \
        eliommod_naservices.cmx eliommod_sersess.cmx eliommod_sessexpl.cmx \
        eliommod_datasess.cmx eliommod_pagegen.cmx \
        eliommod_services.cmx eliommod_timeouts.cmx \
        eliommod.cmx eliom_sessions.cmx \
        eliom_parameters.cmx eliom_services.cmx \
        eliom_mkforms.cmx eliom_mkreg.cmx eliom_predefmod.cmx \
        eliom_tools.cmx


As for the runtime error message, this is what is produced when the programme
attempts to load eliom.cmxs:

[errors.log] 2008-04-16 22:15:50 - Fatal - While loading
/home/dario/.local/lib/ocsigen/extensions/eliom.cmxs: Dynlink.Error: no
implementation available for Eliommod_persess

(note that Eliommod_persess.cmx is included in the list of modules that
are linked into eliom.cmxs)

Kind regards,
Dario Teixeira



      ___________________________________________________________ 
Yahoo! For Good helps you make a difference  

http://uk.promotions.yahoo.com/forgood/