First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 110035
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Seemant Kulleen (RETIRED) <seemant@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Alexandru Toma <flash3001@yahoo.com>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
wget-1.10.2-static-link.patch wget-1.10.2-static-link.patch patch Martin Schlemmer (RETIRED) 2005-10-24 07:53 0000 5.68 KB Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 110035 depends on: Show dependency tree
Bug 110035 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   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

------- Comment #1 From Andy Kissner 2005-10-21 12:10:54 0000 -------
What does "whereis wget" say?

------- Comment #2 From Alexandru Toma 2005-10-21 12:49:30 0000 -------
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.

------- Comment #3 From Andy Kissner 2005-10-21 12:53:12 0000 -------
Calling it directly as /usr/bin/wget makes no difference I'd presume?
Try:
ldd /usr/bin/wget

------- Comment #4 From Alexandru Toma 2005-10-21 13:09:26 0000 -------
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

------- Comment #5 From Andy Kissner 2005-10-21 13:31:23 0000 -------
Sounds like a broken symlink, but it's not...
Same thing happens to me.

------- Comment #6 From Alexandru Toma 2005-10-21 15:30:51 0000 -------
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.

------- Comment #7 From Andy Kissner 2005-10-21 16:03:37 0000 -------
Read what I said. I said that it sounds like one, but it's not.

------- Comment #8 From Andy Kissner 2005-10-23 17:15:15 0000 -------
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

------- Comment #9 From Alexandru Toma 2005-10-24 01:23:05 0000 -------
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

------- Comment #10 From Seemant Kulleen (RETIRED) 2005-10-24 05:33:31 0000 -------
az, help!

------- Comment #11 From Martin Schlemmer (RETIRED) 2005-10-24 06:44:59 0000 -------
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:
-----

------- Comment #12 From Alexandru Toma 2005-10-24 06:55:37 0000 -------
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

------- Comment #13 From Martin Schlemmer (RETIRED) 2005-10-24 07:11:30 0000 -------
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

------- Comment #14 From Martin Schlemmer (RETIRED) 2005-10-24 07:53:55 0000 -------
Created an attachment (id=71332) [edit]
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 ...

------- Comment #15 From Seemant Kulleen (RETIRED) 2005-10-25 06:05:33 0000 -------
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!

------- Comment #16 From Alexander Skwar 2005-11-01 09:32:21 0000 -------
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.

------- Comment #17 From Alexander Skwar 2005-11-01 09:44:04 0000 -------
In the wget-1.10.2.ebuild, there's still: PATCHVER=0.1

Shouldn't that be now 0.2?


------- Comment #18 From Alexander Skwar 2005-11-01 09:52:16 0000 -------
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.

------- Comment #19 From Seemant Kulleen (RETIRED) 2005-11-02 07:43:21 0000 -------
*** Bug 109299 has been marked as a duplicate of this bug. ***

First Last Prev Next    No search results available      Search page      Enter new bug