From 8ec65117430954be7c5c1baf84a253c49c45771b Mon Sep 17 00:00:00 2001 From: Steve Date: Mon, 20 Sep 2021 15:04:51 +0100 Subject: [PATCH] Exports symbols to be shared with external GDB/JIT debugging interface tools. Windows O/S specific requirement. --- crates/runtime/src/helpers.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/crates/runtime/src/helpers.c b/crates/runtime/src/helpers.c index daf47dda11..5778280488 100644 --- a/crates/runtime/src/helpers.c +++ b/crates/runtime/src/helpers.c @@ -68,7 +68,14 @@ void wasmtime_longjmp(void *JmpBuf) { // Note the `weak` linkage here, though, which is intended to let other code // override this symbol if it's defined elsewhere, since this definition doesn't // matter. -#ifndef CFG_TARGET_OS_windows + + + + +#ifdef CFG_TARGET_OS_windows + // export required for external access. +__declspec(dllexport) +#else __attribute__((weak, noinline)) #endif void __jit_debug_register_code() { @@ -87,11 +94,16 @@ struct JITDescriptor { // Note the `weak` linkage here which is the same purpose as above. We want to // let other runtimes be able to override this since our own definition isn't // important. -#ifndef CFG_TARGET_OS_windows +#ifdef CFG_TARGET_OS_windows + // export required for external access. +__declspec(dllexport) +#else __attribute__((weak)) #endif struct JITDescriptor __jit_debug_descriptor = {1, 0, NULL, NULL}; + + struct JITDescriptor* wasmtime_jit_debug_descriptor() { return &__jit_debug_descriptor; }