Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Compiling a shared library with amd64
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-07-23 (07:16)
From: Alain Frisch <alain@f...>
Subject: Re: [Caml-list] Compiling a shared library with amd64
Jonathan Marchand wrote:
> I still have the same problem with ocaml from CVS (exemple from rocaml):
> cc -shared -o foo_rocaml_wrapper.o -L. -L/usr/lib -L.
> -rdynamic -Wl,-export-dynamic   foo_rocaml_runtime.o
> /usr/local/lib/ocaml/libasmrun.a /usr/local/lib/ocaml/libunix.a
> /usr/local/lib/ocaml/libnums.a -lruby1.8  -lpthread -ldl -lcrypt -lm
> -lc
> /usr/bin/ld: /usr/local/lib/ocaml/libasmrun.a(startup.o): relocation
> R_X86_64_32 against `a local symbol' can not be used when making a
> shared object; recompile with -fPIC
> /usr/local/lib/ocaml/libasmrun.a: could not read symbols: Bad value
> collect2: ld returned 1 exit status
> make: *** [] Erreur 1

You mentioned in your previous email that you got rid of such errors by 
adding -fPIC to *COMPOPTS variables. Cannot you do the same for other C 
libraries?  The changes in the CVS only affect the code generated by 
OCaml, like stdlib.a (the  native code produced by ocamlopt for the 
standard library).

-- Alain