Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Jonathan Marchand <jonathlela@g...>
Subject: Compiling a shared library with amd64
Hi,

I would like to compile a native shared library with ocaml on amd64. I
googled the problem and as far as I understand, I need both runtimes
and libraries (the ones used in my library) compiled with -fPIC:

http://caml.inria.fr/mantis/view.php?id=3924

The above trick allowed me to compile ocaml runtimes with -fPIC
(linker doesn't complain about libasmrun.a anymore):

BYTECCCOMPOPTS=-fno-defer-pop -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT -fPIC
NATIVECCCOMPOPTS=-Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT -fPIC
NATIVECCPROFOPTS=-Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT -fPIC
SUPPORTS_SHARED_LIBRARIES=true
BNG_ARCH=amd64

http://caml.inria.fr/pub/ml-archives/caml-list/2005/12/6ac193aca085629903e7efd79ae0274f.en.html

But I still have issues with the ocaml libraries. I don't know how to
compile the standard library from the ocaml tarball with -fPIC. I
looked at the Makefiles, but I could'nt figure out what to change to
achieve this task.

I've looked at rocaml (http://eigenclass.org/hiki/rocaml) which fails
to compile amd64 library too, so I imagine the problem is definitly in
the way of compiling the ocaml libraries.

Any hints how to compile these libraries with -fPIC ?

Jonathan