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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 5CAB3BC6C for ; Tue, 5 Feb 2008 22:05:14 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAEteqEfUGyodimdsb2JhbACQLAEBAQgCCAcKEQecfQ X-IronPort-AV: E=Sophos;i="4.25,309,1199660400"; d="scan'208";a="8807151" Received: from smtp3-g19.free.fr ([212.27.42.29]) by mail3-smtp-sop.national.inria.fr with ESMTP; 05 Feb 2008 22:05:14 +0100 Received: from smtp3-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp3-g19.free.fr (Postfix) with ESMTP id 87FEF17B638; Tue, 5 Feb 2008 22:05:11 +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 62FEA17BFCA; Tue, 5 Feb 2008 22:05:11 +0100 (CET) Message-ID: <47A8CE53.40500@frisch.fr> Date: Tue, 05 Feb 2008 22:00:03 +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> In-Reply-To: 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 ocaml:01 runtime:01 ocamlopt:01 -output-obj:01 foo:01 cvs:01 -output-obj:01 invocation:01 wrote:01 caml-list:01 alain:01 Joel Stanley wrote: > Actually, I do want a stand-alone shared library that includes the OCaml > runtime, but I don't think that changes the parameters of the problem > much. Basically, I have an OCaml application that I'd like to wrap up > (together with some C glue code) into a shared library for use by other > applications. Then, you should rather try something like: ocamlopt -output-obj -o foo.so simple.ml wrapper.c In the CVS version, -output-obj has been extended to allow producing directly "standalone" .so/.dll libraries that can be loaded from C (or anything else). > The only real problem with the linker invocation above was the -I > switch, as the linker doesn't support it. If we simply remove the -I switch, then everything is ok? > Hmm, -read_only_relocs still looks supported in the man page for ld > under 10.5. But does the linker really accept "-read_only_relocs suppress"? http://developer.apple.com/releasenotes/DeveloperTools/RN-Id/index.html seems to indicate the opposite. > Anyone have any ideas as to how I could remedy the situation? At this > point it looks like I might have to switch the platform the application > I'm working on is used with, due to this linking problem alone. There > shouldn't be a need for the code generators to produce PIC as long as > the linker does the right thing, correct? Yes, correct. 00 Akaub