Connect helper C symbols to their static library

This commit adds a `#[link]` annotation to the block defining symbols
coming from a native static library that we build and link. This is
required by rustc to get symbols to get exported correctly when linking
wasmtime into a Rust dynamic library instead of always as an rlib.

While I was at it I went ahead and renamed the symbols now that they're
no longer in C++ and they're doing setjmp/longjmp and not much else.

Closes #3006
This commit is contained in:
Alex Crichton
2021-06-21 07:25:58 -07:00
parent 7ce46043dc
commit 724beaf0f3
6 changed files with 15 additions and 14 deletions

View File

@@ -14,7 +14,7 @@
#define platform_jmp_buf sigjmp_buf
#endif
int RegisterSetjmp(
int wasmtime_setjmp(
void **buf_storage,
void (*body)(void*, void*),
void *payload,
@@ -28,7 +28,7 @@ int RegisterSetjmp(
return 1;
}
void Unwind(void *JmpBuf) {
void wasmtime_longjmp(void *JmpBuf) {
platform_jmp_buf *buf = (platform_jmp_buf*) JmpBuf;
platform_longjmp(*buf, 1);
}