From 1a7f19cdde7c84c88f96c5a5125447a9f4df0025 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Tue, 2 Jan 2018 01:13:59 -0500 Subject: [PATCH] Use 'command -v' to test for ld.gold --- GNUmakefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 7e49cdcd..84f89dd4 100755 --- a/GNUmakefile +++ b/GNUmakefile @@ -21,7 +21,6 @@ CHMOD ?= chmod MKDIR ?= mkdir LN ?= ln -sf LDCONF ?= /sbin/ldconfig -n -UNAME := $(shell uname) # Solaris provides a non-Posix shell at /usr/bin ifneq ($(wildcard /usr/xpg4/bin),) @@ -593,7 +592,8 @@ endif # Asan # LD gold linker testing. Triggered by 'LD=ld.gold'. ifeq ($(findstring ld.gold,$(LD)),ld.gold) ifeq ($(findstring -fuse-ld=gold,$(CXXFLAGS)),) - ELF_FORMAT := $(shell file `which ld.gold` 2>&1 | cut -d":" -f 2 | $(GREP) -i -c "elf") + LD_GOLD = $(shell command -v ld.gold) + ELF_FORMAT := $(shell file $(LD_GOLD) 2>&1 | cut -d":" -f 2 | $(GREP) -i -c "elf") ifneq ($(ELF_FORMAT),0) LDFLAGS += -fuse-ld=gold endif # ELF/ELF64