From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id pB1Ixg4O010470 for ; Thu, 1 Dec 2011 19:59:42 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuMAAKPN105KfVM2kWdsb2JhbABEqnEIIgEBAQEJCwsHFAQhgXIBAQEDARICLAEbHQEDAQsGBQQHAwouIQEBEQEFARwGEyKHZZpyCotkgmqFBz2IcQIFCoNihzQEiCiML4pagwQ9hBU X-IronPort-AV: E=Sophos;i="4.71,279,1320620400"; d="scan'208";a="133579502" Received: from mail-ee0-f54.google.com ([74.125.83.54]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 01 Dec 2011 19:59:37 +0100 Received: by eekc13 with SMTP id c13so2532532eek.27 for ; Thu, 01 Dec 2011 10:59:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=TplsbcJE6Rf/Fz+Yt/5zPp7/NseA5wFf3dHP83Y6KM8=; b=djy3XDRs/i19a5riFV83Xuf9sd80bKxjvY2OOBKH3n2KjV6Nl7jIfNvvnMirsjSZT2 GYdN/HFn3PEyTI4jt+hXkI+uqr9fYncNgQwrVnnyBxVPI7k80nWd4SSYtATRp+NgWPGB uNMrpIbZRYaQaG4iOJ1v1YekioLIvALbgg0qU= Received: by 10.180.19.9 with SMTP id a9mr5686242wie.32.1322765976354; Thu, 01 Dec 2011 10:59:36 -0800 (PST) MIME-Version: 1.0 Received: by 10.180.126.105 with HTTP; Thu, 1 Dec 2011 10:59:06 -0800 (PST) In-Reply-To: References: From: Alex Rubinsteyn Date: Thu, 1 Dec 2011 13:59:06 -0500 Message-ID: To: Jeff Meister Cc: Caml List Content-Type: multipart/alternative; boundary=bcaec53d5a93243dca04b30c7496 Subject: Re: [Caml-list] Problem with 64-bit shared libraries? --bcaec53d5a93243dca04b30c7496 Content-Type: text/plain; charset=ISO-8859-1 Thanks, I guess I'll recompile then. I notice, though, that there's a libcamlrun_shared.so (for the bytecode runtime). Is there any reason we don't also get libasmrun_shared.so by default? On Wed, Nov 30, 2011 at 8:00 PM, Jeff Meister wrote: > 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 < > alex.rubinsteyn@gmail.com> 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? >> >> >> > --bcaec53d5a93243dca04b30c7496 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks, I guess I'll recompile then. I notice, though, that there's= a libcamlrun_shared.so (for the bytecode runtime). Is there any reason we = don't also get libasmrun_shared.so by default?=A0

On Wed, Nov 30, 2011 at 8:00 PM, Jeff Meister <nanaki@gmail.com> wrote:
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"

O= n Wed, Nov 30, 2011 at 1:37 PM, Alex Rubinsteyn <alex.rubinsteyn@g= mail.com> wrote:
Hi,=A0

I'd like to pa= ckage up some OCaml code (along with C bindings) as a shared library. Howev= er, 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




--bcaec53d5a93243dca04b30c7496--