Revision 34ba62f85affe7e539faab25f22ee13ed614902d authored by Keno Fischer on 18 July 2023, 02:57:09 UTC, committed by GitHub on 18 July 2023, 02:57:09 UTC
I had an off-by-one in #50556, since the argument slots actually start
at 2 and `iota` starts at `0`. This was breaking StaticArrays
precompiles, which attempts to precompile a generator with its abstract
signature and without the nospecialize, those signatures are not
compileable.

Co-authored-by: Oscar Smith <oscardssmith@gmail.com>
1 parent c0d5352
Raw File
sanitizers.mk
# Interrogate the compiler about where it is keeping its sanitizer libraries
ifeq ($(USECLANG),1)
SANITIZER_LIB_PATH := $(shell LANG=C $(CC) -print-runtime-dir)
else
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
$(wildcard $(addsuffix /$(1),$(subst :, ,$(2))))
endef

define copy_sanitizer_lib
install-sanitizers: $$(addprefix $$(build_libdir)/, $$(notdir $$(call pathsearch,$(1),$$(SANITIZER_LIB_PATH)))) | $$(build_shlibdir)
$$(addprefix $$(build_shlibdir)/,$(2)): $$(addprefix $$(SANITIZER_LIB_PATH)/,$(2)) | $$(build_shlibdir)
	-cp $$< $$@
endef

ifeq ($(USECLANG),1)

## Clang libraries
$(eval $(call copy_sanitizer_lib,$(call versioned_libname,libclang_rt.asan-*),$(call versioned_libname,libclang_rt.asan-%)))

endif

get-sanitizers:
clean-sanitizers:
	-rm -f $(build_shlibdir)/libclang_rt.asan*$(SHLIB_EXT)*
distclean-sanitizers: clean-sanitizers
back to top