All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phil Oester <kernel@linuxace.com>
To: netfilter-devel@lists.netfilter.org
Subject: [PATCH] Use gcc to build shared objects
Date: Sat, 15 Jul 2006 12:25:08 -0700	[thread overview]
Message-ID: <20060715192508.GA14699@linuxace.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 400 bytes --]

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.

Phil



[-- Attachment #2: patch-iptableslink --]
[-- Type: text/plain, Size: 1292 bytes --]

diff -ru ipt-orig/include/iptables_common.h ipt-new/include/iptables_common.h
--- ipt-orig/include/iptables_common.h	2006-06-19 09:53:03.000000000 -0700
+++ ipt-new/include/iptables_common.h	2006-07-15 12:02:59.000000000 -0700
@@ -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);
diff -ru ipt-orig/Makefile ipt-new/Makefile
--- ipt-orig/Makefile	2006-07-11 14:55:05.000000000 -0700
+++ ipt-new/Makefile	2006-07-15 12:15:23.000000000 -0700
@@ -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
 
diff -ru ipt-orig/Rules.make ipt-new/Rules.make
--- ipt-orig/Rules.make	2006-05-24 09:11:58.000000000 -0700
+++ ipt-new/Rules.make	2006-07-15 12:02:59.000000000 -0700
@@ -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) $< | \

             reply	other threads:[~2006-07-15 19:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-15 19:25 Phil Oester [this message]
2006-07-20 16:31 ` [PATCH] Use gcc to build shared objects Patrick McHardy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060715192508.GA14699@linuxace.com \
    --to=kernel@linuxace.com \
    --cc=netfilter-devel@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.