]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
build: fix static linking
authorJan Engelhardt <jengelh@medozas.de>
Tue, 3 Aug 2010 17:58:38 +0000 (19:58 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Tue, 3 Aug 2010 17:58:38 +0000 (19:58 +0200)
Gabor Z. Papp noted this link-time error when configuring with
--enable-static:

extensions/libext4.a(initext4.o): In function "init_extensions":
extensions/initext4.c:144: undefined reference to "libxt_IDLETIMER_init"
extensions/initext4.c:145: undefined reference to "libxt_TEE_init"

Indeed, since the two modules did not use our special macro "_init"
(which expands to libxt_foo_init), initext4.c could not find them by
that name. Correct this.

References: http://marc.info/?l=netfilter&m=128085480927924&w=2
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
extensions/libxt_IDLETIMER.c
extensions/libxt_TEE.c

index 12573a4fe432d6bdf3284281aa930abb203372fc..1562e02a1532f1b538293bbf7a9f49c84110984c 100644 (file)
@@ -132,7 +132,7 @@ static struct xtables_target idletimer_tg_reg = {
        .extra_opts    = idletimer_tg_opts,
 };
 
-static __attribute__((constructor)) void idletimer_tg_ldr(void)
+void _init(void)
 {
        xtables_register_target(&idletimer_tg_reg);
 }
index f8e7fd1783d45bcb8c21509720a54f60a4c209a5..e4c0607e1d53b307bd2811074b4db24de9fdaa31 100644 (file)
@@ -195,7 +195,7 @@ static struct xtables_target tee_tg6_reg = {
        .extra_opts    = tee_tg_opts,
 };
 
-static __attribute__((constructor)) void tee_tg_ldr(void)
+void _init(void)
 {
        xtables_register_target(&tee_tg_reg);
        xtables_register_target(&tee_tg6_reg);