[netfilter-cvslog] r6645 - in trunk/iptables: . include

kaber at netfilter.org kaber at netfilter.org
Thu Jul 20 18:59:05 CEST 2006


Author: kaber at netfilter.org
Date: 2006-07-20 18:59:04 +0200 (Thu, 20 Jul 2006)
New Revision: 6645

Modified:
   trunk/iptables/Makefile
   trunk/iptables/Rules.make
   trunk/iptables/include/iptables_common.h
Log:
[PATCH] Use gcc to build shared objects (Phil Oester <kernel at linuxace.com>)

As suggested by Dmitry Levin and included in Fedora Core releases,
use gcc instead of ld to link shared objects.  Fedora rpm notes
refer to this fixing a plugin problem, but does not offer specifics.
But in any event, 'gcc -dumpspecs' does show gcc will pass a number
of parameters which in theory it thinks are better.

Compile tested both with and without NO_SHARED_LIBS.

Closes bug #454.


Modified: trunk/iptables/Makefile
===================================================================
--- trunk/iptables/Makefile	2006-07-10 04:52:56 UTC (rev 6644)
+++ trunk/iptables/Makefile	2006-07-20 16:59:04 UTC (rev 6645)
@@ -67,7 +67,7 @@
 		# The kernel is 64-bit, even though userspace is 32.
 		CFLAGS+=-DIPT_MIN_ALIGN=8 -DKERNEL_64_USERSPACE_32
 	else
-		EXT_LDFLAGS=-m elf64_sparc
+		EXT_LDFLAGS+=-Wl,-m,elf64_sparc
 	endif
 endif
 

Modified: trunk/iptables/Rules.make
===================================================================
--- trunk/iptables/Rules.make	2006-07-10 04:52:56 UTC (rev 6644)
+++ trunk/iptables/Rules.make	2006-07-20 16:59:04 UTC (rev 6645)
@@ -31,7 +31,7 @@
 	    sed -e 's@^.*\.o:@$*.d $*_sh.o:@' > $@
 
 $(SHARED_LIBS): %.so : %_sh.o
-	$(LD) -shared $(EXT_LDFLAGS) -o $@ $<
+	$(CC) -shared $(EXT_LDFLAGS) -o $@ $<
 
 $(SHARED_SE_LIBS:%.so=%.d): %.d: %.c
 	@-$(CC) -M -MG $(CFLAGS) $< | \

Modified: trunk/iptables/include/iptables_common.h
===================================================================
--- trunk/iptables/include/iptables_common.h	2006-07-10 04:52:56 UTC (rev 6644)
+++ trunk/iptables/include/iptables_common.h	2006-07-20 16:59:04 UTC (rev 6645)
@@ -33,8 +33,10 @@
 extern const char *program_name, *program_version;
 extern char *lib_dir;
 
+#define _init __attribute__((constructor)) my_init
 #ifdef NO_SHARED_LIBS
 # ifdef _INIT
+#  undef _init
 #  define _init _INIT
 # endif
   extern void init_extensions(void);




More information about the netfilter-cvslog mailing list