Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] static linking and ocaml 3.07 beta 1
[ Home ] [ Index: by date | by threads ]
[ Search: ]

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