From 47e0b24d7a86acf429991ac155a51c78f1be341e Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sun, 2 Apr 2017 14:14:11 +0200 Subject: [PATCH] build: At least honor the LDFLAGS from the environment When not honoring the environment we end up linking it without the GNU_HASH for symbol look-up. Put the content into LIBS and place these options last to make it link. We still override the CFLAGS but that seems to not cause issues yet Fixes: ERROR: ... No GNU_HASH in the elf binary: 'rtl8168-eeprom' [ldflags] --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fde02af..d4dae86 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,11 @@ CFLAGS=-Wall -g `pkg-config --cflags libpci` -LDFLAGS=`pkg-config --libs libpci` +LIBS=`pkg-config --libs libpci` %.o: %.c $(CC) $(CFLAGS) -o $@ -c $^ rtl8168-eeprom: rtl8168-eeprom.o - $(CC) $(LDFLAGS) -o $@ $^ + $(CC) -o $@ $^ $(LDFLAGS) $(LIBS) clean: rm -f rtl8168-eeprom rtl8168-eeprom.o