Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 246016 - net-firewall/ipset-2.4.2 does not respect LDFLAGS (patch provided)
Summary: net-firewall/ipset-2.4.2 does not respect LDFLAGS (patch provided)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: ldflags
  Show dependency tree
 
Reported: 2008-11-07 22:22 UTC by Olivier Huber
Modified: 2010-08-09 21:00 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch proposal for the Makefile (ipset-makefile-respect-LDFLAGS.patch,639 bytes, patch)
2008-11-09 14:04 UTC, Olivier Huber
Details | Diff
patch proposal for the ebuild (ipset.ebuild.patch,913 bytes, patch)
2008-11-09 14:08 UTC, Olivier Huber
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.