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=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 4F2D6BC6C for ; Tue, 5 Feb 2008 22:54:55 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAHxqqEfUGyodimdsb2JhbACQLgEBAQgCCAcKCAkHnRo X-IronPort-AV: E=Sophos;i="4.25,309,1199660400"; d="scan'208";a="6948632" Received: from smtp3-g19.free.fr ([212.27.42.29]) by mail2-smtp-roc.national.inria.fr with ESMTP; 05 Feb 2008 22:54:54 +0100 Received: from smtp3-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp3-g19.free.fr (Postfix) with ESMTP id 0CD2117B8CA; Tue, 5 Feb 2008 22:54:55 +0100 (CET) Received: from [192.168.0.3] (rke75-3-82-229-183-156.fbx.proxad.net [82.229.183.156]) by smtp3-g19.free.fr (Postfix) with ESMTP id BA56217C42A; Tue, 5 Feb 2008 22:54:54 +0100 (CET) Message-ID: <47A8D9FA.2090206@frisch.fr> Date: Tue, 05 Feb 2008 22:49:46 +0100 From: Alain Frisch User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Joel Stanley Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Dynamic libs w/ Ocaml + C code under Mac OS X References: <11970BA6-EC2F-47FD-A194-BFD204057F06@galois.com> <47A7EB9E.3050808@frisch.fr> <47A8CE53.40500@frisch.fr> <2E251B0B-EE9B-4F03-AA31-8924D554AB57@galois.com> In-Reply-To: <2E251B0B-EE9B-4F03-AA31-8924D554AB57@galois.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; frisch:01 frisch:01 libs:01 ocaml:01 'foo:01 '-l:01 lib:01 ocaml':01 'foo:01 lib:01 ocaml:01 stdlib:01 libasmrun:01 camlcvs:01 cvsweb:01 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? > 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). Or you can try to convince Apple to restore "-read_only_relocs suppress" in the new linker (I could find no indication that Apple deliberately dropped this feature). -- Alain