https://github.com/JuliaLang/julia
Revision 7eb5cb89fb938a1dc67efa3861b25562767a7bbe authored by Shuhei Kadowaki on 12 March 2024, 11:57:25 UTC, committed by GitHub on 12 March 2024, 11:57:25 UTC
Previously `oc` constructed via `Core.OpaqueClosure` does not set
`oc.source.slot_syms` set, which caused segfaults either when trying to
`show` `oc.source` or if invocation of `oc(...)` threw an error. This
commit fixes that by making sure `oc.source.slot_syms` is set for `oc`
created with `jl_new_opaque_closure_from_code_info`.
1 parent 22602a2
Raw File
Tip revision: 7eb5cb89fb938a1dc67efa3861b25562767a7bbe authored by Shuhei Kadowaki on 12 March 2024, 11:57:25 UTC
set `slot_syms` for methods of OCs constructed via `Core.OpaqueClosure` (#53650)
Tip revision: 7eb5cb8
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_all
$(wildcard $(addsuffix /$(1),$(subst :, ,$(2))))
endef

define copy_sanitizer_lib
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

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