Skip to content

Add wasmtime_linker_allow_unknown_exports to C API#173

Merged
frank-emrich merged 2 commits intowasmfx:mainfrom
frank-emrich:c_api_allow_unknown_exports
May 15, 2024
Merged

Add wasmtime_linker_allow_unknown_exports to C API#173
frank-emrich merged 2 commits intowasmfx:mainfrom
frank-emrich:c_api_allow_unknown_exports

Conversation

@frank-emrich
Copy link
Copy Markdown

The C API for using the wasmtime linker currently only gives access to the allow_shadowing setting of the linker, but not to the allow_unknown_exports setting. However, the latter setting needs to be enabled in order to allow exporting the global __stack_pointer. This is what's causing the issue described in wasmfx/waeio#2.

(Alternatively, we may add __stack_pointer to the list of blessed globals in the command function in crates/wasmtime/src/runtime/linker.rs, but the comments there suggest that new items shouldn't be added to that list. Therefore, just making this setting accessible in the C API seems less controversial.)

@dhil
Copy link
Copy Markdown
Member

dhil commented May 15, 2024

I guess the linker API doesn't readily allow to bless a certain name?

@frank-emrich
Copy link
Copy Markdown
Author

No, it's a hardcoded list in the command function in the file I mentioned earlier.

@frank-emrich frank-emrich merged commit b443adb into wasmfx:main May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants