From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 06FF3BC6C for ; Wed, 6 Feb 2008 01:03:25 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAECIqEdFHnvD/2dsb2JhbACuDA X-IronPort-AV: E=Sophos;i="4.25,309,1199660400"; d="scan'208";a="8815711" Received: from galois.com (HELO mail.galois.com) ([69.30.123.195]) by mail3-smtp-sop.national.inria.fr with ESMTP; 06 Feb 2008 01:03:23 +0100 Received: from dyn-50-92.galois.com (dyn-50-92.galois.com [192.168.50.92]) (authenticated bits=0) by mail.galois.com (8.13.8/8.13.8) with ESMTP id m1602ZL6032011 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 5 Feb 2008 16:02:39 -0800 Cc: caml-list@yquem.inria.fr Message-Id: From: Joel Stanley To: Alain Frisch In-Reply-To: <47A8D9FA.2090206@frisch.fr> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v915) Subject: Re: [Caml-list] Dynamic libs w/ Ocaml + C code under Mac OS X Date: Tue, 5 Feb 2008 16:02:34 -0800 References: <11970BA6-EC2F-47FD-A194-BFD204057F06@galois.com> <47A7EB9E.3050808@frisch.fr> <47A8CE53.40500@frisch.fr> <2E251B0B-EE9B-4F03-AA31-8924D554AB57@galois.com> <47A8D9FA.2090206@frisch.fr> X-Mailer: Apple Mail (2.915) X-Virus-Scanned: ClamAV 0.92/5701/Tue Feb 5 15:30:56 2008 on liouville.galois.com X-Virus-Status: Clean X-Spam: no; 0.00; libs:01 ocaml:01 frisch:01 'foo:01 '-l:01 lib:01 ocaml':01 'foo:01 lib:01 ocaml:01 stdlib:01 libasmrun:01 camlcvs:01 cvsweb:01 asmcomp:01 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