diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | Rules.make | 2 | ||||
-rw-r--r-- | include/iptables_common.h | 2 |
3 files changed, 4 insertions, 2 deletions
@@ -67,7 +67,7 @@ ifeq ($(shell uname -m),sparc64) # 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 @@ -31,7 +31,7 @@ $(SHARED_LIBS:%.so=%.d): %.d: %.c 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) $< | \ diff --git a/include/iptables_common.h b/include/iptables_common.h index 64723c3c..e214d1fd 100644 --- a/include/iptables_common.h +++ b/include/iptables_common.h @@ -33,8 +33,10 @@ void exit_error(enum exittype, char *, ...)__attribute__((noreturn, 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); |