<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/10/8bba2718358038c87fed56bf09c9c7aa"
  from="Alan Schmitt &lt;alan.schmitt@p...&gt;"
  author="Alan Schmitt"
  date="2003-10-09T12:11:25"
  subject="Re: [Caml-list] static linking and ocaml 3.07 beta 1"
  prev="2003/10/33325f78a6172641c92e0e567b9af6af"
  next="2003/10/47c7cdb43fae188992cfd97ecd09aa5c"
  prev-in-thread="2003/10/e0230805f657be23a6ddcabf6e9064b3"
  next-in-thread="2003/10/3792447d06a23adc7c7923b6498b30c2"
  prev-thread="2003/08/2a423691c7c963a4df46036c465e5ab8"
  next-thread="2003/08/65c768bf448ad998a566fc191a3a8bca"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] static linking and ocaml 3.07 beta 1">
<msg 
  url="2003/08/69845269df373ef1ad4c229cfcc8f49a"
  from="Alan Schmitt &lt;alan.schmitt@p...&gt;"
  author="Alan Schmitt"
  date="2003-08-04T14:31:13"
  subject="[Caml-list] static linking and ocaml 3.07 beta 1">
<msg 
  url="2003/08/130908035cbc01e1f80c834d696ccba3"
  from="Michal Moskal &lt;malekith@p...&gt;"
  author="Michal Moskal"
  date="2003-08-06T12:03:14"
  subject="Re: [Caml-list] static linking and ocaml 3.07 beta 1">
<msg 
  url="2003/10/e0230805f657be23a6ddcabf6e9064b3"
  from="Sven Luther &lt;sven.luther@w...&gt;"
  author="Sven Luther"
  date="2003-10-08T19:25:32"
  subject="Re: [Caml-list] static linking and ocaml 3.07 beta 1">
<msg 
  url="2003/10/8bba2718358038c87fed56bf09c9c7aa"
  from="Alan Schmitt &lt;alan.schmitt@p...&gt;"
  author="Alan Schmitt"
  date="2003-10-09T12:11:25"
  subject="Re: [Caml-list] static linking and ocaml 3.07 beta 1">
<msg 
  url="2003/10/3792447d06a23adc7c7923b6498b30c2"
  from="Sven Luther &lt;sven.luther@w...&gt;"
  author="Sven Luther"
  date="2003-10-09T12:51:04"
  subject="Re: [Caml-list] static linking and ocaml 3.07 beta 1">
