Skip to content

Commit 62a06de

Browse files
FlameeyesLuis R. Rodriguez
authored and
Luis R. Rodriguez
committed
crda: Fix --as-needed usage
For --as-needed to work (and for traditional ld too) the libraries should always be passed _after_ the object files, move them so that they are picked up properly. Also rename LIBS to NLLIBS to avoid confusion between LIBS/LDLIBS. Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
1 parent 59ea647 commit 62a06de

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ endif
4848

4949
ifeq ($(NL2FOUND),Y)
5050
CFLAGS += -DCONFIG_LIBNL20
51-
LIBS += -lnl-genl
51+
NLLIBS += -lnl-genl
5252
NLLIBNAME = libnl-2.0
5353
endif
5454

55-
LIBS += `pkg-config --libs $(NLLIBNAME)`
55+
NLLIBS += `pkg-config --libs $(NLLIBNAME)`
5656
CFLAGS += `pkg-config --cflags $(NLLIBNAME)`
5757

5858
ifeq ($(V),1)
@@ -85,7 +85,7 @@ keys-%.c: utils/key2pub.py $(wildcard $(PUBKEY_DIR)/*.pem)
8585

8686
crda: reglib.o crda.o
8787
$(NQ) ' LD ' $@
88-
$(Q)$(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) -o $@ $^ $(LDLIBS)
88+
$(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS) $(NLLIBS)
8989

9090
regdbdump: reglib.o regdbdump.o print-regdom.o
9191
$(NQ) ' LD ' $@

0 commit comments

Comments
 (0)