Skip to contentSkip to conversation

Allow CRDA to be compiled with -Wl,--as-needed

PATCH New Tony Vroon 1 participant 1 message Nov 27, 2008 Kbuild

lore
Share & tools
lore

Tony Vroon

author
#0 lore raw

PATCH 1/1 Allow CRDA to be compiled with -Wl,--as-needed

As libraries are passed in LDFLAGS, it is vital that they be specified after the object files. Otherwise, --as-needed will discard the libraries as unused and linking will fail.

Makefile renamed from Makefile.orig +3 -3
@@ -35,15 +35,15 @@
 
 crda: keys-ssl.c keys-gcrypt.c reglib.o crda.o
 	$(NQ) '  LD  ' $@
-	$(Q)$(CC) $(CFLAGS) $(LDFLAGS) `pkg-config --libs libnl-1` -o $@ reglib.o crda.o
+	$(Q)$(CC) $(CFLAGS) `pkg-config --libs libnl-1` -o $@ reglib.o crda.o $(LDFLAGS)
 
 regdbdump: keys-ssl.c keys-gcrypt.c reglib.o regdbdump.o
 	$(NQ) '  LD  ' $@
-	$(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ reglib.o regdbdump.o
+	$(Q)$(CC) $(CFLAGS) -o $@ reglib.o regdbdump.o $(LDFLAGS)
 
 intersect: keys-ssl.c keys-gcrypt.c reglib.o intersect.o
 	$(NQ) '  LD  ' $@
-	$(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ reglib.o intersect.o
+	$(Q)$(CC) $(CFLAGS) -o $@ reglib.o intersect.o $(LDFLAGS)
 
 verify: $(REG_BIN) regdbdump
 	$(NQ) '  CHK  $(REG_BIN)'