</msg>
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
* Sven Luther (sven.luther@wanadoo.fr) wrote:
&gt; On Wed, Aug 06, 2003 at 02:02:47PM +0200, Michal Moskal wrote:
&gt; &gt; On Mon, Aug 04, 2003 at 10:29:16AM -0400, Alan Schmitt wrote:
&gt; &gt; &gt; I have had the following strange message when doing a static link:
&gt; &gt; &gt; 
&gt; &gt; &gt; ocamlopt unix.cmxa str.cmxa  -ccopt -static  sysconf.cmx  abort.cmx  debug.cmx  timeout.cmx  bufrw.cmx  ftp.cmx  config.cmx  utils.cmx  crypt.cmx  future.cmx  timed_events.cmx  dns.cmx  http.cmx  commands.cmx  event.cmx  maingrenouille.cmx -o camlgrenouille.static 
&gt; &gt; &gt; /usr/local/lib/ocaml/libunix.a(getgr.o)(.text+0x10c): In function `unix_getgrgid':
&gt; &gt; &gt; : Using 'getgrgid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
&gt; &gt; 
&gt; &gt; You might be better off linking statically everything *except* glibc.
&gt; &gt; Executables linked dynamically against given version of glibc will
&gt; &gt; mostly run with later versions (but not the other way around).
&gt; &gt; 
&gt; 
&gt; Mmm, how did you solve this one ? I also get this :
&gt; 
&gt; ocamlopt -I Objets  -w p -I +lablgtk2  -ccopt -static -o svenopt
&gt; lablgtk.cmxa gtkInit.cmx unix.cmxa date.cmx ... interface.cmx main.cmx
&gt; /usr/lib/ocaml/3.07/libunix.a(getgr.o)(.text+0x115): dans la fonction «
&gt; unix_getgrgid »:
&gt; : warning: Using 'getgrgid' in statically linked applications requires
&gt; at runtime the shared libraries from the glibc version used for linking
&gt; /usr/lib/ocaml/3.07/libunix.a(getgr.o)(.text+0xdc): dans la fonction «
&gt; unix_getgrnam »:
&gt; : warning: Using 'getgrnam' in statically linked applications requires
&gt; at runtime the shared libraries from the glibc version used for linking
&gt; /usr/lib/gcc-lib/i486-linux/3.3.2/../../../libgtk-x11-2.0.a(gtkfilesel.o)(.text+0x6d81):
&gt; dans la fonction « get_pwdb »:
&gt; : warning: Using 'getpwent' in statically linked applications requires
&gt; at runtime the shared libraries from the glibc version used for linking
&gt; /usr/lib/ocaml/3.07/libunix.a(getpw.o)(.text+0x128): dans la fonction «
&gt; unix_getpwnam »:
&gt; : warning: Using 'getpwnam' in statically linked applications requires
&gt; at runtime the shared libraries from the glibc version used for linking
&gt; ...
&gt; /usr/lib/gcc-lib/i486-linux/3.3.2/../../../libgtk-x11-2.0.a(gtkplug.o)(.text+0x14c5):
&gt; dans la fonction « xembed_set_info »:
&gt; : undefined reference to `XChangeProperty'
&gt; /usr/lib/gcc-lib/i486-linux/3.3.2/../../../libgtk-x11-2.0.a(gtksocket.o)(.text+0x623):
&gt; dans la fonction « gtk_socket_realize »:
&gt; : undefined reference to `XGetWindowAttributes'
&gt; /usr/lib/gcc-lib/i486-linux/3.3.2/../../../libgtk-x11-2.0.a(gtksocket.o)(.text+0x657):
&gt; dans la fonction « gtk_socket_realize »:
&gt; : undefined reference to `XSelectInput'
&gt; /usr/lib/gcc-lib/i486-linux/3.3.2/../../../libgtk-x11-2.0.a(gtksocket.o)(.text+0x8b9):
&gt; dans la fonction « gtk_socket_size_request »:
&gt; : undefined reference to `XGetWMNormalHints'
&gt; ...
&gt; /usr/lib/gcc-lib/i486-linux/3.3.2/../../../libpangox-1.0.a(pangox-fontmap.o)(.text+0x1db8):
&gt; dans la fonction « pango_x_fontmap_atom_from_name »:
&gt; : undefined reference to `XInternAtom'
&gt; /usr/lib/gcc-lib/i486-linux/3.3.2/../../../libpangox-1.0.a(pangox-fontmap.o)(.text+0x1e20):
&gt; dans la fonction « pango_x_fontmap_name_from_atom »:
&gt; : undefined reference to `XGetAtomName'
&gt; /usr/lib/gcc-lib/i486-linux/3.3.2/../../../libpangox-1.0.a(pangox-fontmap.o)(.text+0x1e35):
&gt; dans la fonction « pango_x_fontmap_name_from_atom »:
&gt; : undefined reference to `XFree'
&gt; collect2: ld a retourné 1 code d'état d'exécution
&gt; Error during linking
&gt; make: *** [svenopt] Erreur 2

I think there are two things here: the first glibc warnings are just
warnings, and I have distributed binaries built with these warnings with
no problem. However you seem to be missing XFree86-static-devel (or
static-libs, I don't really know how it is under debian, for Mandrake
it's libxfree86-static-devel)

Alan Schmitt

-- 
The hacker: someone who figured things out and made something cool happen.

</contents>

</message>

