caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Re: Mac OSX: calling OCaml from Objective-C in Xcode 2.2
@ 2005-11-27  2:23 Ker Lutyn
  0 siblings, 0 replies; 2+ messages in thread
From: Ker Lutyn @ 2005-11-27  2:23 UTC (permalink / raw)
  To: caml-list

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 <ker527mail@yahoo.com> 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/


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Mac OSX: calling OCaml from Objective-C in Xcode 2.2
@ 2005-11-24  4:14 Ker Lutyn
  0 siblings, 0 replies; 2+ messages in thread
From: Ker Lutyn @ 2005-11-24  4:14 UTC (permalink / raw)
  To: caml-list

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! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-11-27  2:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-27  2:23 Mac OSX: calling OCaml from Objective-C in Xcode 2.2 Ker Lutyn
  -- strict thread matches above, loose matches on Subject: below --
2005-11-24  4:14 Ker Lutyn

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).