bugmldonkey, a multi-networks file-sharing client - Bugs: bug #18397, static linking exits with error

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #18397: static linking exits with error

Submitter:  White_FrosT
Submitted:  Tue 28 Nov 2006 10:06:53 PM UTC
   
 
Category:  Core Severity:  3 - Normal
Item Group:  Compilation problem Status:  Wont Fix
Assigned to:  None Open/Closed:  Closed
Release:  2.8.1 Release:  2.8.1.CVS
Operating System:  Linux Binaries Origin:  CVS / Self compiled
CPU type:  Intel x86

Wed 29 Nov 2006 02:27:22 PM UTC, comment #4: 

But when I remove those the same error occurs with jpeg:
/usr/bin/ld: cannot find -ljpeg
collect2: ld returned 1 exit status

I already had libjpeg-devel.i386 and thought that would be enough. But I guess I needed libjpeg-static.i386

For fontconfig I couldn't find a static package. Is that needed?

freetype-static.i386 is needed too.

Final compile command:
ocamlopt.opt -inline 10 -linkall  -ccopt -static -o mlnet.static unix.cmxa str.cmxa -ccopt " " -cclib "-lz  " -ccopt "-pthread" -cclib "-lgd -ljpeg -lfreetype -lpng12 -lz -lm" -ccopt "-L/usr/lib"  -cc 'g++ -g -O2' -ccopt '-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer'   -cclib -lmagic  -I build    build/cdk.cmxa    build/magic.cmxa    build/common.cmxa    build/client.cmxa    build/core.cmxa    build/driver.cmxa    src/daemon/common/commonMain.cmx

This leeds to a core but with a lot of warnings:

/usr/lib/ocaml/libasmrun.a(unix.o): In function `caml_dlopen':
(.text+0x223): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/ocaml/libunix.a(getgr.o): In function `unix_getgrgid':
(.text+0xdb): warning: Using 'getgrgid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/ocaml/libunix.a(getgr.o): In function `unix_getgrnam':
(.text+0x10c): warning: Using 'getgrnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/ocaml/libunix.a(getpw.o): In function `unix_getpwnam':
(.text+0x158): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/ocaml/libunix.a(getpw.o): In function `unix_getpwuid':
(.text+0x127): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/ocaml/libunix.a(getaddrinfo.o): In function `unix_getaddrinfo':
(.text+0x235): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/ocaml/libunix.a(gethost.o): In function `unix_gethostbyaddr':
(.text+0x2f7): warning: Using 'gethostbyaddr_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
src/utils/lib/stubs_c.o: In function `ml_gethostbyname':
src/utils/lib/stubs_c.c:728: warning: Using 'gethostbyname_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/ocaml/libunix.a(getproto.o): In function `unix_getprotobynumber':
(.text+0xc5): warning: Using 'getprotobynumber' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/ocaml/libunix.a(getproto.o): In function `unix_getprotobyname':
(.text+0xf6): warning: Using 'getprotobyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/ocaml/libunix.a(getserv.o): In function `unix_getservbyname':
(.text+0x12b): warning: Using 'getservbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/ocaml/libunix.a(getserv.o): In function `unix_getservbyport':
(.text+0xf0): warning: Using 'getservbyport' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

Guess I don't have to worry about those if I make sure the glibc library is in the chroot environment.

Thanks

White_FrosT
Wed 29 Nov 2006 12:23:45 AM UTC, comment #3: 

On the forum, or here, it does not matter.

MLDonkey does not need libXpm and libX11, so linking
against them is useless.

Find the script "gdlib-config", its a script.
Change the line printing current content:

"-lXpm -lX11 -ljpeg -lfontconfig -lfreetype -lpng12 -lz -lm"

to

"-ljpeg -lfontconfig -lfreetype -lpng12 -lz -lm"

and everything should be fine. You need to re-run MLDonkey
configure to let MLDonkey take notice of your changes.

spiralvoice <spiralvoice>
Group administrator
Tue 28 Nov 2006 11:29:56 PM UTC, comment #2: 

Maybe we should be discussing this on a forum but...

#gdlib-config --libs
-lXpm -lX11 -ljpeg -lfontconfig -lfreetype -lpng12 -lz -lm

is the original output.
Am I missing the include dir in this output (-L/usr/lib)?

White_FrosT
Tue 28 Nov 2006 10:30:22 PM UTC, comment #1: 

MLDonkey does not need -lXpm at all.

You can manually change your gdlib-config script and
remove -lXpm and everything is fine.
This is a bug of the FC6 gd package.

Debian has two libgd2 packages: libgd2-noxpm and libgd2-xpm.

I have libgd2-noxpm installed:

# gdlib-config --libs
-L/usr/lib -lgd

which is correct.

spiralvoice <spiralvoice>
Group administrator
Tue 28 Nov 2006 10:06:53 PM UTC, original submission:  

I cannot compile a static core on FC6. Error:
---
ocamlopt.opt -inline 10 -linkall  -ccopt -static -o mlnet.static \
             unix.cmxa str.cmxa -ccopt " " -cclib "-lz  " -ccopt "-pthread" \
          \
        -cclib "-lgd -lXpm -lX11 -ljpeg -lfontconfig -lfreetype -lpng12 -lz -lm" -ccopt "-L/usr/lib"  \
        -cc 'g++ -g -O2' -ccopt '-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer'  \
        -cclib -lmagic  \
        -I build    build/cdk.cmxa    build/magic.cmxa    build/common.cmxa    build/client.cmxa    build/core.cmxa    build/driver.cmxa    src/daemon/common/commonMain.cmx
/usr/bin/ld: cannot find -lXpm
collect2: ld returned 1 exit status
Error during linking
make: * [mlnet.static] Error 2
---

Could this be the solution:
http://bugs.centos.org/view.php?id=1518

White_FrosT

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by spiralvoice (Posted a comment)
  • -email is unavailable- added by White_FrosT (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2006-11-28 spiralvoice StatusNone Wont Fix
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code