diff --git a/Make.inc b/Make.inc index 96064cb7eac15..04650e68b643e 100644 --- a/Make.inc +++ b/Make.inc @@ -603,15 +603,15 @@ endif ifeq ($(OS),WINNT) define versioned_libname -$$(if $(2),$(1)-$(2).$(SHLIB_EXT),$(1).$(SHLIB_EXT)) +$(if $(2),$(1)-$(2).$(SHLIB_EXT),$(1).$(SHLIB_EXT)) endef else ifeq ($(OS),Darwin) define versioned_libname -$$(if $(2),$(1).$(2).$(SHLIB_EXT),$(1).$(SHLIB_EXT)) +$(if $(2),$(1).$(2).$(SHLIB_EXT),$(1).$(SHLIB_EXT)) endef else define versioned_libname -$$(if $(2),$(1).$(SHLIB_EXT).$(2),$(1).$(SHLIB_EXT)) +$(if $(2),$(1).$(SHLIB_EXT).$(2),$(1).$(SHLIB_EXT)) endef endif diff --git a/deps/csl.mk b/deps/csl.mk index 457e276c66709..37956ba5c3505 100644 --- a/deps/csl.mk +++ b/deps/csl.mk @@ -32,8 +32,8 @@ ifeq ($(USE_SYSTEM_CSL),1) USE_BINARYBUILDER_CSL ?= 0 else # If it's not, see if we should disable it due to `libstdc++` being newer: -LIBSTDCXX_PATH := $(eval $(call pathsearch,libstdc++,$(STD_LIB_PATH))) -ifneq (,$(and $(LIBSTDCXX_PATH),$(shell objdump -p $(LIBSTDCXX_PATH) | grep $(CSL_NEXT_GLIBCXX_VERSION)))) +LIBSTDCXX_PATH := $(call pathsearch,$(call versioned_libname,libstdc++,6),$(STD_LIB_PATH)) +ifneq (,$(and $(LIBSTDCXX_PATH),$(shell objdump -p '$(LIBSTDCXX_PATH)' | grep '$(CSL_NEXT_GLIBCXX_VERSION)'))) # Found `libstdc++`, grepped it for strings and found a `GLIBCXX` symbol # that is newer that whatever we have in CSL. Default to not using BB. USE_BINARYBUILDER_CSL ?= 0 @@ -50,8 +50,8 @@ ifeq ($(USE_BINARYBUILDER_CSL),0) define copy_csl install-csl: | $$(build_shlibdir) $$(build_shlibdir)/$(1) $$(build_shlibdir)/$(1): | $$(build_shlibdir) - -@SRC_LIB=$$(call pathsearch,$(1),$$(STD_LIB_PATH)); \ - [ -n "$$$${SRC_LIB}" ] && cp $$$${SRC_LIB} $$(build_shlibdir) + -@SRC_LIB='$$(call pathsearch,$(1),$$(STD_LIB_PATH))'; \ + [ -n "$$$${SRC_LIB}" ] && cp "$$$${SRC_LIB}" '$$(build_shlibdir)' endef # libgfortran has multiple names; we're just going to copy any version we can find diff --git a/deps/sanitizers.mk b/deps/sanitizers.mk index 81db75a4ee63e..1a272321c05fa 100644 --- a/deps/sanitizers.mk +++ b/deps/sanitizers.mk @@ -6,12 +6,12 @@ SANITIZER_LIB_PATH := $(dir $(shell LANG=C $(CC) -print-file-name=libasan.so)) endif # Given a colon-separated list of paths in $(2), find the location of the library given in $(1) -define pathsearch +define pathsearch_all $(wildcard $(addsuffix /$(1),$(subst :, ,$(2)))) endef define copy_sanitizer_lib -install-sanitizers: $$(addprefix $$(build_libdir)/, $$(notdir $$(call pathsearch,$(1),$$(SANITIZER_LIB_PATH)))) | $$(build_shlibdir) +install-sanitizers: $$(addprefix $$(build_libdir)/, $$(notdir $$(call pathsearch_all,$(1),$$(SANITIZER_LIB_PATH)))) | $$(build_shlibdir) $$(addprefix $$(build_shlibdir)/,$(2)): $$(addprefix $$(SANITIZER_LIB_PATH)/,$(2)) | $$(build_shlibdir) -cp $$< $$@ endef