~arges/ubuntu/precise/iptables/fix-lp982961

« back to all changes in this revision

Viewing changes to debian/patches/0002-libxt_statistic-link-with-lm.patch

  • Committer: Chris J Arges
  • Date: 2013-01-30 14:48:35 UTC
  • Revision ID: chris.j.arges@canonical.com-20130130144835-lyt8c5ioney1eu0w
Add debian/patches/0002-libxt_RATEEST-link-with-lm.patch and
debian/patches/0003-libxt_statistic-link-with-lm.patch to fix broken
RATEEST and statistic modules. (LP: #982961)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From: Jan Engelhardt <jengelh@medozas.de>
 
2
Date: Sat, 3 Sep 2011 11:34:40 +0000 (+0200)
 
3
Subject: libxt_statistic: link with -lm
 
4
X-Git-Tag: v1.4.12.2~14^2~4
 
5
X-Git-Url: http://git.netfilter.org/cgi-bin/gitweb.cgi?p=iptables.git;a=commitdiff_plain;h=d4e72dc1c684c2f8361d87e6bde2902cd2ee8efb
 
6
 
 
7
libxt_statistic: link with -lm
 
8
 
 
9
$ ldd -r libxt_statistic.so
 
10
undefined symbol: lround        (./libxt_statistic.so)
 
11
 
 
12
References: https://bugs.archlinux.org/task/25358
 
13
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
 
14
---
 
15
 
 
16
diff --git a/extensions/GNUmakefile.in b/extensions/GNUmakefile.in
 
17
index 2b48d84..dbf210c 100644
 
18
--- a/extensions/GNUmakefile.in
 
19
+++ b/extensions/GNUmakefile.in
 
20
@@ -90,11 +90,14 @@ init%.o: init%.c
 
21
 #      Shared libraries
 
22
 #
 
23
 lib%.so: lib%.oo
 
24
-       ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $<;
 
25
+       ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $< ${$*_LIBADD};
 
26
 
 
27
 lib%.oo: ${srcdir}/lib%.c
 
28
        ${AM_VERBOSE_CC} ${CC} ${AM_CPPFLAGS} ${AM_DEPFLAGS} ${AM_CFLAGS} -D_INIT=lib$*_init -DPIC -fPIC ${CFLAGS} -o $@ -c $<;
 
29
 
 
30
+# Need the LIBADDs in iptables/Makefile.am too for libxtables_la_LIBADD
 
31
+xt_statistic_LIBADD = -lm
 
32
+
 
33
 
 
34
 #
 
35
 #      Static bits
 
36
diff --git a/iptables/Makefile.am b/iptables/Makefile.am
 
37
index addb159..f6db32d 100644
 
38
--- a/iptables/Makefile.am
 
39
+++ b/iptables/Makefile.am
 
40
@@ -6,12 +6,17 @@ AM_CPPFLAGS      = ${regular_CPPFLAGS} -I${top_builddir}/include -I${top_srcdir}
 
41
 lib_LTLIBRARIES       = libxtables.la
 
42
 libxtables_la_SOURCES = xtables.c xtoptions.c
 
43
 libxtables_la_LDFLAGS = -version-info ${libxtables_vcurrent}:0:${libxtables_vage}
 
44
+libxtables_la_LIBADD  =
 
45
+if ENABLE_STATIC
 
46
+# With --enable-static, shipped extensions are linked into the main executable,
 
47
+# so we need all the LIBADDs here too
 
48
+libxtables_la_LIBADD += -lm
 
49
+endif
 
50
 if ENABLE_SHARED
 
51
 libxtables_la_CFLAGS  = ${AM_CFLAGS}
 
52
-libxtables_la_LIBADD  = -ldl
 
53
+libxtables_la_LIBADD += -ldl
 
54
 else
 
55
 libxtables_la_CFLAGS  = ${AM_CFLAGS} -DNO_SHARED_LIBS=1
 
56
-libxtables_la_LIBADD  =
 
57
 endif
 
58
 
 
59
 xtables_multi_SOURCES  = xtables-multi.c iptables-xml.c
 
60