build: Don't pass -fuse-ld to compiler if LD_TYPE not set

Don't assume detection of LD by the detect_cc script suceeded. If it
wasn't detected then LD_TYPE won't be set and the gcc command line
option shouldn't be set either. Compilation will fail if -fuse-ld is
specified with no value.

Change-Id: If4a0ede8cdc5a71cf92de2beb0f24e4650f58f3a
Signed-off-by: Jonathan Richardson <jonathan.richardson@broadcom.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447376
Reviewed-by: Scott Branden <sbranden@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Jonathan Richardson 2019-02-20 17:12:43 -08:00 committed by Jim Harris
parent 62266a72cf
commit 1c96c421eb

View File

@ -126,7 +126,9 @@ LDFLAGS += -Wl,-z,relro,-z,now
LDFLAGS += -Wl,-z,noexecstack
# Specify the linker to use
ifneq ($(LD_TYPE),)
LDFLAGS += -fuse-ld=$(LD_TYPE)
endif
ifeq ($(OS),FreeBSD)
SYS_LIBS += -L/usr/local/lib