From 63e07a11ac3b8ac9f691db90170784c304a30b74 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 8 Jan 2025 10:26:57 +0000 Subject: [PATCH 1/6] Adding support for building using BB version of mmtk-julia --- Make.inc | 9 ++- deps/checksums/mmtk_julia | 7 ++- deps/mmtk/mmtk.h | 113 +++++++++++++++++++++++++++++++++++++ deps/mmtk/mmtkMutator.h | 114 ++++++++++++++++++++++++++++++++++++++ deps/mmtk_julia.mk | 8 +++ 5 files changed, 249 insertions(+), 2 deletions(-) create mode 100644 deps/mmtk/mmtk.h create mode 100644 deps/mmtk/mmtkMutator.h diff --git a/Make.inc b/Make.inc index 26b5ae7752555..7af7c59fdf7c8 100644 --- a/Make.inc +++ b/Make.inc @@ -1402,7 +1402,7 @@ CSL_NEXT_GLIBCXX_VERSION=GLIBCXX_3\.4\.34|GLIBCXX_3\.5\.|GLIBCXX_4\. # Note: we explicitly _do not_ define `CSL` here, since it requires some more # advanced techniques to decide whether it should be installed from a BB source # or not. See `deps/csl.mk` for more detail. -BB_PROJECTS := BLASTRAMPOLINE OPENBLAS LLVM LIBSUITESPARSE OPENLIBM GMP OPENSSL LIBSSH2 NGHTTP2 MPFR CURL LIBGIT2 PCRE LIBUV LIBUNWIND DSFMT OBJCONV ZLIB P7ZIP LLD LIBTRACYCLIENT BOLT +BB_PROJECTS := BLASTRAMPOLINE OPENBLAS LLVM LIBSUITESPARSE OPENLIBM GMP OPENSSL LIBSSH2 NGHTTP2 MPFR CURL LIBGIT2 PCRE LIBUV LIBUNWIND DSFMT OBJCONV ZLIB P7ZIP LLD LIBTRACYCLIENT BOLT MMTK_JULIA define SET_BB_DEFAULT # First, check to see if BB is disabled on a global setting ifeq ($$(USE_BINARYBUILDER),0) @@ -1426,6 +1426,13 @@ $(error "Attempting to build OpenBLAS or SuiteSparse without a functioning fortr endif endif +ifneq (${MMTK_PLAN},None) +# We still need some .h files from mmtk when +# building Julia using the BinaryBuilder +ifeq ($(USE_BINARYBUILDER_MMTK_JULIA),1) +MMTK_API_INC=$(JULIAHOME)/deps/mmtk/ +endif +endif # OS specific stuff diff --git a/deps/checksums/mmtk_julia b/deps/checksums/mmtk_julia index 49b7a50a8e136..c251802dd64fc 100644 --- a/deps/checksums/mmtk_julia +++ b/deps/checksums/mmtk_julia @@ -1,4 +1,9 @@ mmtk_julia-b69acf5af7a7dd97c1cc6fd99f7c2d51b477f214.tar.gz/md5/1911cf084d26c48e2ed58af3d268b4b6 mmtk_julia-b69acf5af7a7dd97c1cc6fd99f7c2d51b477f214.tar.gz/sha512/75beab54398989c46b62e714b242cf6705d88d220f40c21e494e0f29161437f5fbe9ba05b543d2353a1ad76f4239ac4025b476be0be864649f310f14935289fe +<<<<<<< HEAD mmtk_julia-f07d66aafc86af84ea988b35335acc9bbc770fa1.tar.gz/md5/38afb5db6d8c55413a4ec96aefa2ebb4 -mmtk_julia-f07d66aafc86af84ea988b35335acc9bbc770fa1.tar.gz/sha512/78525582a46a6baf8d33df7b622e55cf244439afcd7192ba55489c1bc18393d1237d2903d517c610484bf9e2a7338ad31435a9cbf70889d6bcf87c40cec829e5 \ No newline at end of file +mmtk_julia-f07d66aafc86af84ea988b35335acc9bbc770fa1.tar.gz/sha512/78525582a46a6baf8d33df7b622e55cf244439afcd7192ba55489c1bc18393d1237d2903d517c610484bf9e2a7338ad31435a9cbf70889d6bcf87c40cec829e5 +======= +mmtk_julia.v0.30.2+0.x86_64-linux-gnu.tar.gz/md5/0b8d667927b7ae181245dd1aba467dcb +mmtk_julia.v0.30.2+0.x86_64-linux-gnu.tar.gz/sha512/df45a7b148efcbf8fe24b51899bdc78f052cd96bcf43ff8e96f4ca02851589f4d634f879e2ae23e98917ba235a533a13cf0cb092bfa4fc2a48e260ae1efc007d +>>>>>>> f0d89df2ce (Adding support for building using BB version of mmtk-julia) diff --git a/deps/mmtk/mmtk.h b/deps/mmtk/mmtk.h new file mode 100644 index 0000000000000..c88204a769c41 --- /dev/null +++ b/deps/mmtk/mmtk.h @@ -0,0 +1,113 @@ +#ifndef MMTK_H +#define MMTK_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void* MMTk_Mutator; +typedef void* MMTk_TraceLocal; +typedef void (*ProcessSlotFn)(void* closure, void* slot); +typedef void (*ProcessOffsetSlotFn)(void* closure, void* slot, int offset); + +typedef struct { + void** ptr; + size_t cap; +} RootsWorkBuffer; + +typedef struct { + RootsWorkBuffer (*report_slots_func)(void** buf, size_t size, size_t cap, void* data, bool renew); + RootsWorkBuffer (*report_nodes_func)(void** buf, size_t size, size_t cap, void* data, bool renew); + RootsWorkBuffer (*report_tpinned_nodes_func)(void** buf, size_t size, size_t cap, void* data, bool renew); + void* data; +} RootsWorkClosure; + +/** + * Allocation + */ +extern MMTk_Mutator mmtk_bind_mutator(void *tls, int tid); +extern void mmtk_post_bind_mutator(MMTk_Mutator mutator, MMTk_Mutator original_mutator); +extern void mmtk_destroy_mutator(MMTk_Mutator mutator); + +extern void* mmtk_alloc(MMTk_Mutator mutator, size_t size, + size_t align, size_t offset, int allocator); + +extern void* mmtk_alloc_large(MMTk_Mutator mutator, size_t size, + size_t align, size_t offset, int allocator); + +extern void mmtk_post_alloc(MMTk_Mutator mutator, void* refer, + size_t bytes, int allocator); + +extern bool mmtk_is_live_object(void* ref); +extern bool mmtk_is_mapped_object(void* ref); +extern bool mmtk_is_mapped_address(void* addr); +extern int mmtk_object_is_managed_by_mmtk(void* addr); +extern void mmtk_runtime_panic(void); +extern void mmtk_unreachable(void); +extern unsigned char mmtk_pin_object(void* obj); +extern bool mmtk_is_pinned(void* obj); +extern const char* get_mmtk_version(void); + +extern void mmtk_set_vm_space(void* addr, size_t size); +extern void mmtk_immortal_region_post_alloc(void* addr, size_t size); + +// Write barriers +extern void mmtk_memory_region_copy(MMTk_Mutator mutator, void* src_obj, void* src_addr, void* dst_obj, void* dst_addr, size_t size); +extern void mmtk_object_reference_write_post(MMTk_Mutator mutator, const void* src, const void* target); +extern void mmtk_object_reference_write_slow(MMTk_Mutator mutator, const void* src, const void* target); +extern const void* MMTK_SIDE_LOG_BIT_BASE_ADDRESS; + +extern _Atomic(uintptr_t) JULIA_MALLOC_BYTES; + +/** + * Misc + */ +extern void mmtk_gc_init(uintptr_t min_heap_size, uintptr_t max_heap_size, uintptr_t n_gcthreads, uintptr_t header_size, uintptr_t tag); +extern bool mmtk_will_never_move(void* object); +extern bool mmtk_process(char* name, char* value); +extern void mmtk_scan_region(void); +extern void mmtk_handle_user_collection_request(void *tls, uint8_t collection); +extern void mmtk_initialize_collection(void* tls); +extern void mmtk_start_control_collector(void *tls); +extern void mmtk_start_worker(void *tls, void* worker, void* mmtk); +extern void mmtk_process_julia_obj(void* addr); +extern void mmtk_register_finalizer(void* obj, void* function, bool is_ptr); +extern void mmtk_run_finalizers_for_obj(void* obj); +extern void mmtk_run_finalizers(bool at_exit); +extern void mmtk_gc_poll(void *tls); +extern void mmtk_julia_copy_stack_check(int copy_stack); +extern void* mmtk_get_possibly_forwarded(void* object); +extern void mmtk_block_thread_for_gc(void); +extern void* mmtk_new_mutator_iterator(void); +extern void* mmtk_get_next_mutator_tls(void*); +extern void* mmtk_close_mutator_iterator(void*); + + +/** + * VM Accounting + */ +extern size_t mmtk_free_bytes(void); +extern size_t mmtk_total_bytes(void); +extern size_t mmtk_used_bytes(void); +extern void* mmtk_starting_heap_address(void); +extern void* mmtk_last_heap_address(void); + +/** + * Reference Processing + */ +extern void mmtk_add_weak_candidate(void* ref); +extern void mmtk_add_soft_candidate(void* ref); +extern void mmtk_add_phantom_candidate(void* ref); + +extern void mmtk_harness_begin(void *tls); +extern void mmtk_harness_end(void); + +#ifdef __cplusplus +} +#endif + +#endif // MMTK_H diff --git a/deps/mmtk/mmtkMutator.h b/deps/mmtk/mmtkMutator.h new file mode 100644 index 0000000000000..2f513406353f2 --- /dev/null +++ b/deps/mmtk/mmtkMutator.h @@ -0,0 +1,114 @@ +#ifndef MMTK_JULIA_MMTK_MUTATOR_H +#define MMTK_JULIA_MMTK_MUTATOR_H + +// mmtk_julia_types.h refers to the types in this file. +// So if this file is updated, make sure you regenerate Rust types for mmtk_julia_types.h. + +enum Allocator { + AllocatorDefault = 0, + AllocatorImmortal = 1, + AllocatorLos = 2, + AllocatorCode = 3, + AllocatorReadOnly = 4, +}; + +typedef struct { + void* data; + void* vtable; +} RustDynPtr; + +// These constants should match the constants defind in mmtk::util::alloc::allocators +#define MAX_BUMP_ALLOCATORS 6 +#define MAX_LARGE_OBJECT_ALLOCATORS 2 +#define MAX_MALLOC_ALLOCATORS 1 +#define MAX_IMMIX_ALLOCATORS 1 +#define MAX_FREE_LIST_ALLOCATORS 2 +#define MAX_MARK_COMPACT_ALLOCATORS 1 + +// The following types should have the same layout as the types with the same name in MMTk core (Rust) + +typedef struct { + void* tls; + void* cursor; + void* limit; + RustDynPtr space; + void* context; +} BumpAllocator; + +typedef struct { + void* tls; + void* space; + void* context; +} LargeObjectAllocator; + +typedef struct { + void* tls; + void* cursor; + void* limit; + void* immix_space; + void* context; + uint8_t hot; + uint8_t copy; + void* large_cursor; + void* large_limit; + uint8_t request_for_large; + uint8_t _align[7]; + uint8_t line_opt_tag; + uintptr_t line_opt; +} ImmixAllocator; + +typedef struct { + void* Address; +} FLBlock; + +typedef struct { + FLBlock first; + FLBlock last; + size_t size; + char lock; +} FLBlockList; + +typedef struct { + void* tls; + void* space; + void* context; + FLBlockList* available_blocks; + FLBlockList* available_blocks_stress; + FLBlockList* unswept_blocks; + FLBlockList* consumed_blocks; +} FreeListAllocator; + +typedef struct { + void* tls; + void* space; + void* context; +} MMTkMallocAllocator; // Prefix with MMTk to avoid name clash + +typedef struct { + BumpAllocator bump_allocator; +} MarkCompactAllocator; + +typedef struct { + BumpAllocator bump_pointer[MAX_BUMP_ALLOCATORS]; + LargeObjectAllocator large_object[MAX_LARGE_OBJECT_ALLOCATORS]; + MMTkMallocAllocator malloc[MAX_MALLOC_ALLOCATORS]; + ImmixAllocator immix[MAX_IMMIX_ALLOCATORS]; + FreeListAllocator free_list[MAX_FREE_LIST_ALLOCATORS]; + MarkCompactAllocator markcompact[MAX_MARK_COMPACT_ALLOCATORS]; +} Allocators; + +typedef struct { + void* allocator_mapping; + void* space_mapping; + RustDynPtr prepare_func; + RustDynPtr release_func; +} MutatorConfig; + +typedef struct { + Allocators allocators; + RustDynPtr barrier; + void* mutator_tls; + RustDynPtr plan; + MutatorConfig config; +} MMTkMutatorContext; +#endif // MMTK_MUTATOR_HPP diff --git a/deps/mmtk_julia.mk b/deps/mmtk_julia.mk index 7ec55426821c3..424113fd4164c 100644 --- a/deps/mmtk_julia.mk +++ b/deps/mmtk_julia.mk @@ -6,6 +6,7 @@ MMTK_MOVING := 0 MMTK_VARS := MMTK_PLAN=$(MMTK_PLAN) MMTK_MOVING=$(MMTK_MOVING) +ifneq ($(USE_BINARYBUILDER_MMTK_JULIA),1) $(eval $(call git-external,mmtk_julia,MMTK_JULIA,,,$(BUILDDIR))) get-mmtk_julia: $(MMTK_JULIA_SRC_FILE) @@ -70,3 +71,10 @@ $(build_prefix)/manifest/mmtk_julia: $(BUILDROOT)/usr/lib/libmmtk_julia.so @echo $(UNINSTALL_mmtk_julia) > $@ endif # MMTK_JULIA_DIR + +else +# We are building using the BinaryBuilder version of the binding + +$(eval $(call bb-install,mmtk_julia,MMTK_JULIA,false)) + +endif # USE_BINARYBUILDER_MMTK_JULIA From 3279ae5ff5b50d352de1b36c277025e41a9ad8fc Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Fri, 17 Jan 2025 00:47:25 +0000 Subject: [PATCH 2/6] Updating BB version and adding .h files to BB artifact --- Make.inc | 7 --- deps/checksums/mmtk_julia | 7 +-- deps/mmtk/mmtk.h | 113 ------------------------------------- deps/mmtk/mmtkMutator.h | 114 -------------------------------------- deps/mmtk_julia.version | 2 + 5 files changed, 3 insertions(+), 240 deletions(-) delete mode 100644 deps/mmtk/mmtk.h delete mode 100644 deps/mmtk/mmtkMutator.h diff --git a/Make.inc b/Make.inc index 7af7c59fdf7c8..16e238c6f0683 100644 --- a/Make.inc +++ b/Make.inc @@ -1426,13 +1426,6 @@ $(error "Attempting to build OpenBLAS or SuiteSparse without a functioning fortr endif endif -ifneq (${MMTK_PLAN},None) -# We still need some .h files from mmtk when -# building Julia using the BinaryBuilder -ifeq ($(USE_BINARYBUILDER_MMTK_JULIA),1) -MMTK_API_INC=$(JULIAHOME)/deps/mmtk/ -endif -endif # OS specific stuff diff --git a/deps/checksums/mmtk_julia b/deps/checksums/mmtk_julia index c251802dd64fc..49b7a50a8e136 100644 --- a/deps/checksums/mmtk_julia +++ b/deps/checksums/mmtk_julia @@ -1,9 +1,4 @@ mmtk_julia-b69acf5af7a7dd97c1cc6fd99f7c2d51b477f214.tar.gz/md5/1911cf084d26c48e2ed58af3d268b4b6 mmtk_julia-b69acf5af7a7dd97c1cc6fd99f7c2d51b477f214.tar.gz/sha512/75beab54398989c46b62e714b242cf6705d88d220f40c21e494e0f29161437f5fbe9ba05b543d2353a1ad76f4239ac4025b476be0be864649f310f14935289fe -<<<<<<< HEAD mmtk_julia-f07d66aafc86af84ea988b35335acc9bbc770fa1.tar.gz/md5/38afb5db6d8c55413a4ec96aefa2ebb4 -mmtk_julia-f07d66aafc86af84ea988b35335acc9bbc770fa1.tar.gz/sha512/78525582a46a6baf8d33df7b622e55cf244439afcd7192ba55489c1bc18393d1237d2903d517c610484bf9e2a7338ad31435a9cbf70889d6bcf87c40cec829e5 -======= -mmtk_julia.v0.30.2+0.x86_64-linux-gnu.tar.gz/md5/0b8d667927b7ae181245dd1aba467dcb -mmtk_julia.v0.30.2+0.x86_64-linux-gnu.tar.gz/sha512/df45a7b148efcbf8fe24b51899bdc78f052cd96bcf43ff8e96f4ca02851589f4d634f879e2ae23e98917ba235a533a13cf0cb092bfa4fc2a48e260ae1efc007d ->>>>>>> f0d89df2ce (Adding support for building using BB version of mmtk-julia) +mmtk_julia-f07d66aafc86af84ea988b35335acc9bbc770fa1.tar.gz/sha512/78525582a46a6baf8d33df7b622e55cf244439afcd7192ba55489c1bc18393d1237d2903d517c610484bf9e2a7338ad31435a9cbf70889d6bcf87c40cec829e5 \ No newline at end of file diff --git a/deps/mmtk/mmtk.h b/deps/mmtk/mmtk.h deleted file mode 100644 index c88204a769c41..0000000000000 --- a/deps/mmtk/mmtk.h +++ /dev/null @@ -1,113 +0,0 @@ -#ifndef MMTK_H -#define MMTK_H - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void* MMTk_Mutator; -typedef void* MMTk_TraceLocal; -typedef void (*ProcessSlotFn)(void* closure, void* slot); -typedef void (*ProcessOffsetSlotFn)(void* closure, void* slot, int offset); - -typedef struct { - void** ptr; - size_t cap; -} RootsWorkBuffer; - -typedef struct { - RootsWorkBuffer (*report_slots_func)(void** buf, size_t size, size_t cap, void* data, bool renew); - RootsWorkBuffer (*report_nodes_func)(void** buf, size_t size, size_t cap, void* data, bool renew); - RootsWorkBuffer (*report_tpinned_nodes_func)(void** buf, size_t size, size_t cap, void* data, bool renew); - void* data; -} RootsWorkClosure; - -/** - * Allocation - */ -extern MMTk_Mutator mmtk_bind_mutator(void *tls, int tid); -extern void mmtk_post_bind_mutator(MMTk_Mutator mutator, MMTk_Mutator original_mutator); -extern void mmtk_destroy_mutator(MMTk_Mutator mutator); - -extern void* mmtk_alloc(MMTk_Mutator mutator, size_t size, - size_t align, size_t offset, int allocator); - -extern void* mmtk_alloc_large(MMTk_Mutator mutator, size_t size, - size_t align, size_t offset, int allocator); - -extern void mmtk_post_alloc(MMTk_Mutator mutator, void* refer, - size_t bytes, int allocator); - -extern bool mmtk_is_live_object(void* ref); -extern bool mmtk_is_mapped_object(void* ref); -extern bool mmtk_is_mapped_address(void* addr); -extern int mmtk_object_is_managed_by_mmtk(void* addr); -extern void mmtk_runtime_panic(void); -extern void mmtk_unreachable(void); -extern unsigned char mmtk_pin_object(void* obj); -extern bool mmtk_is_pinned(void* obj); -extern const char* get_mmtk_version(void); - -extern void mmtk_set_vm_space(void* addr, size_t size); -extern void mmtk_immortal_region_post_alloc(void* addr, size_t size); - -// Write barriers -extern void mmtk_memory_region_copy(MMTk_Mutator mutator, void* src_obj, void* src_addr, void* dst_obj, void* dst_addr, size_t size); -extern void mmtk_object_reference_write_post(MMTk_Mutator mutator, const void* src, const void* target); -extern void mmtk_object_reference_write_slow(MMTk_Mutator mutator, const void* src, const void* target); -extern const void* MMTK_SIDE_LOG_BIT_BASE_ADDRESS; - -extern _Atomic(uintptr_t) JULIA_MALLOC_BYTES; - -/** - * Misc - */ -extern void mmtk_gc_init(uintptr_t min_heap_size, uintptr_t max_heap_size, uintptr_t n_gcthreads, uintptr_t header_size, uintptr_t tag); -extern bool mmtk_will_never_move(void* object); -extern bool mmtk_process(char* name, char* value); -extern void mmtk_scan_region(void); -extern void mmtk_handle_user_collection_request(void *tls, uint8_t collection); -extern void mmtk_initialize_collection(void* tls); -extern void mmtk_start_control_collector(void *tls); -extern void mmtk_start_worker(void *tls, void* worker, void* mmtk); -extern void mmtk_process_julia_obj(void* addr); -extern void mmtk_register_finalizer(void* obj, void* function, bool is_ptr); -extern void mmtk_run_finalizers_for_obj(void* obj); -extern void mmtk_run_finalizers(bool at_exit); -extern void mmtk_gc_poll(void *tls); -extern void mmtk_julia_copy_stack_check(int copy_stack); -extern void* mmtk_get_possibly_forwarded(void* object); -extern void mmtk_block_thread_for_gc(void); -extern void* mmtk_new_mutator_iterator(void); -extern void* mmtk_get_next_mutator_tls(void*); -extern void* mmtk_close_mutator_iterator(void*); - - -/** - * VM Accounting - */ -extern size_t mmtk_free_bytes(void); -extern size_t mmtk_total_bytes(void); -extern size_t mmtk_used_bytes(void); -extern void* mmtk_starting_heap_address(void); -extern void* mmtk_last_heap_address(void); - -/** - * Reference Processing - */ -extern void mmtk_add_weak_candidate(void* ref); -extern void mmtk_add_soft_candidate(void* ref); -extern void mmtk_add_phantom_candidate(void* ref); - -extern void mmtk_harness_begin(void *tls); -extern void mmtk_harness_end(void); - -#ifdef __cplusplus -} -#endif - -#endif // MMTK_H diff --git a/deps/mmtk/mmtkMutator.h b/deps/mmtk/mmtkMutator.h deleted file mode 100644 index 2f513406353f2..0000000000000 --- a/deps/mmtk/mmtkMutator.h +++ /dev/null @@ -1,114 +0,0 @@ -#ifndef MMTK_JULIA_MMTK_MUTATOR_H -#define MMTK_JULIA_MMTK_MUTATOR_H - -// mmtk_julia_types.h refers to the types in this file. -// So if this file is updated, make sure you regenerate Rust types for mmtk_julia_types.h. - -enum Allocator { - AllocatorDefault = 0, - AllocatorImmortal = 1, - AllocatorLos = 2, - AllocatorCode = 3, - AllocatorReadOnly = 4, -}; - -typedef struct { - void* data; - void* vtable; -} RustDynPtr; - -// These constants should match the constants defind in mmtk::util::alloc::allocators -#define MAX_BUMP_ALLOCATORS 6 -#define MAX_LARGE_OBJECT_ALLOCATORS 2 -#define MAX_MALLOC_ALLOCATORS 1 -#define MAX_IMMIX_ALLOCATORS 1 -#define MAX_FREE_LIST_ALLOCATORS 2 -#define MAX_MARK_COMPACT_ALLOCATORS 1 - -// The following types should have the same layout as the types with the same name in MMTk core (Rust) - -typedef struct { - void* tls; - void* cursor; - void* limit; - RustDynPtr space; - void* context; -} BumpAllocator; - -typedef struct { - void* tls; - void* space; - void* context; -} LargeObjectAllocator; - -typedef struct { - void* tls; - void* cursor; - void* limit; - void* immix_space; - void* context; - uint8_t hot; - uint8_t copy; - void* large_cursor; - void* large_limit; - uint8_t request_for_large; - uint8_t _align[7]; - uint8_t line_opt_tag; - uintptr_t line_opt; -} ImmixAllocator; - -typedef struct { - void* Address; -} FLBlock; - -typedef struct { - FLBlock first; - FLBlock last; - size_t size; - char lock; -} FLBlockList; - -typedef struct { - void* tls; - void* space; - void* context; - FLBlockList* available_blocks; - FLBlockList* available_blocks_stress; - FLBlockList* unswept_blocks; - FLBlockList* consumed_blocks; -} FreeListAllocator; - -typedef struct { - void* tls; - void* space; - void* context; -} MMTkMallocAllocator; // Prefix with MMTk to avoid name clash - -typedef struct { - BumpAllocator bump_allocator; -} MarkCompactAllocator; - -typedef struct { - BumpAllocator bump_pointer[MAX_BUMP_ALLOCATORS]; - LargeObjectAllocator large_object[MAX_LARGE_OBJECT_ALLOCATORS]; - MMTkMallocAllocator malloc[MAX_MALLOC_ALLOCATORS]; - ImmixAllocator immix[MAX_IMMIX_ALLOCATORS]; - FreeListAllocator free_list[MAX_FREE_LIST_ALLOCATORS]; - MarkCompactAllocator markcompact[MAX_MARK_COMPACT_ALLOCATORS]; -} Allocators; - -typedef struct { - void* allocator_mapping; - void* space_mapping; - RustDynPtr prepare_func; - RustDynPtr release_func; -} MutatorConfig; - -typedef struct { - Allocators allocators; - RustDynPtr barrier; - void* mutator_tls; - RustDynPtr plan; - MutatorConfig config; -} MMTkMutatorContext; -#endif // MMTK_MUTATOR_HPP diff --git a/deps/mmtk_julia.version b/deps/mmtk_julia.version index 4d821bffd5b9b..5250613214d05 100644 --- a/deps/mmtk_julia.version +++ b/deps/mmtk_julia.version @@ -2,3 +2,5 @@ MMTK_JULIA_BRANCH = master MMTK_JULIA_SHA1 = f07d66aafc86af84ea988b35335acc9bbc770fa1 MMTK_JULIA_GIT_URL := https://github.com/mmtk/mmtk-julia.git MMTK_JULIA_TAR_URL = https://github.com/mmtk/mmtk-julia/archive/refs/tags/v0.30.3.tar.gz +MMTK_JULIA_JLL_VER := 0.30.3+0 +MMTK_JULIA_JLL_NAME := mmtk_julia From a6defc1f3d6daca45838809c93996afc1d6bfddb Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Fri, 17 Jan 2025 19:30:23 +0000 Subject: [PATCH 3/6] Updating BB version --- deps/checksums/mmtk_julia | 4 +++- deps/mmtk_julia.version | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/deps/checksums/mmtk_julia b/deps/checksums/mmtk_julia index 49b7a50a8e136..979ab79e52207 100644 --- a/deps/checksums/mmtk_julia +++ b/deps/checksums/mmtk_julia @@ -1,4 +1,6 @@ mmtk_julia-b69acf5af7a7dd97c1cc6fd99f7c2d51b477f214.tar.gz/md5/1911cf084d26c48e2ed58af3d268b4b6 mmtk_julia-b69acf5af7a7dd97c1cc6fd99f7c2d51b477f214.tar.gz/sha512/75beab54398989c46b62e714b242cf6705d88d220f40c21e494e0f29161437f5fbe9ba05b543d2353a1ad76f4239ac4025b476be0be864649f310f14935289fe mmtk_julia-f07d66aafc86af84ea988b35335acc9bbc770fa1.tar.gz/md5/38afb5db6d8c55413a4ec96aefa2ebb4 -mmtk_julia-f07d66aafc86af84ea988b35335acc9bbc770fa1.tar.gz/sha512/78525582a46a6baf8d33df7b622e55cf244439afcd7192ba55489c1bc18393d1237d2903d517c610484bf9e2a7338ad31435a9cbf70889d6bcf87c40cec829e5 \ No newline at end of file +mmtk_julia-f07d66aafc86af84ea988b35335acc9bbc770fa1.tar.gz/sha512/78525582a46a6baf8d33df7b622e55cf244439afcd7192ba55489c1bc18393d1237d2903d517c610484bf9e2a7338ad31435a9cbf70889d6bcf87c40cec829e5 +mmtk_julia.v0.30.3+1.x86_64-linux-gnu.tar.gz/md5/631b204574da7062802dac501a4b711f +mmtk_julia.v0.30.3+1.x86_64-linux-gnu.tar.gz/sha512/daaed59d08fc49621479ed638dea0aac0cba123986e486571447e8e21e9a098776ce2e87fbd92ddea276782fc44621f23d40fa213296b28e1d4480553c7de4f7 diff --git a/deps/mmtk_julia.version b/deps/mmtk_julia.version index 5250613214d05..cb1e8064f9825 100644 --- a/deps/mmtk_julia.version +++ b/deps/mmtk_julia.version @@ -2,5 +2,5 @@ MMTK_JULIA_BRANCH = master MMTK_JULIA_SHA1 = f07d66aafc86af84ea988b35335acc9bbc770fa1 MMTK_JULIA_GIT_URL := https://github.com/mmtk/mmtk-julia.git MMTK_JULIA_TAR_URL = https://github.com/mmtk/mmtk-julia/archive/refs/tags/v0.30.3.tar.gz -MMTK_JULIA_JLL_VER := 0.30.3+0 +MMTK_JULIA_JLL_VER := 0.30.3+1 MMTK_JULIA_JLL_NAME := mmtk_julia From 4313103ed432ae1ba7067bb85971fe4f1fc5e76c Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 8 Jan 2025 10:26:57 +0000 Subject: [PATCH 4/6] Adding support for building using BB version of mmtk-julia --- Make.inc | 7 +++ deps/mmtk/mmtk.h | 113 +++++++++++++++++++++++++++++++++++++++ deps/mmtk/mmtkMutator.h | 114 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 234 insertions(+) create mode 100644 deps/mmtk/mmtk.h create mode 100644 deps/mmtk/mmtkMutator.h diff --git a/Make.inc b/Make.inc index 16e238c6f0683..7af7c59fdf7c8 100644 --- a/Make.inc +++ b/Make.inc @@ -1426,6 +1426,13 @@ $(error "Attempting to build OpenBLAS or SuiteSparse without a functioning fortr endif endif +ifneq (${MMTK_PLAN},None) +# We still need some .h files from mmtk when +# building Julia using the BinaryBuilder +ifeq ($(USE_BINARYBUILDER_MMTK_JULIA),1) +MMTK_API_INC=$(JULIAHOME)/deps/mmtk/ +endif +endif # OS specific stuff diff --git a/deps/mmtk/mmtk.h b/deps/mmtk/mmtk.h new file mode 100644 index 0000000000000..c88204a769c41 --- /dev/null +++ b/deps/mmtk/mmtk.h @@ -0,0 +1,113 @@ +#ifndef MMTK_H +#define MMTK_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void* MMTk_Mutator; +typedef void* MMTk_TraceLocal; +typedef void (*ProcessSlotFn)(void* closure, void* slot); +typedef void (*ProcessOffsetSlotFn)(void* closure, void* slot, int offset); + +typedef struct { + void** ptr; + size_t cap; +} RootsWorkBuffer; + +typedef struct { + RootsWorkBuffer (*report_slots_func)(void** buf, size_t size, size_t cap, void* data, bool renew); + RootsWorkBuffer (*report_nodes_func)(void** buf, size_t size, size_t cap, void* data, bool renew); + RootsWorkBuffer (*report_tpinned_nodes_func)(void** buf, size_t size, size_t cap, void* data, bool renew); + void* data; +} RootsWorkClosure; + +/** + * Allocation + */ +extern MMTk_Mutator mmtk_bind_mutator(void *tls, int tid); +extern void mmtk_post_bind_mutator(MMTk_Mutator mutator, MMTk_Mutator original_mutator); +extern void mmtk_destroy_mutator(MMTk_Mutator mutator); + +extern void* mmtk_alloc(MMTk_Mutator mutator, size_t size, + size_t align, size_t offset, int allocator); + +extern void* mmtk_alloc_large(MMTk_Mutator mutator, size_t size, + size_t align, size_t offset, int allocator); + +extern void mmtk_post_alloc(MMTk_Mutator mutator, void* refer, + size_t bytes, int allocator); + +extern bool mmtk_is_live_object(void* ref); +extern bool mmtk_is_mapped_object(void* ref); +extern bool mmtk_is_mapped_address(void* addr); +extern int mmtk_object_is_managed_by_mmtk(void* addr); +extern void mmtk_runtime_panic(void); +extern void mmtk_unreachable(void); +extern unsigned char mmtk_pin_object(void* obj); +extern bool mmtk_is_pinned(void* obj); +extern const char* get_mmtk_version(void); + +extern void mmtk_set_vm_space(void* addr, size_t size); +extern void mmtk_immortal_region_post_alloc(void* addr, size_t size); + +// Write barriers +extern void mmtk_memory_region_copy(MMTk_Mutator mutator, void* src_obj, void* src_addr, void* dst_obj, void* dst_addr, size_t size); +extern void mmtk_object_reference_write_post(MMTk_Mutator mutator, const void* src, const void* target); +extern void mmtk_object_reference_write_slow(MMTk_Mutator mutator, const void* src, const void* target); +extern const void* MMTK_SIDE_LOG_BIT_BASE_ADDRESS; + +extern _Atomic(uintptr_t) JULIA_MALLOC_BYTES; + +/** + * Misc + */ +extern void mmtk_gc_init(uintptr_t min_heap_size, uintptr_t max_heap_size, uintptr_t n_gcthreads, uintptr_t header_size, uintptr_t tag); +extern bool mmtk_will_never_move(void* object); +extern bool mmtk_process(char* name, char* value); +extern void mmtk_scan_region(void); +extern void mmtk_handle_user_collection_request(void *tls, uint8_t collection); +extern void mmtk_initialize_collection(void* tls); +extern void mmtk_start_control_collector(void *tls); +extern void mmtk_start_worker(void *tls, void* worker, void* mmtk); +extern void mmtk_process_julia_obj(void* addr); +extern void mmtk_register_finalizer(void* obj, void* function, bool is_ptr); +extern void mmtk_run_finalizers_for_obj(void* obj); +extern void mmtk_run_finalizers(bool at_exit); +extern void mmtk_gc_poll(void *tls); +extern void mmtk_julia_copy_stack_check(int copy_stack); +extern void* mmtk_get_possibly_forwarded(void* object); +extern void mmtk_block_thread_for_gc(void); +extern void* mmtk_new_mutator_iterator(void); +extern void* mmtk_get_next_mutator_tls(void*); +extern void* mmtk_close_mutator_iterator(void*); + + +/** + * VM Accounting + */ +extern size_t mmtk_free_bytes(void); +extern size_t mmtk_total_bytes(void); +extern size_t mmtk_used_bytes(void); +extern void* mmtk_starting_heap_address(void); +extern void* mmtk_last_heap_address(void); + +/** + * Reference Processing + */ +extern void mmtk_add_weak_candidate(void* ref); +extern void mmtk_add_soft_candidate(void* ref); +extern void mmtk_add_phantom_candidate(void* ref); + +extern void mmtk_harness_begin(void *tls); +extern void mmtk_harness_end(void); + +#ifdef __cplusplus +} +#endif + +#endif // MMTK_H diff --git a/deps/mmtk/mmtkMutator.h b/deps/mmtk/mmtkMutator.h new file mode 100644 index 0000000000000..2f513406353f2 --- /dev/null +++ b/deps/mmtk/mmtkMutator.h @@ -0,0 +1,114 @@ +#ifndef MMTK_JULIA_MMTK_MUTATOR_H +#define MMTK_JULIA_MMTK_MUTATOR_H + +// mmtk_julia_types.h refers to the types in this file. +// So if this file is updated, make sure you regenerate Rust types for mmtk_julia_types.h. + +enum Allocator { + AllocatorDefault = 0, + AllocatorImmortal = 1, + AllocatorLos = 2, + AllocatorCode = 3, + AllocatorReadOnly = 4, +}; + +typedef struct { + void* data; + void* vtable; +} RustDynPtr; + +// These constants should match the constants defind in mmtk::util::alloc::allocators +#define MAX_BUMP_ALLOCATORS 6 +#define MAX_LARGE_OBJECT_ALLOCATORS 2 +#define MAX_MALLOC_ALLOCATORS 1 +#define MAX_IMMIX_ALLOCATORS 1 +#define MAX_FREE_LIST_ALLOCATORS 2 +#define MAX_MARK_COMPACT_ALLOCATORS 1 + +// The following types should have the same layout as the types with the same name in MMTk core (Rust) + +typedef struct { + void* tls; + void* cursor; + void* limit; + RustDynPtr space; + void* context; +} BumpAllocator; + +typedef struct { + void* tls; + void* space; + void* context; +} LargeObjectAllocator; + +typedef struct { + void* tls; + void* cursor; + void* limit; + void* immix_space; + void* context; + uint8_t hot; + uint8_t copy; + void* large_cursor; + void* large_limit; + uint8_t request_for_large; + uint8_t _align[7]; + uint8_t line_opt_tag; + uintptr_t line_opt; +} ImmixAllocator; + +typedef struct { + void* Address; +} FLBlock; + +typedef struct { + FLBlock first; + FLBlock last; + size_t size; + char lock; +} FLBlockList; + +typedef struct { + void* tls; + void* space; + void* context; + FLBlockList* available_blocks; + FLBlockList* available_blocks_stress; + FLBlockList* unswept_blocks; + FLBlockList* consumed_blocks; +} FreeListAllocator; + +typedef struct { + void* tls; + void* space; + void* context; +} MMTkMallocAllocator; // Prefix with MMTk to avoid name clash + +typedef struct { + BumpAllocator bump_allocator; +} MarkCompactAllocator; + +typedef struct { + BumpAllocator bump_pointer[MAX_BUMP_ALLOCATORS]; + LargeObjectAllocator large_object[MAX_LARGE_OBJECT_ALLOCATORS]; + MMTkMallocAllocator malloc[MAX_MALLOC_ALLOCATORS]; + ImmixAllocator immix[MAX_IMMIX_ALLOCATORS]; + FreeListAllocator free_list[MAX_FREE_LIST_ALLOCATORS]; + MarkCompactAllocator markcompact[MAX_MARK_COMPACT_ALLOCATORS]; +} Allocators; + +typedef struct { + void* allocator_mapping; + void* space_mapping; + RustDynPtr prepare_func; + RustDynPtr release_func; +} MutatorConfig; + +typedef struct { + Allocators allocators; + RustDynPtr barrier; + void* mutator_tls; + RustDynPtr plan; + MutatorConfig config; +} MMTkMutatorContext; +#endif // MMTK_MUTATOR_HPP From 7cb8a7bad1c991fd144f8c980fdfeaa8febd41cd Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Fri, 17 Jan 2025 19:56:06 +0000 Subject: [PATCH 5/6] Use Immix by default --- Make.inc | 9 +--- deps/mmtk/mmtk.h | 113 --------------------------------------- deps/mmtk/mmtkMutator.h | 114 ---------------------------------------- 3 files changed, 1 insertion(+), 235 deletions(-) delete mode 100644 deps/mmtk/mmtk.h delete mode 100644 deps/mmtk/mmtkMutator.h diff --git a/Make.inc b/Make.inc index 7af7c59fdf7c8..97a8a3f47a62a 100644 --- a/Make.inc +++ b/Make.inc @@ -81,7 +81,7 @@ WITH_GC_VERIFY := 0 WITH_GC_DEBUG_ENV := 0 # Use stock if MMTK_PLAN hasn't been defined -MMTK_PLAN ?= None +MMTK_PLAN ?= Immix # Enable DTrace support WITH_DTRACE := 0 @@ -1426,13 +1426,6 @@ $(error "Attempting to build OpenBLAS or SuiteSparse without a functioning fortr endif endif -ifneq (${MMTK_PLAN},None) -# We still need some .h files from mmtk when -# building Julia using the BinaryBuilder -ifeq ($(USE_BINARYBUILDER_MMTK_JULIA),1) -MMTK_API_INC=$(JULIAHOME)/deps/mmtk/ -endif -endif # OS specific stuff diff --git a/deps/mmtk/mmtk.h b/deps/mmtk/mmtk.h deleted file mode 100644 index c88204a769c41..0000000000000 --- a/deps/mmtk/mmtk.h +++ /dev/null @@ -1,113 +0,0 @@ -#ifndef MMTK_H -#define MMTK_H - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void* MMTk_Mutator; -typedef void* MMTk_TraceLocal; -typedef void (*ProcessSlotFn)(void* closure, void* slot); -typedef void (*ProcessOffsetSlotFn)(void* closure, void* slot, int offset); - -typedef struct { - void** ptr; - size_t cap; -} RootsWorkBuffer; - -typedef struct { - RootsWorkBuffer (*report_slots_func)(void** buf, size_t size, size_t cap, void* data, bool renew); - RootsWorkBuffer (*report_nodes_func)(void** buf, size_t size, size_t cap, void* data, bool renew); - RootsWorkBuffer (*report_tpinned_nodes_func)(void** buf, size_t size, size_t cap, void* data, bool renew); - void* data; -} RootsWorkClosure; - -/** - * Allocation - */ -extern MMTk_Mutator mmtk_bind_mutator(void *tls, int tid); -extern void mmtk_post_bind_mutator(MMTk_Mutator mutator, MMTk_Mutator original_mutator); -extern void mmtk_destroy_mutator(MMTk_Mutator mutator); - -extern void* mmtk_alloc(MMTk_Mutator mutator, size_t size, - size_t align, size_t offset, int allocator); - -extern void* mmtk_alloc_large(MMTk_Mutator mutator, size_t size, - size_t align, size_t offset, int allocator); - -extern void mmtk_post_alloc(MMTk_Mutator mutator, void* refer, - size_t bytes, int allocator); - -extern bool mmtk_is_live_object(void* ref); -extern bool mmtk_is_mapped_object(void* ref); -extern bool mmtk_is_mapped_address(void* addr); -extern int mmtk_object_is_managed_by_mmtk(void* addr); -extern void mmtk_runtime_panic(void); -extern void mmtk_unreachable(void); -extern unsigned char mmtk_pin_object(void* obj); -extern bool mmtk_is_pinned(void* obj); -extern const char* get_mmtk_version(void); - -extern void mmtk_set_vm_space(void* addr, size_t size); -extern void mmtk_immortal_region_post_alloc(void* addr, size_t size); - -// Write barriers -extern void mmtk_memory_region_copy(MMTk_Mutator mutator, void* src_obj, void* src_addr, void* dst_obj, void* dst_addr, size_t size); -extern void mmtk_object_reference_write_post(MMTk_Mutator mutator, const void* src, const void* target); -extern void mmtk_object_reference_write_slow(MMTk_Mutator mutator, const void* src, const void* target); -extern const void* MMTK_SIDE_LOG_BIT_BASE_ADDRESS; - -extern _Atomic(uintptr_t) JULIA_MALLOC_BYTES; - -/** - * Misc - */ -extern void mmtk_gc_init(uintptr_t min_heap_size, uintptr_t max_heap_size, uintptr_t n_gcthreads, uintptr_t header_size, uintptr_t tag); -extern bool mmtk_will_never_move(void* object); -extern bool mmtk_process(char* name, char* value); -extern void mmtk_scan_region(void); -extern void mmtk_handle_user_collection_request(void *tls, uint8_t collection); -extern void mmtk_initialize_collection(void* tls); -extern void mmtk_start_control_collector(void *tls); -extern void mmtk_start_worker(void *tls, void* worker, void* mmtk); -extern void mmtk_process_julia_obj(void* addr); -extern void mmtk_register_finalizer(void* obj, void* function, bool is_ptr); -extern void mmtk_run_finalizers_for_obj(void* obj); -extern void mmtk_run_finalizers(bool at_exit); -extern void mmtk_gc_poll(void *tls); -extern void mmtk_julia_copy_stack_check(int copy_stack); -extern void* mmtk_get_possibly_forwarded(void* object); -extern void mmtk_block_thread_for_gc(void); -extern void* mmtk_new_mutator_iterator(void); -extern void* mmtk_get_next_mutator_tls(void*); -extern void* mmtk_close_mutator_iterator(void*); - - -/** - * VM Accounting - */ -extern size_t mmtk_free_bytes(void); -extern size_t mmtk_total_bytes(void); -extern size_t mmtk_used_bytes(void); -extern void* mmtk_starting_heap_address(void); -extern void* mmtk_last_heap_address(void); - -/** - * Reference Processing - */ -extern void mmtk_add_weak_candidate(void* ref); -extern void mmtk_add_soft_candidate(void* ref); -extern void mmtk_add_phantom_candidate(void* ref); - -extern void mmtk_harness_begin(void *tls); -extern void mmtk_harness_end(void); - -#ifdef __cplusplus -} -#endif - -#endif // MMTK_H diff --git a/deps/mmtk/mmtkMutator.h b/deps/mmtk/mmtkMutator.h deleted file mode 100644 index 2f513406353f2..0000000000000 --- a/deps/mmtk/mmtkMutator.h +++ /dev/null @@ -1,114 +0,0 @@ -#ifndef MMTK_JULIA_MMTK_MUTATOR_H -#define MMTK_JULIA_MMTK_MUTATOR_H - -// mmtk_julia_types.h refers to the types in this file. -// So if this file is updated, make sure you regenerate Rust types for mmtk_julia_types.h. - -enum Allocator { - AllocatorDefault = 0, - AllocatorImmortal = 1, - AllocatorLos = 2, - AllocatorCode = 3, - AllocatorReadOnly = 4, -}; - -typedef struct { - void* data; - void* vtable; -} RustDynPtr; - -// These constants should match the constants defind in mmtk::util::alloc::allocators -#define MAX_BUMP_ALLOCATORS 6 -#define MAX_LARGE_OBJECT_ALLOCATORS 2 -#define MAX_MALLOC_ALLOCATORS 1 -#define MAX_IMMIX_ALLOCATORS 1 -#define MAX_FREE_LIST_ALLOCATORS 2 -#define MAX_MARK_COMPACT_ALLOCATORS 1 - -// The following types should have the same layout as the types with the same name in MMTk core (Rust) - -typedef struct { - void* tls; - void* cursor; - void* limit; - RustDynPtr space; - void* context; -} BumpAllocator; - -typedef struct { - void* tls; - void* space; - void* context; -} LargeObjectAllocator; - -typedef struct { - void* tls; - void* cursor; - void* limit; - void* immix_space; - void* context; - uint8_t hot; - uint8_t copy; - void* large_cursor; - void* large_limit; - uint8_t request_for_large; - uint8_t _align[7]; - uint8_t line_opt_tag; - uintptr_t line_opt; -} ImmixAllocator; - -typedef struct { - void* Address; -} FLBlock; - -typedef struct { - FLBlock first; - FLBlock last; - size_t size; - char lock; -} FLBlockList; - -typedef struct { - void* tls; - void* space; - void* context; - FLBlockList* available_blocks; - FLBlockList* available_blocks_stress; - FLBlockList* unswept_blocks; - FLBlockList* consumed_blocks; -} FreeListAllocator; - -typedef struct { - void* tls; - void* space; - void* context; -} MMTkMallocAllocator; // Prefix with MMTk to avoid name clash - -typedef struct { - BumpAllocator bump_allocator; -} MarkCompactAllocator; - -typedef struct { - BumpAllocator bump_pointer[MAX_BUMP_ALLOCATORS]; - LargeObjectAllocator large_object[MAX_LARGE_OBJECT_ALLOCATORS]; - MMTkMallocAllocator malloc[MAX_MALLOC_ALLOCATORS]; - ImmixAllocator immix[MAX_IMMIX_ALLOCATORS]; - FreeListAllocator free_list[MAX_FREE_LIST_ALLOCATORS]; - MarkCompactAllocator markcompact[MAX_MARK_COMPACT_ALLOCATORS]; -} Allocators; - -typedef struct { - void* allocator_mapping; - void* space_mapping; - RustDynPtr prepare_func; - RustDynPtr release_func; -} MutatorConfig; - -typedef struct { - Allocators allocators; - RustDynPtr barrier; - void* mutator_tls; - RustDynPtr plan; - MutatorConfig config; -} MMTkMutatorContext; -#endif // MMTK_MUTATOR_HPP From f571b4bf15276fa60d7c8526484d23a474818555 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Sat, 18 Jan 2025 02:58:16 +0000 Subject: [PATCH 6/6] Adding libmmtk_julia as JL_PRIVATE_LIBS-0 --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 20d131ee8524c..b193b3849c6aa 100644 --- a/Makefile +++ b/Makefile @@ -281,6 +281,10 @@ endif endif endif +ifneq (${MMTK_PLAN},None) +JL_PRIVATE_LIBS-0 += libmmtk_julia +endif + # Note that we disable MSYS2's path munging here, as otherwise # it replaces our `:`-separated list as a `;`-separated one. define stringreplace