Skip to contentSkip to conversation

xtables-addons suggestions

PATCH Jonas Berlin 2 participants 5 messages Feb 16, 2010 – Feb 18, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi, I am using xtables-addons-1.22 and needed to do some changes to get it to compile in my setup. I thus present a few suggestions below:

1. When using --with-xtables, I got problems at linking time, failing to find libxtables.. By changing configure.ac like below I was able to solve the issue.

  libxtables_LIBS="-lxtables";
   to
  libxtables_LIBS="-lxtables -L $xtables_location/lib";

Currently only the include search paths are affected by the
- --with-xtables argument. It seems there could have been an option to instruct pkg-config to look for the xtables.pc file in the non-standard location, but I noticed that too late.

2. When using --with-kbuild, I got some strange compile errors which ended up being because it used header files from /usr/include/linux instead of from the path given to --with-kbuild. In fact, I was unable to find anything that would use the --with-kbuild argument. It ended up in the Makefiles as variables, but nobody used them. By changing Makefile.iptrules.in like below I was able to solve the issue.

  AM_CFLAGS         = ${regular_CFLAGS} ${libxtables_CFLAGS}
   to
  kinclude_CFLAGS   = @kinclude_CFLAGS@
  AM_CFLAGS         = ${regular_CFLAGS} ${libxtables_CFLAGS}
  ${kinclude_CFLAGS}

My suggestions as separate patches attached.

Thanks for a great product!

- --
- - xkr47
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (GNU/Linux)

iEYEARECAAYFAkt690gACgkQxyF48ZTvn+4ISQCfX48ElW58ew6IXlzTrJGpy3r7 TQUAoIb3fcfd3qNU1mWAEPorY8h/gxlx
=mcB9
-----END PGP SIGNATURE-----

configure.ac +1 -1
diff -u xtables-addons-1.22-orig/configure.ac xtables-addons-1.22/configure.ac
@@ -51,7 +51,7 @@
 			AC_MSG_RESULT([no])
 		fi;
 	fi;
-	libxtables_LIBS="-lxtables";
+	libxtables_LIBS="-lxtables -L $xtables_location/lib";
 	AC_SUBST([libxtables_CFLAGS])
 	AC_SUBST([libxtables_LIBS])
 else
Makefile.iptrules.in +2 -1
diff -u xtables-addons-1.22-orig/Makefile.iptrules.in xtables-addons-1.22/Makefile.iptrules.in
@@ -12,7 +12,8 @@
 regular_CFLAGS  = @regular_CFLAGS@
 libxtables_CFLAGS = @libxtables_CFLAGS@
 libxtables_LIBS   = @libxtables_LIBS@
-AM_CFLAGS         = ${regular_CFLAGS} ${libxtables_CFLAGS}
+kinclude_CFLAGS   = @kinclude_CFLAGS@
+AM_CFLAGS         = ${regular_CFLAGS} ${libxtables_CFLAGS} ${kinclude_CFLAGS}
 AM_DEPFLAGS     = -Wp,-MMD,$(@D)/.$(@F).d,-MT,$@
 
 AM_DEFAULT_VERBOSITY = 0
#1 lore raw
Quoted 11 lines · Jonas Berlin

Hi, I am using xtables-addons-1.22 and needed to do some changes to get it to compile in my setup. I thus present a few suggestions below:

1. When using --with-xtables, I got problems at linking time, failing to find libxtables.. By changing configure.ac like below I was able to solve the issue.

libxtables_LIBS="-lxtables";
to
libxtables_LIBS="-lxtables -L $xtables_location/lib";

--with-xtables is supposed to specify an iptables directory directly;
if at all, -L$xtables_location/.libs would have been the right option (due to how libtool stores its files).

I guess it makes more sense to just remove --with-xtables and let the user set PKG_CONFIG_PATH and/or CFLAGS,LDFLAGS accordingly instead, which should have the same result.

Quoted 8 lines

Currently only the include search paths are affected by the
- --with-xtables argument. It seems there could have been an option to instruct pkg-config to look for the xtables.pc file in the non-standard location, but I noticed that too late.

2. When using --with-kbuild, I got some strange compile errors which ended up being because it used header files from /usr/include/linux instead of from the path given to --with-kbuild.

--with-kbuild only affects the build of the kernel modules (which
does not use /usr/include at all) and this is intentional. Userspace should only use exported headers such as those from /usr/include or linux-2.6.xy/usr/include.

Quoted 2 lines

In fact, I was unable
to find anything that would use the --with-kbuild argument.

extensions/Makefile.am:_kcall = -C ${kbuilddir} M=${abs_srcdir}

#2 lore raw
Quoted 8 lines · Jan Engelhardt
Quoted 7 lines · Jonas Berlin

Hi, I am using xtables-addons-1.22 and needed to do some changes to get it to compile in my setup. I thus present a few suggestions below:

