caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Joel Stanley <jstanley@galois.com>
To: Alain Frisch <alain@frisch.fr>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Dynamic libs w/ Ocaml + C code under Mac OS X
Date: Tue, 5 Feb 2008 16:02:34 -0800	[thread overview]
Message-ID: <B74952E3-C379-446B-A008-3FE57EA94E45@galois.com> (raw)
In-Reply-To: <47A8D9FA.2090206@frisch.fr>


On Feb 5, 2008, at 1:49 PM, Alain Frisch wrote:

> Joel Stanley wrote:
>> ld -bundle -flat_namespace -undefined suppress -read_only_relocs  
>> suppress -o 'foo.so'  '-L/Users/jstanley/hbin/lib/ocaml'  
>> 'foo.so.startup.o' 'simple.o' '/Users/jstanley/hbin/lib/ocaml/ 
>> stdlib.a' 'wrapper.o' '/Users/jstanley/hbin/lib/ocaml/libasmrun.a'
>> > ld: absolute addressing (perhaps -mdynamic-no-pic) used in
>
> Ok, it makes sense. Now, if you replace ld with ld_classic, does it  
> work?

Yes, yes it does, thanks!  I had actually deferred trying this because  
I wanted a solution that would be more suitable going forward.  As you  
pointed out, Apple may not have intended to drop the '- 
read_only_relocs suppress' option, but there's also no telling whether  
or not it'll end up being officially unsupported.

>> From the experiments that I've been doing, it really looks like PIC  
>> needs to be generated for the OS X linker to be happy.  Do you have  
>> any assessment as to how much work this is?  Keep in mind that I  
>> don't consider myself an x86 assembly hacker by any stretch of the  
>> imagination ;)  I'd really like to just run this natively on my  
>> main platform, but if I can't, I can't.
>
> Honestly, I don't know how hard it would be. You can look at what  
> had to be done for AMD64 (http://camlcvs.inria.fr/cgi-bin/cvsweb/ocaml/asmcomp/amd64/ 
> ) and at how one is supposed to produce PIC for x86 (gcc -fPIC).

Alright, I might take a crack at it.  Thanks again for your help.

Cheers,
Joel


      reply	other threads:[~2008-02-06  0:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-04 22:39 Joel Stanley
2008-02-05  4:52 ` [Caml-list] " Alain Frisch
2008-02-05 16:39   ` Joel Stanley
2008-02-05 21:00     ` Alain Frisch
2008-02-05 21:19       ` Joel Stanley
2008-02-05 21:49         ` Alain Frisch
2008-02-06  0:02           ` Joel Stanley [this message]

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=B74952E3-C379-446B-A008-3FE57EA94E45@galois.com \
    --to=jstanley@galois.com \
    --cc=alain@frisch.fr \
    --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).