From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id pB110OSc016172 for ; Thu, 1 Dec 2011 02:00:24 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkwBAPjQ1k7RVdU2imdsb2JhbABEqw0IIgEBAQoJDRkGIYFyAQEBAwESAiwBGx0BAwELBgUEAQY7IQEBEQEFARwGEyKHZZs7CotkgmiEcD2IcQIFCoNjhzMEiCiML4pagwI9hBg X-IronPort-AV: E=Sophos;i="4.71,274,1320620400"; d="scan'208";a="121585203" Received: from mail-yw0-f54.google.com ([209.85.213.54]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 01 Dec 2011 02:00:19 +0100 Received: by ywp17 with SMTP id 17so1993730ywp.27 for ; Wed, 30 Nov 2011 17:00:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=7oFkL98gyZH5QpULLlm8UdHZrhOcm6eeCHf/P3f3nDo=; b=MrUYFyJfd77Xx7lNK7/pUFtvBCKPBTQ9EBs4/Find5OKHwiC1OMyZh7DrCcVhnGAiH J1RFpscfZ8hbGOuxNW8LZKXGYuqCSZ7rUB1MW3JHbtqllYxmN+PLT2C9PYjdy05Ib2ZV JqZq7f2bdqTsFu2PpYEZBxcOqHu03tAXdMJq4= MIME-Version: 1.0 Received: by 10.50.6.202 with SMTP id d10mr5423109iga.31.1322701217549; Wed, 30 Nov 2011 17:00:17 -0800 (PST) Received: by 10.42.166.195 with HTTP; Wed, 30 Nov 2011 17:00:17 -0800 (PST) In-Reply-To: References: Date: Wed, 30 Nov 2011 17:00:17 -0800 Message-ID: From: Jeff Meister To: Alex Rubinsteyn Cc: Caml List Content-Type: multipart/alternative; boundary=e89a8f50282a374db604b2fd6026 Subject: Re: [Caml-list] Problem with 64-bit shared libraries? --e89a8f50282a374db604b2fd6026 Content-Type: text/plain; charset=ISO-8859-1 Yes, you should recompile OCaml with -fPIC. I ran into the same problem a few months ago, and noticed this bit of information in the INSTALL file: On a Linux x86/64 bits host, to build the run-time system in PIC mode (enables putting the runtime in a shared library, at a small performance cost): ./configure -cc "gcc -fPIC" -aspp "gcc -c -fPIC" On Wed, Nov 30, 2011 at 1:37 PM, Alex Rubinsteyn wrote: > Hi, > > I'd like to package up some OCaml code (along with C bindings) as a shared > library. However, I'm encountering the following linker error: > > /usr/bin/ld: /usr/lib/ocaml/libasmrun.a(startup.o): relocation R_X86_64_32 > against `.rodata.str1.1' can not be used when making a shared object; > recompile with -fPIC > /usr/lib/ocaml/libasmrun.a: could not read symbols: Bad value > > Do I have to recompile OCaml with -fPIC to put the runtime inside a shared > library? > > > --e89a8f50282a374db604b2fd6026 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Yes, you should recompile OCaml with -fPIC. I ran into the same problem a f= ew months ago, and noticed this bit of information in the INSTALL file:
=
  On a Linux x86/64 bits host, to build the run-time system in PIC=
 mode
  (enables putting the runtime in a shared library,=20
   at a small performance cost):
    ./configure -cc "gcc -fPIC" -aspp "gcc -c -fPIC"
On Wed, Nov 30, 2011 at 1:37 PM, Alex Rub= insteyn <= alex.rubinsteyn@gmail.com> wrote:
Hi,=A0

I'd like to p= ackage up some OCaml code (along with C bindings) as a shared library. Howe= ver, I'm encountering the following linker error:

/u= sr/bin/ld: /usr/lib/ocaml/libasmrun.a(startup.o): relocation R_X86_64_32 ag= ainst `.rodata.str1.1' can not be used when making a shared object; rec= ompile with -fPIC
/usr/lib/ocaml/libasmr= un.a: could not read symbols: Bad value

Do I have to recompile OCaml= with -fPIC to put the runtime inside a shared library?=A0



--e89a8f50282a374db604b2fd6026--