From 2e14d5d7cb8868eb2a376fd7b76e5cb2169574f9 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Wed, 6 Jul 2016 15:08:24 -0400 Subject: [PATCH] Fix "/usr/bin/ld: -f may not be used without -shared" (Issue 219) --- GNUmakefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 12b1542c..e45f7b3a 100755 --- a/GNUmakefile +++ b/GNUmakefile @@ -303,10 +303,10 @@ endif # Asan # LD gold linker testing. Triggered by 'LD=ld.gold'. ifeq ($(findstring ld.gold,$(LD)),ld.gold) -ifeq ($(findstring -Wl,-fuse-ld=gold,$(LDFLAGS)),) +ifeq ($(findstring -fuse-ld=gold,$(CXXFLAGS)),) ELF_FORMAT := $(shell file `which ld.gold` 2>&1 | cut -d":" -f 2 | $(EGREP) -i -c "elf") ifneq ($(ELF_FORMAT),0) -LDFLAGS += -Wl,-fuse-ld=gold +LDFLAGS += -fuse-ld=gold endif # ELF/ELF64 endif # CXXFLAGS endif # Gold