caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Eric Hielscher <hielscher@gmail.com>
To: caml-list@yquem.inria.fr
Subject: On Building 64-bit shared libraries
Date: Mon, 15 Feb 2010 15:42:34 -0500	[thread overview]
Message-ID: <d550840e1002151242i4039b916taf209bdd2490fe0a@mail.gmail.com> (raw)

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


                 reply	other threads:[~2010-02-15 20:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d550840e1002151242i4039b916taf209bdd2490fe0a@mail.gmail.com \
    --to=hielscher@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).