1. When using --with-xtables, I got problems at linking time, failing to find libxtables.. By changing configure.ac like below I was able to solve the issue.

Well after all, libxtables_LIBS is currently never used. (Extension modules don't link to it.)
So I cannot imagine linking problems, but that's the point where you have to provide logs.

#3 lore raw
Quoted 7 lines · On Tue, 16 Feb 2010 22:32:33 +0100 (CET) Jan Engelhardt <[email protected]>…
Quoted 5 lines · Jan Engelhardt
Quoted 4 lines · Jonas Berlin

Hi, I am using xtables-addons-1.22 and needed to do some changes to get it to compile in my setup. I thus present a few suggestions below:

Quoted 8 lines
Quoted 3 lines
Quoted 3 lines

1. When using --with-xtables, I got problems at linking time, failing to find libxtables.. By changing configure.ac like below I was able to solve the issue.

Well after all, libxtables_LIBS is currently never used. (Extension modules don't link to it.)
So I cannot imagine linking problems, but that's the point where you have to provide logs.

Please find compilation output attached, the essential part being:

make -f ../Makefile.iptrules all;
make[3]: Entering directory `/discs/11/backup/home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions'
CC libxt_CHAOS.oo
CCLD libxt_CHAOS.so
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lxtables
collect2: ld returned 1 exit status
make[3]: *** [libxt_CHAOS.so] Error 1

Seems to be this rule from Makefile.iptrules.in that is used:

lib%.so: lib%.oo

        ${AM_V_CCLD}${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $< ${libxtables_LIBS} ${LDLIBS};
Signature · 1 line
- xkr47
$ ./configure --prefix=/lib/modules/2.6.30-2/iptables --with-xtables=/home/xkr47/kernel/router/linux-2.6.30-2/lib/modules/2.6.30-2/iptables --with-gnu-ld --with-kbuild=/home/xkr47/kernel/router/linux-2.6.30-2/linux/src --enable-dependency-tracking
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking whether gcc and cc understand -c and -o together... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/x86_64-pc-linux-gnu/bin/ld
checking if the linker (/usr/x86_64-pc-linux-gnu/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/x86_64-pc-linux-gnu/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/x86_64-pc-linux-gnu/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking xtables.h presence... /home/xkr47/kernel/router/linux-2.6.30-2/lib/modules/2.6.30-2/iptables/include/xtables.h
no
checking linux/netfilter/x_tables.h usability... yes
checking linux/netfilter/x_tables.h presence... yes
checking for linux/netfilter/x_tables.h... yes
Found kernel version 2.6.30.0 in /home/xkr47/kernel/router/linux-2.6.30-2/linux/src
configure: creating ./config.status
config.status: creating Makefile
config.status: creating Makefile.iptrules
config.status: creating Makefile.mans
config.status: creating extensions/Makefile
config.status: creating extensions/ACCOUNT/Makefile
config.status: creating extensions/ipset/Makefile
config.status: creating extensions/pknock/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
$ make
make  all-recursive
make[1]: Entering directory `/discs/11/backup/home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src'
Making all in extensions
make[2]: Entering directory `/discs/11/backup/home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions'
if [ -n "/home/xkr47/kernel/router/linux-2.6.30-2/linux/src" ]; then make -C /home/xkr47/kernel/router/linux-2.6.30-2/linux/src M=/home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions modules; fi;
make[3]: Entering directory `/discs/11/backup/home/xkr47/kernel/router/linux-2.6.30-2/linux/src'
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/compat_xtables.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_CHAOS.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_DELUDE.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_DHCPMAC.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_IPMARK.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_LOGMARK.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_RAWNAT.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/iptable_rawpost.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ip6table_rawpost.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_SYSRQ.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_STEAL.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_TARPIT.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_TEE.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_condition.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_fuzzy.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_geoip.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_iface.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_ipp2p.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_ipv4options.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_length2.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_lscan.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_psd.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_quota2.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ACCOUNT/xt_ACCOUNT.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ipt_set.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ipt_SET.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_ipmap.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_portmap.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_macipmap.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_iphash.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_nethash.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_ipporthash.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_iptree.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_iptreemap.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_setlist.o
  CC [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/pknock/xt_pknock.o
  Building modules, stage 2.
  MODPOST 37 modules
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ACCOUNT/xt_ACCOUNT.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ACCOUNT/xt_ACCOUNT.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/compat_xtables.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/compat_xtables.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ip6table_rawpost.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ip6table_rawpost.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_iphash.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_iphash.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_ipmap.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_ipmap.ko
LIBS = 
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LIPO = 
LN_S = ln -s
LTLIBOBJS = 
MAKEINFO = ${SHELL} /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/missing --run makeinfo
MKDIR_P = /bin/mkdir -p
NM = /usr/bin/nm -B
NMEDIT = 
OBJDUMP = objdump
OBJEXT = o
OTOOL = 
OTOOL64 = 
PACKAGE = xtables-addons
PACKAGE_BUGREPORT = 
PACKAGE_NAME = xtables-addons
PACKAGE_STRING = xtables-addons 1.22
PACKAGE_TARNAME = xtables-addons
PACKAGE_VERSION = 1.22
PATH_SEPARATOR = :
PKG_CONFIG = 
RANLIB = ranlib
SED = /usr/bin/sed
SET_MAKE = 
SHELL = /bin/sh
STRIP = strip
VERSION = 1.22
abs_builddir = /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions
abs_srcdir = /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions
abs_top_builddir = /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src
abs_top_srcdir = /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src
ac_ct_CC = gcc
ac_ct_DUMPBIN = 
am__include = include
am__leading_dot = .
am__quote = 
am__tar = ${AMTAR} chof - "$$tardir"
am__untar = ${AMTAR} xf -
bindir = ${exec_prefix}/bin
build = x86_64-unknown-linux-gnu
build_alias = 
build_cpu = x86_64
build_os = linux-gnu
build_vendor = unknown
builddir = .
datadir = ${datarootdir}
datarootdir = ${prefix}/share
docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
dvidir = ${docdir}
exec_prefix = ${prefix}
host = x86_64-unknown-linux-gnu
host_alias = 
host_cpu = x86_64
host_os = linux-gnu
host_vendor = unknown
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
install_sh = ${SHELL} /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/install-sh
kbuilddir = /home/xkr47/kernel/router/linux-2.6.30-2/linux/src
kinclude_CFLAGS =  -I /home/xkr47/kernel/router/linux-2.6.30-2/linux/src/include
ksourcedir = 
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
libxtables_CFLAGS = -I /home/xkr47/kernel/router/linux-2.6.30-2/lib/modules/2.6.30-2/iptables/include
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_ipporthash.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_ipporthash.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_iptree.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_iptree.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_iptreemap.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_iptreemap.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_macipmap.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_macipmap.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_nethash.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_nethash.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_portmap.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_portmap.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_setlist.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ip_set_setlist.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ipt_SET.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ipt_SET.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ipt_set.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/ipset/ipt_set.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/iptable_rawpost.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/iptable_rawpost.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/pknock/xt_pknock.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/pknock/xt_pknock.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_CHAOS.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_CHAOS.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_DELUDE.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_DELUDE.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_DHCPMAC.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_DHCPMAC.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_IPMARK.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_IPMARK.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_LOGMARK.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_LOGMARK.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_RAWNAT.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_RAWNAT.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_STEAL.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_STEAL.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_SYSRQ.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_SYSRQ.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_TARPIT.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_TARPIT.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_TEE.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_TEE.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_condition.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_condition.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_fuzzy.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_fuzzy.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_geoip.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_geoip.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_iface.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_iface.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_ipp2p.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_ipp2p.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_ipv4options.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_ipv4options.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_length2.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_length2.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_lscan.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_lscan.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_psd.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_psd.ko
  CC      /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_quota2.mod.o
  LD [M]  /home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions/xt_quota2.ko
make[3]: Leaving directory `/discs/11/backup/home/xkr47/kernel/router/linux-2.6.30-2/linux/src'
make -f ../Makefile.iptrules all;
make[3]: Entering directory `/discs/11/backup/home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions'
  CC     libxt_CHAOS.oo
  CCLD   libxt_CHAOS.so
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lxtables
collect2: ld returned 1 exit status
make[3]: *** [libxt_CHAOS.so] Error 1
make[3]: Leaving directory `/discs/11/backup/home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions'
make[2]: *** [user-all-local] Error 2
make[2]: Leaving directory `/discs/11/backup/home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/discs/11/backup/home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src'
make: *** [all] Error 2
#4 lore raw
Quoted 1 line · Jonas Berlin
Quoted 1 line

Well after all, libxtables_LIBS is currently never used.

(Oh well it is used)

Quoted 14 lines
Quoted 3 lines

(Extension modules don't link to it.)
So I cannot imagine linking problems, but that's the point where you have to provide logs.

Please find compilation output attached, the essential part being:

make -f ../Makefile.iptrules all;
make[3]: Entering directory `/discs/11/backup/home/xkr47/kernel/router/linux-2.6.30-2/xtables-addons/src/extensions'
CC libxt_CHAOS.oo
CCLD libxt_CHAOS.so
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lxtables
collect2: ld returned 1 exit status
make[3]: *** [libxt_CHAOS.so] Error 1

Quoted 4 lines

Seems to be this rule from Makefile.iptrules.in that is used:

lib%.so: lib%.oo

       ${AM_V_CCLD}${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $< ${libxtables_LIBS} ${LDLIBS};

And you are able to make it link by overriding said libxtables_LIBS to your liking either at make time or (preferably) at configure time, as shown in the updated (in git) INSTALL file.