From f9caff1e8b13f0b739a1c8dfadeae47347fa4eba Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Tue, 9 Oct 2012 18:00:43 +0200 Subject: [PATCH] - create libiptc.so as ld script --- iptables.spec | 6 ++++++ no-libiptc.patch | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/iptables.spec b/iptables.spec index 060286e..41d4d37 100644 --- a/iptables.spec +++ b/iptables.spec @@ -238,6 +238,11 @@ install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} \ MANDIR=%{_mandir} \ LIBDIR=%{_libdir} +# upstream solution with empty library with two DT_NEEDED entries doesn't work +# with PLD's default LDFLAGS (--as-needed --no-copy-dt-needed-entries); +# use ld script instead (see no-libiptc.patch for source) +cp -p libiptc/libiptc.ld $RPM_BUILD_ROOT%{_libdir}/libiptc.so + install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name6} install -d $RPM_BUILD_ROOT/etc/init @@ -423,6 +428,7 @@ fi %attr(755,root,root) %{_libdir}/libip4tc.so %attr(755,root,root) %{_libdir}/libip6tc.so %attr(755,root,root) %{_libdir}/libipq.so +%attr(755,root,root) %{_libdir}/libiptc.so %attr(755,root,root) %{_libdir}/libxtables.so %{_libdir}/libip4tc.la %{_libdir}/libip6tc.la diff --git a/no-libiptc.patch b/no-libiptc.patch index c976f2b..bc6c838 100644 --- a/no-libiptc.patch +++ b/no-libiptc.patch @@ -13,3 +13,10 @@ libip4tc_la_LDFLAGS = -version-info 0:0:0 libip6tc_la_SOURCES = libip6tc.c +--- iptables-1.4.16.2/libiptc/libiptc.ld.orig 1970-01-01 01:00:00.000000000 +0100 ++++ iptables-1.4.16.2/libiptc/libiptc.ld 2012-10-09 17:47:42.606342693 +0200 +@@ -0,0 +1,4 @@ ++/* GNU ld script ++ Gather both libipt4c and libipt6c, using them only as needed */ ++OUTPUT_FORMAT(elf32-i386) ++GROUP ( AS_NEEDED ( /usr/lib/libip4tc.so /usr/lib/libip6tc.so ) ) -- 2.44.0