linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* iw Makefile patch to allow compilation using --as-needed
@ 2008-12-12 21:32 Mike Auty
  2008-12-12 21:48 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Auty @ 2008-12-12 21:32 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless

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

Hiya,
	I've got a patch for the iw program to allow it to compile properly
with the --as-needed linker flag.  This flag requires that files and
libraries are listed in a particular order, with required libraries
listed after the functions that call them.
	The original Makefile for iw adds the libraries to the LDFLAGS
variable, which is processed before the OBJS are listed (so the
libraries are removed).  This patch adds a LIBS variable and applies it
after the OBJS variable.
	For more information on as-needed, please see
http://www.gentoo.org/proj/en/qa/asneeded.xml.  If you have any problems
or issues with the patch, please let me know, thanks...  5:)
	Mike  5:)

[-- Attachment #2: iw-0.9.7-as-needed.patch --]
[-- Type: text/plain, Size: 715 bytes --]

diff --git a/Makefile b/Makefile
index df59b51..8a97bae 100644
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,7 @@ CC ?= "gcc"
 
 CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration `pkg-config --cflags libnl-1`
 CFLAGS += -O2 -g
-LDFLAGS += `pkg-config --libs libnl-1`
+LIBS += `pkg-config --libs libnl-1`
 NLVERSION = 1.0
 
 OBJS = iw.o info.o phy.o interface.o station.o util.o mpath.o reg.o mesh.o genl.o
@@ -42,7 +42,7 @@ version.h: version.sh
 
 iw:	$(OBJS)
 	@$(NQ) ' CC  ' iw
-	$(Q)$(CC) $(LDFLAGS) $(OBJS) -o iw
+	$(Q)$(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o iw
 
 check:
 	$(Q)$(MAKE) all CC="REAL_CC=$(CC) CHECK=\"sparse -Wall\" cgcc"

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: iw Makefile patch to allow compilation using --as-needed
  2008-12-12 21:32 iw Makefile patch to allow compilation using --as-needed Mike Auty
@ 2008-12-12 21:48 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2008-12-12 21:48 UTC (permalink / raw)
  To: Mike Auty; +Cc: linux-wireless

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

On Fri, 2008-12-12 at 21:32 +0000, Mike Auty wrote:
> Hiya,
> 	I've got a patch for the iw program to allow it to compile properly
> with the --as-needed linker flag.  This flag requires that files and
> libraries are listed in a particular order, with required libraries
> listed after the functions that call them.
> 	The original Makefile for iw adds the libraries to the LDFLAGS
> variable, which is processed before the OBJS are listed (so the
> libraries are removed).  This patch adds a LIBS variable and applies it
> after the OBJS variable.
> 	For more information on as-needed, please see
> http://www.gentoo.org/proj/en/qa/asneeded.xml.  If you have any problems
> or issues with the patch, please let me know, thanks...  5:)
> 	Mike  5:)

Applied, thanks.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-12-12 21:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-12 21:32 iw Makefile patch to allow compilation using --as-needed Mike Auty
2008-12-12 21:48 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).