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

Bug 246016

Summary: net-firewall/ipset-2.4.2 does not respect LDFLAGS (patch provided)
Product: Gentoo Linux Reporter: Olivier Huber <oli.huber>
Component: Current packagesAssignee: Robin Johnson <robbat2>
Status: RESOLVED FIXED    
Severity: normal CC: pva
Priority: High    
Version: 2008.0   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 331933    
Attachments: patch proposal for the Makefile
patch proposal for the ebuild

Description Olivier Huber 2008-11-07 22:22:08 UTC
* QA Notice: Files built without respecting LDFLAGS have been detected
 * Please include the following list of files in your report:
 * /lib64/ipset/libipset_ipmap.so
 * /lib64/ipset/libipset_portmap.so
 * /lib64/ipset/libipset_macipmap.so
 * /lib64/ipset/libipset_iptree.so
 * /lib64/ipset/libipset_iptreemap.so
 * /lib64/ipset/libipset_iphash.so
 * /lib64/ipset/libipset_nethash.so
 * /lib64/ipset/libipset_ipporthash.so
 * /lib64/ipset/libipset_ipportiphash.so
 * /lib64/ipset/libipset_ipportnethash.so
 * /lib64/ipset/libipset_setlist.so
 * /sbin/ipset

Here is 2 patches to fix this. A quick look at this Makefile shows that the fix for the bin is rather simple.
But I'm not shure about the fix for the librairies.

--- Makefile.~  2008-11-07 21:40:41.176608351 +0100
+++ Makefile    2008-11-07 21:41:26.524605707 +0100
@@ -80,14 +80,14 @@
        $(CC) $(CFLAGS) -DIPSET_VERSION=\"$(IPSET_VERSION)\" -DIPSET_LIB_DIR=\"$(IPSET_LIB_DIR)\" -c -o $@ $<

 ipset: ipset.o
-       $(CC) $(CFLAGS) -rdynamic -o $@ $^ -ldl
+       $(CC) $(CFLAGS) $(LDFLAGS) -rdynamic -o $@ $^ -ldl

 #Pooltypes
 ipset_%.o: ipset_%.c ipset.h
        $(CC) $(SH_CFLAGS) -o $@ -c $<

 libipset_%.so: ipset_%.o
-       $(LD) -shared -o $@ $<
+       $(LD) $(LDDFLAGS) -shared -o $@ $<

 $(DESTDIR)$(LIBDIR)/ipset/libipset_%.so: libipset_%.so
        @[ -d $(DESTDIR)$(LIBDIR)/ipset ] || mkdir -p $(DESTDIR)$(LIBDIR)/ipset

--- ipset-2.4.2.ebuild.old  2008-10-24 23:28:25.000000000 +0200
+++ ipset-2.4.2.ebuild  2008-11-07 22:24:49.000000000 +0100
@@ -71,7 +71,7 @@

 src_compile() {
        einfo "Building userspace"
-       emake CC="$(tc-getCC)" COPT_FLAGS="${CFLAGS}" ${myconf} binaries || die "failed to build"
+       emake LDDFLAGS="${LDFLAGS//-Wl,}" CC="$(tc-getCC)" COPT_FLAGS="${CFLAGS}" ${myconf} binaries || die "failed to build"

        if [[ $modules -eq 1 ]]; then
                einfo "Building kernel modules"
Comment 1 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2008-11-09 00:59:55 UTC
You should use LDDFLAGS="$(raw-ldflags)" instead of LDDFLAGS="${LDFLAGS//-Wl,}".
(flag-o-matic.eclass should be inherited.)
Comment 2 Olivier Huber 2008-11-09 14:03:05 UTC
(In reply to comment #1)
> You should use LDDFLAGS="$(raw-ldflags)" instead of
> LDDFLAGS="${LDFLAGS//-Wl,}".
> (flag-o-matic.eclass should be inherited.)
> 
Thanks, this is exactly the function I was looking for.
I'll repost updated patches.
Comment 3 Olivier Huber 2008-11-09 14:04:11 UTC
Created attachment 171183 [details, diff]
patch proposal for the Makefile
Comment 4 Olivier Huber 2008-11-09 14:08:01 UTC
Created attachment 171185 [details, diff]
patch proposal for the ebuild
Comment 5 Peter Volkov (RETIRED) gentoo-dev 2009-01-31 16:21:59 UTC
Thank you for report Olivier. Fixed in 2.4.7.