Skip to content

Commit d080fe6

Browse files
authored
build: fix various makefile bugs (#50591)
Trying for cross-compile and disabling CSL and realized both of those configurations were broken now.
2 parents 51941ed + 9dc1380 commit d080fe6

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Make.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -603,15 +603,15 @@ endif
603603

604604
ifeq ($(OS),WINNT)
605605
define versioned_libname
606-
$$(if $(2),$(1)-$(2).$(SHLIB_EXT),$(1).$(SHLIB_EXT))
606+
$(if $(2),$(1)-$(2).$(SHLIB_EXT),$(1).$(SHLIB_EXT))
607607
endef
608608
else ifeq ($(OS),Darwin)
609609
define versioned_libname
610-
$$(if $(2),$(1).$(2).$(SHLIB_EXT),$(1).$(SHLIB_EXT))
610+
$(if $(2),$(1).$(2).$(SHLIB_EXT),$(1).$(SHLIB_EXT))
611611
endef
612612
else
613613
define versioned_libname
614-
$$(if $(2),$(1).$(SHLIB_EXT).$(2),$(1).$(SHLIB_EXT))
614+
$(if $(2),$(1).$(SHLIB_EXT).$(2),$(1).$(SHLIB_EXT))
615615
endef
616616
endif
617617

deps/csl.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ ifeq ($(USE_SYSTEM_CSL),1)
3232
USE_BINARYBUILDER_CSL ?= 0
3333
else
3434
# If it's not, see if we should disable it due to `libstdc++` being newer:
35-
LIBSTDCXX_PATH := $(eval $(call pathsearch,libstdc++,$(STD_LIB_PATH)))
36-
ifneq (,$(and $(LIBSTDCXX_PATH),$(shell objdump -p $(LIBSTDCXX_PATH) | grep $(CSL_NEXT_GLIBCXX_VERSION))))
35+
LIBSTDCXX_PATH := $(call pathsearch,$(call versioned_libname,libstdc++,6),$(STD_LIB_PATH))
36+
ifneq (,$(and $(LIBSTDCXX_PATH),$(shell objdump -p '$(LIBSTDCXX_PATH)' | grep '$(CSL_NEXT_GLIBCXX_VERSION)')))
3737
# Found `libstdc++`, grepped it for strings and found a `GLIBCXX` symbol
3838
# that is newer that whatever we have in CSL. Default to not using BB.
3939
USE_BINARYBUILDER_CSL ?= 0
@@ -50,8 +50,8 @@ ifeq ($(USE_BINARYBUILDER_CSL),0)
5050
define copy_csl
5151
install-csl: | $$(build_shlibdir) $$(build_shlibdir)/$(1)
5252
$$(build_shlibdir)/$(1): | $$(build_shlibdir)
53-
-@SRC_LIB=$$(call pathsearch,$(1),$$(STD_LIB_PATH)); \
54-
[ -n "$$$${SRC_LIB}" ] && cp $$$${SRC_LIB} $$(build_shlibdir)
53+
-@SRC_LIB='$$(call pathsearch,$(1),$$(STD_LIB_PATH))'; \
54+
[ -n "$$$${SRC_LIB}" ] && cp "$$$${SRC_LIB}" '$$(build_shlibdir)'
5555
endef
5656

5757
# libgfortran has multiple names; we're just going to copy any version we can find

deps/sanitizers.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ SANITIZER_LIB_PATH := $(dir $(shell LANG=C $(CC) -print-file-name=libasan.so))
66
endif
77

88
# Given a colon-separated list of paths in $(2), find the location of the library given in $(1)
9-
define pathsearch
9+
define pathsearch_all
1010
$(wildcard $(addsuffix /$(1),$(subst :, ,$(2))))
1111
endef
1212

1313
define copy_sanitizer_lib
14-
install-sanitizers: $$(addprefix $$(build_libdir)/, $$(notdir $$(call pathsearch,$(1),$$(SANITIZER_LIB_PATH)))) | $$(build_shlibdir)
14+
install-sanitizers: $$(addprefix $$(build_libdir)/, $$(notdir $$(call pathsearch_all,$(1),$$(SANITIZER_LIB_PATH)))) | $$(build_shlibdir)
1515
$$(addprefix $$(build_shlibdir)/,$(2)): $$(addprefix $$(SANITIZER_LIB_PATH)/,$(2)) | $$(build_shlibdir)
1616
-cp $$< $$@
1717
endef

0 commit comments

Comments
 (0)