Bug 110035 - wget-1.10.2 doesn't work when compiled with USE=static
|
Bug#:
110035
|
Product: Gentoo Linux
|
Version: unspecified
|
Platform: x86
|
|
OS/Version: Linux
|
Status: RESOLVED
|
Severity: normal
|
Priority: P2
|
|
Resolution: FIXED
|
Assigned To: seemant@gentoo.org
|
Reported By: flash3001@yahoo.com
|
|
Component: Applications
|
|
|
URL:
|
|
Summary: wget-1.10.2 doesn't work when compiled with USE=static
|
|
Keywords:
|
|
Status Whiteboard:
|
|
Opened: 2005-10-21 07:27 0000
|
wget-1.10.2 doesn't work when compiled with USE=static
Reproducible: Always
Steps to Reproduce:
1. USE=static emerge wget
2.
3.
Actual Results:
cloud ~ # wget
-bash: /usr/bin/wget: No such file or directory
cloud ~ # equery uses wget
[ Searching for packages matching wget... ]
[ Colour Code : set unset ]
[ Legend : Left column (U) - USE flags from make.conf ]
[ : Right column (I) - USE flags packages was installed with ]
[ Found these USE variables for net-misc/wget-1.10.2 ]
U I
- - build : !!internal use only!! DO NOT SET THIS FLAG YOURSELF!, used for
creating build images and the first half of bootstrapping.
- - debug : Tells configure and the makefiles to build for debugging. Effects
vary across packages, but generally it will at least add -g to CFLAGS. Remember
to set FEATURES=nostrip too
- - ipv6 : Adds support for IP version 6
+ + nls : <unknown>
- - socks5 : Adds support for the socks5 proxy
+ + ssl : Adds support for Secure Socket Layer connections
+ + static : !!do not set this during bootstrap!! Causes binaries to be
statically linked instead of dynamically
Portage 2.0.51.22-r3 (default-linux/x86/2005.0, gcc-3.3.5-20050130,
glibc-2.3.5-r1, 2.6.13-gentoo-r3 i686)
=================================================================
System uname: 2.6.13-gentoo-r3 i686 AMD Athlon(tm) XP 1800+
Gentoo Base System version 1.4.16
dev-lang/python: 2.3.4-r1, 2.4.2
sys-apps/sandbox: 1.2.10
sys-devel/autoconf: 2.13, 2.59-r6
sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5
sys-devel/binutils: 2.15.92.0.2-r7
sys-devel/libtool: 1.5.18-r1
virtual/os-headers: 2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="ftp://ftp.roedu.net/pub/mirrors/gentoo.org
http://gentoo.oregonstate.edu"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync2.ro.gentoo.org/gentoo-portage"
USE="x86 3dnow 3dnowext X aalib alsa apm avi bitmap-fonts cdr crypt cups curl
eds emboss encode fam flac foomaticdb fortran gd geoip gif gphoto2 gpm gstreamer
gtk2 guile imlib imlib2 jikes jpeg lcms libcaca libwww lzo mad matroska mikmod
mmx mmx2 mmxext mng motif mp3 mpeg mysql ncurses network nls no_wxgtk1 ogg
oggvorbis opengl pam png postgres python quicktime readline rtc ruby sdl slang
spell sse ssl tcpd tga theora tiff truetype truetype-fonts type1-fonts udev
vorbis xchatdccserver xml2 xmms xprint xv xvid zlib userland_GNU kernel_linux
elibc_glibc"
Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS
What does "whereis wget" say?
cloud distfiles # whereis wget
wget: /usr/bin/wget /etc/wget /usr/X11R6/bin/wget /usr/bin/X11/wget
/usr/man/man1/wget.1.gz /usr/share/man/man1/wget.1.gz
If I recompile wget with USE=-static everything works fine btw.
Calling it directly as /usr/bin/wget makes no difference I'd presume?
Try:
ldd /usr/bin/wget
Indeed, calling wget directly as /usr/bin/wget makes no difference.
cloud distfiles # ldd /usr/bin/wget
/usr/bin/ldd: line 124: /usr/bin/wget: No such file or directory
Sounds like a broken symlink, but it's not...
Same thing happens to me.
It's not about any symlinks since the /usr/bin/wget is the actual executable
not
a symlink. I think the executable is somehow broken with USE=static since it
works fine without it.
Read what I said. I said that it sounds like one, but it's not.
What does:
strings /usr/bin/wget | head
say on your system after compiling with USE="static"
On mine it says something with libc.so.1, which doesn't exist.
A down and dirty fix is:
sed s:/usr/lib/libc.so.1:/lib/ld-linux.so.2: /usr/bin/wget -i
but this is hardly a solution
Same thing here:
cloud ~ # strings /usr/bin/wget | head
/usr/lib/libc.so.1
libssl.so.0.9.7
SSL_set_fd
SSL_set_connect_state
SSL_CTX_free
X509_free
SSL_shutdown
_DYNAMIC
SSL_CTX_set_default_verify_paths
SSL_get_error
I am guessing the issue is it links against libssl.so ... With newer binutils
it do not even want to link though:
-----
checking for libssl... no
configure: error: --with-ssl was given, but OpenSSL is not available.
-----
-----
configure:10483: x86_64-pc-linux-gnu-gcc -o conftest -march=k8 -O2 -pipe
-freorder-blocks -fprefetch-loop-arrays -ftracer -falign-functions=8
-fomit-frame-pointer -static conftest.c -ldl -lrt /usr/lib64/libssl.so
/usr/lib64/libcrypto.so -Wl,-rpath -Wl,/usr/lib64 >&5
/usr/lib/gcc/x86_64-pc-linux-gnu/4.0.2/../../../../x86_64-pc-linux-gnu/bin/ld:
attempted static link of dynamic object `/usr/lib64/libssl.so'
collect2: ld returned 1 exit status
configure:10489: $? = 1
configure: failed program was:
-----
Indeed, compiling wget with USE="static -ssl" seems to produce a working
binary.
cloud ~ # wget
wget: missing URL
Usage: wget [OPTION]... [URL]...
Try `wget --help' for more options.
I'm using binutils-2.15.92.0.2-r7 if this makes any difference.
cloud ~ # eix ^binutils$
* sys-devel/binutils
Available versions: [P]2.14 2.14.90.0.8-r3 *2.15 2.15.90.0.1.1-r5
*2.15.90.0.3-r5 *2.15.91.0.2-r2 2.15.92.0.2-r10 *2.15.94.0.2.2 *~2.16-r1
*~2.16.1 *2.16.90.0.3 *2.16.91.0.1 *2.16.91.0.2 *2.16.91.0.3
Installed: 2.15.92.0.2-r7
Homepage: http://sources.redhat.com/binutils/
Description: Tools necessary to build programs
Found 1 matches
PS, its wget's AC_LIB_HAVE_LINKFLAGS and co macro's that does the wrong thing.
This might fix it, but there is a weird issue that stops me from autoreconf and
testing:
-----
--- m4/lib-link.m4.orig 2005-10-24 15:51:48.000000000 +0200
+++ m4/lib-link.m4 2005-10-24 15:52:24.000000000 +0200
@@ -307,7 +307,7 @@
dnl FIXME: Not sure whether we should use
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
dnl here.
- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
else
dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
dnl here, because this doesn't fit in flags passed to the
Created an attachment (id=71332) [details]
wget-1.10.2-static-link.patch
For static linking, we need 2 things:
1) lib-link.m4 should use -l<libname> and not <full path to lib>, else it tries
to link against the .so
2) lib-link.m4 should add $LIBS after the libs we test for, else newer ld's do
not resolve symbols in static libs properly.
Probably should send it upstream ...
I emailed upstream with a link to this bug and az's patch.
also, rolling out patch tarball version 0.2 with az's patch in it, not revision
bumping the ebuild though, because it only affects a minority who weren't able
to upgrade anyway.
Thanks Az and everyone!
Please reopen. The issue is not fixed. As I pointed out in bug #109299, it's
still not possible to compile wget with USE=static.
In the wget-1.10.2.ebuild, there's still: PATCHVER=0.1
Shouldn't that be now 0.2?
Ah yes, after fixing this dev error (cf. bug #109299 comment #9), wget can be
compiled with USE=static and also be executed by calling "wget" or "/usr/bin/wget".
So, currently, that bug is not fixed. But after modifying the ebuild, it is fixed.
*** Bug 109299 has been marked as a duplicate of this bug. ***