From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 659A4BB9C for ; Sun, 27 Nov 2005 03:23:31 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jAR2NU96004926 for ; Sun, 27 Nov 2005 03:23:31 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id DAA09147 for ; Sun, 27 Nov 2005 03:23:30 +0100 (MET) Received: from web34605.mail.mud.yahoo.com (web34605.mail.mud.yahoo.com [209.191.68.139]) by nez-perce.inria.fr (8.13.0/8.13.0) with SMTP id jAR2NTDw013044 for ; Sun, 27 Nov 2005 03:23:29 +0100 Received: (qmail 6578 invoked by uid 60001); 27 Nov 2005 02:23:29 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=XY1MA2TQ7m0z4i9ZYypwhjPEL5edH/9JIXDUFst5Fc1wMiQxVm2p508pM1XQy/QOFvYB6qNr9vrKtPD5CP1GrmEJ474+Uym/fdK65KSV+zhpjRor8uom6YeN3eEmqPr/EqTvSugewM5qdrSkqDHQH7aH/5pCroVNSvDJ/eVwlxk= ; Message-ID: <20051127022329.6576.qmail@web34605.mail.mud.yahoo.com> Received: from [69.110.33.39] by web34605.mail.mud.yahoo.com via HTTP; Sat, 26 Nov 2005 18:23:29 PST Date: Sat, 26 Nov 2005 18:23:29 -0800 (PST) From: Ker Lutyn Subject: Re: Mac OSX: calling OCaml from Objective-C in Xcode 2.2 To: caml-list@inria.fr MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Miltered: at concorde with ID 438918A3.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 438918A1.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; osx:01 ocaml:01 binary:01 ocaml:01 ocamlopt:01 libasmrun:01 foo:01 usr:01 3.09.0:01 gcc:01 osx:01 10.4.3:01 xcode:98 xcode:98 wrote:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: ** X-Spam-Status: No, score=2.2 required=5.0 tests=FORGED_YAHOO_RCVD autolearn=disabled version=3.0.3 Okay, the problem was that Xcode by default tries to build a universal binary, so of course doesn't like the power.o unit compiled for rhapsody when it gets around to the i386 version. Also by default, Xcode sets different architecture settings for the Project and the Target. As an Xcode newbie, I found this confusing. --- Ker Lutyn wrote: > I have a static library "libmylib.a" containing wrapped OCaml code using the > Callback module (the code is compiled with ocamlopt and g++, and the library > includes libasmrun.a): > > $ g++ -o foo main.cc libmylib.a > > This works fine. Now, when I drop libmylib.a into my Xcode 2.2 project and > build, I get the following error: > > /usr/bin/ld: libmylib.a(power.o) has local relocation entries in non-writable > section (__TEXT,__text) > collect2: ld returned 1 exit status > > I have Googled for this and the only answer I can find is that > -mdynamic-no-pic > flag should not be sent; this flag is controlled by the "Generate > Position-Dependent Code" flag in the "Code Generation" part of the Project > Build Settings. In my case, whether this is set or not makes no difference to > the error. > > Does anyone have experience with this error? > > ocaml version 3.09.0 > gcc 4.0.1 > Mac OSX 10.4.3 > Xcode 2.2 __________________________________ Yahoo! Music Unlimited Access over 1 million songs. Try it free. http://music.yahoo.com/unlimited/