Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 362173

Summary: sys-cluster/ipvsadm-1.26 should [R]DEPEND on dev-libs/popt
Product: Gentoo Linux Reporter: Han Boetes <hboetes>
Component: New packagesAssignee: Gentoo Cluster Team <cluster>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Han Boetes 2011-04-05 14:43:08 UTC
ipvsadm-1.26 does not use the -lpopt option at linktime. After attempting to build it I cd into the build directory, hit make and then run the same link command _with_ -lpopt

cd /var/tmp/portage/sys-cluster/ipvsadm-1.26/work/ipvsadm-1.26
make
make -C libipvs
make[1]: Entering directory `/var/tmp/portage/sys-cluster/ipvsadm-1.26/work/ipvsadm-1.26/libipvs'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/var/tmp/portage/sys-cluster/ipvsadm-1.26/work/ipvsadm-1.26/libipvs'
gcc  -Wall -Wunused -Wstrict-prototypes -g -o ipvsadm ipvsadm.o config_stream.o dynamic_array.o libipvs/libipvs.a  -lnl
ipvsadm.o: In function `parse_options':
ipvsadm.c:(.text+0x23b2): undefined reference to `poptGetContext'
ipvsadm.c:(.text+0x23bd): undefined reference to `poptGetNextOpt'
ipvsadm.c:(.text+0x2408): undefined reference to `poptGetNextOpt'
ipvsadm.c:(.text+0x2425): undefined reference to `poptBadOption'
ipvsadm.c:(.text+0x2441): undefined reference to `poptGetNextOpt'
ipvsadm.c:(.text+0x245f): undefined reference to `poptGetArg'
ipvsadm.c:(.text+0x2488): undefined reference to `poptFreeContext'
ipvsadm.c:(.text+0x2cab): undefined reference to `poptGetArg'
ipvsadm.c:(.text+0x2cc0): undefined reference to `poptGetArg'
ipvsadm.c:(.text+0x2cd0): undefined reference to `poptGetArg'
ipvsadm.c:(.text+0x2d65): undefined reference to `poptStrerror'
ipvsadm.c:(.text+0x2d75): undefined reference to `poptBadOption'
ipvsadm.c:(.text+0x2d9b): undefined reference to `poptFreeContext'
collect2: ld returned 1 exit status
make: *** [ipvsadm] Error 1
gcc  -Wall -Wunused -Wstrict-prototypes -g -o ipvsadm ipvsadm.o config_stream.o dynamic_array.o libipvs/libipvs.a  -lnl -lpopt
echo $?
0


Reproducible: Always




This patch fixes the issue.

--- ipvsadm-1.26.ebuild 2011-03-07 20:44:12.000000000 +0100
+++ ipvsadm-1.26-r1.ebuild      2011-04-05 18:39:19.283999186 +0200
@@ -34,6 +34,7 @@ src_compile() {
                INCLUDE="-I.. -I." \
                CC="$(tc-getCC)" \
                HAVE_NL=1 \
+               LDFLAGS="-lpopt" \
                 || die "error compiling source"
 }
Comment 1 Mike Williams 2011-04-24 13:38:23 UTC
The Makefile looks for libpopt.a to decide if it should add -lpopt, I've got dev-libs/popt installed but no libpopt.a.
As the Makefile sets 'POPT_LIB=-lpopt' if it finds libpopt.a that's what I added to the ebuild instead of LDFLAGS="-lpopt". Seemed to accomplish the same goal.

Mike
Comment 2 Ultrabug gentoo-dev 2011-05-23 16:41:31 UTC
Fixed in tree, thanks to xarthisius.

*** This bug has been marked as a duplicate of bug 367871 ***