Fix "/usr/bin/ld: -f may not be used without -shared" (Issue 219)

This commit is contained in:
Jeffrey Walton 2016-07-06 15:08:24 -04:00
parent 6c0b120072
commit 2e14d5d7cb

View File

@ -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