caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* glibc and ocaml/libasmrun.a
@ 2005-01-12  7:29 Radu Grigore
  2005-01-12  7:50 ` Radu Grigore
  2005-01-12  9:00 ` [Caml-list] " Olivier Andrieu
  0 siblings, 2 replies; 5+ messages in thread
From: Radu Grigore @ 2005-01-12  7:29 UTC (permalink / raw)
  To: caml-list

Hello,

I have trouble distributing a self contained executable.

Two users reported "collect_events: /lib/i686/libc.so.6: version
`GLIBC_2.3' not found". I do not have any control over their system,
so I tried to link statically against glibc by using:

  ocamlopt -ccopt -static collect_events.ml

I get:

  /usr/local/lib/ocaml/libasmrun.a(unix.o)(.text+0x241): In function
`caml_dlopen':
  warning: Using 'dlopen' in statically linked applications requires
at runtime the shared libraries from the glibc version used for
linking

At first I thought that my program uses a library function whose
implementation explicitly tries to load dynamically. But the same
warning is obtained if collect_events.ml is an empty file. It looks
like the interpreter itself wants to link dynamically against glibc.
Is this a correct diagnostic? Is there a way around it?

Other info: 
  ocaml version 3.08.1
  my system: Fedora Core 1
  user system: (probably[0]) RedHat 7

-- 
thanks,
 radu
http://rgrig.idilis.ro/

[0] they are not awake yet :)


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

* Re: glibc and ocaml/libasmrun.a
  2005-01-12  7:29 glibc and ocaml/libasmrun.a Radu Grigore
@ 2005-01-12  7:50 ` Radu Grigore
  2005-01-12  9:00 ` [Caml-list] " Olivier Andrieu
  1 sibling, 0 replies; 5+ messages in thread
From: Radu Grigore @ 2005-01-12  7:50 UTC (permalink / raw)
  To: caml-list

Update. I managed to get acces to an older distribution (RH7) and the
executable compiled with:

>   ocamlopt -ccopt -static collect_events.ml

worked in spite of:

>   /usr/local/lib/ocaml/libasmrun.a(unix.o)(.text+0x241): In function
> `caml_dlopen':
>   warning: Using 'dlopen' in statically linked applications requires
> at runtime the shared libraries from the glibc version used for
> linking

I'd still like to know what exactly is going on. I have the OCaml
compiler sources here so maybe you could provide a pointer where to
look?

-- 
regards,
 radu
http://rgrig.idilis.ro/


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

* Re: [Caml-list] glibc and ocaml/libasmrun.a
  2005-01-12  7:29 glibc and ocaml/libasmrun.a Radu Grigore
  2005-01-12  7:50 ` Radu Grigore
@ 2005-01-12  9:00 ` Olivier Andrieu
  2005-01-12 15:45   ` Xavier Leroy
  1 sibling, 1 reply; 5+ messages in thread
From: Olivier Andrieu @ 2005-01-12  9:00 UTC (permalink / raw)
  To: radugrigore; +Cc: caml-list

 > Radu Grigore [Wed, 12 Jan 2005]:
 > Hello,
 > 
 > I have trouble distributing a self contained executable.
 > 
 > Two users reported "collect_events: /lib/i686/libc.so.6: version
 > `GLIBC_2.3' not found". I do not have any control over their system,
 > so I tried to link statically against glibc by using:
 > 
 >   ocamlopt -ccopt -static collect_events.ml
 > 
 > I get:
 > 
 >   /usr/local/lib/ocaml/libasmrun.a(unix.o)(.text+0x241): In function
 > `caml_dlopen':
 >   warning: Using 'dlopen' in statically linked applications requires
 > at runtime the shared libraries from the glibc version used for
 > linking

This means the runtime (libasmrun.a) contains calls to dlopen(). Now
I'm not sure why there are dlopen's in the native (ocamlopt)
runtime. I thought only the bytecode one is using dlopen (to
dynamically link stub libraries). If that is correct (ie the native
runtime doesn't actually use dlopen) then I guess you can ignore the
warning. 

-- 
   Olivier


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

* Re: [Caml-list] glibc and ocaml/libasmrun.a
  2005-01-12  9:00 ` [Caml-list] " Olivier Andrieu
@ 2005-01-12 15:45   ` Xavier Leroy
  2005-01-13  7:05     ` Radu Grigore
  0 siblings, 1 reply; 5+ messages in thread
From: Xavier Leroy @ 2005-01-12 15:45 UTC (permalink / raw)
  To: Olivier Andrieu; +Cc: radugrigore, caml-list

> This means the runtime (libasmrun.a) contains calls to dlopen(). Now
> I'm not sure why there are dlopen's in the native (ocamlopt)
> runtime. I thought only the bytecode one is using dlopen (to
> dynamically link stub libraries). If that is correct (ie the native
> runtime doesn't actually use dlopen) then I guess you can ignore the
> warning. 

This is entirely correct.  The reason why the native-code runtime
system contains the wrappers around dlopen() is that there exists
exactly one ocamlopt-compiled program that needs them: it's ocamlc.opt,
the natively-compiled bytecode compiler, which needs to dlopen()
shared libraries to check for the existence of symbols referenced from
external declarations in the Caml source.  

So, unless the Caml program happens to embark most of ocamlc
(unlikely!), you can safely ignore the warning at static linking time.

- Xavier Leroy


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

* Re: [Caml-list] glibc and ocaml/libasmrun.a
  2005-01-12 15:45   ` Xavier Leroy
@ 2005-01-13  7:05     ` Radu Grigore
  0 siblings, 0 replies; 5+ messages in thread
From: Radu Grigore @ 2005-01-13  7:05 UTC (permalink / raw)
  To: Xavier Leroy, Olivier Andrieu; +Cc: caml-list

Thank you.

On Wed, 12 Jan 2005 16:45:54 +0100, Xavier Leroy <Xavier.Leroy@inria.fr> wrote:
> > This means the runtime (libasmrun.a) contains calls to dlopen(). [...]

> This is entirely correct.  The reason [...]

-- 
regards,
 radu
http://rgrig.idilis.ro/


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

end of thread, other threads:[~2005-01-13  7:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-12  7:29 glibc and ocaml/libasmrun.a Radu Grigore
2005-01-12  7:50 ` Radu Grigore
2005-01-12  9:00 ` [Caml-list] " Olivier Andrieu
2005-01-12 15:45   ` Xavier Leroy
2005-01-13  7:05     ` Radu Grigore

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