caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Problem with 64-bit shared libraries?
@ 2011-11-30 21:37 Alex Rubinsteyn
  2011-12-01  1:00 ` Jeff Meister
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Rubinsteyn @ 2011-11-30 21:37 UTC (permalink / raw)
  To: Caml List

[-- Attachment #1: Type: text/plain, Size: 457 bytes --]

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?

[-- Attachment #2: Type: text/html, Size: 833 bytes --]

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

* Re: [Caml-list] Problem with 64-bit shared libraries?
  2011-11-30 21:37 [Caml-list] Problem with 64-bit shared libraries? Alex Rubinsteyn
@ 2011-12-01  1:00 ` Jeff Meister
  2011-12-01 18:59   ` Alex Rubinsteyn
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Meister @ 2011-12-01  1:00 UTC (permalink / raw)
  To: Alex Rubinsteyn; +Cc: Caml List

[-- Attachment #1: Type: text/plain, Size: 928 bytes --]

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?
>
>
>

[-- Attachment #2: Type: text/html, Size: 1484 bytes --]

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

* Re: [Caml-list] Problem with 64-bit shared libraries?
  2011-12-01  1:00 ` Jeff Meister
@ 2011-12-01 18:59   ` Alex Rubinsteyn
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Rubinsteyn @ 2011-12-01 18:59 UTC (permalink / raw)
  To: Jeff Meister; +Cc: Caml List

[-- Attachment #1: Type: text/plain, Size: 1230 bytes --]

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 <nanaki@gmail.com> 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?
>>
>>
>>
>

[-- Attachment #2: Type: text/html, Size: 2075 bytes --]

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

end of thread, other threads:[~2011-12-01 18:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-30 21:37 [Caml-list] Problem with 64-bit shared libraries? Alex Rubinsteyn
2011-12-01  1:00 ` Jeff Meister
2011-12-01 18:59   ` Alex Rubinsteyn

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