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

Submitted by:  White_FrosT
Submitted on:  Tue 28 Nov 2006 10:06:53 PM UTC  
 
Category: CoreSeverity: 3 - Normal
Item Group: Compilation problemStatus: Wont Fix
Assigned to: NoneOpen/Closed: Closed
Release: 2.8.1.CVSRelease: 2.8.1
Operating System: LinuxBinaries 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>
Project 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>
Project 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

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 28 Nov 2006 10:30:22 PM UTCspiralvoiceStatusNone=>Wont Fix
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1