diff --git a/crates/runtime/src/helpers.c b/crates/runtime/src/helpers.c index daf47dda11..66b87a150b 100644 --- a/crates/runtime/src/helpers.c +++ b/crates/runtime/src/helpers.c @@ -61,14 +61,16 @@ void wasmtime_longjmp(void *JmpBuf) { platform_longjmp(*buf, 1); } -// Just in case cross-language LTO is enabled we set the `noinline` attribute -// and also try to have some sort of side effect in this function with a dummy -// `asm` statement. -// -// 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 + // 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. + // Just in case cross-language LTO is enabled we set the `noinline` attribute + // and also try to have some sort of side effect in this function with a dummy + // `asm` statement. __attribute__((weak, noinline)) #endif void __jit_debug_register_code() { @@ -84,14 +86,19 @@ struct JITDescriptor { void* first_entry_; }; -// 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 -__attribute__((weak)) +#ifdef CFG_TARGET_OS_windows + // export required for external access. + __declspec(dllexport) +#else + // 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. + __attribute__((weak)) #endif struct JITDescriptor __jit_debug_descriptor = {1, 0, NULL, NULL}; + + struct JITDescriptor* wasmtime_jit_debug_descriptor() { return &__jit_debug_descriptor; }