caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* On Building 64-bit shared libraries
@ 2010-02-15 20:42 Eric Hielscher
  0 siblings, 0 replies; only message in thread
From: Eric Hielscher @ 2010-02-15 20:42 UTC (permalink / raw)
  To: caml-list

A while back I asked the list about building 64-bit shared libraries.
My co-worker and I found a solution that seems to work.  I'm not sure
exactly where to insert -fPIC, so I do it in two places.  The steps
for getting it to work on an apt-enabled Linux for us are:

1) sudo apt-get remove ocaml

2)Get dependencies: sudo apt-get build-dep ocaml

3) Some misc. tools I think you need to build .deb files: sudo apt-get
install devscripts

4) sudo apt-get source ocaml

5) cd ocaml-3.11.1
6) cd asmrun
7) edit Makefile, adding "-fPIC" to CFLAGS
8) CFLAGS_APPEND=-fPIC
9) cd ..
10) sudo dpkg-buildpackage -uc -us -b
11) cd ..
12) Install new ocaml: sudo dpkg -i *.deb

13) ocamlopt -output-obj -o a.o A.ml
14) ocamlopt -ccopt -fPIC -o B.o B.c
15) ocamlopt -ccopt -shared -ccopt -Wl,-Bsymbolic B.o A.cmx -o libC.so

Now you have a shared library libC.so to which you can link your programs.

Hope that helps someone,
-- 
Eric Hielscher

"Het zal me worst wezen."

http://ehielscher.org


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-02-15 20:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-15 20:42 On Building 64-bit shared libraries Eric Hielscher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).