Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamically detect libgcc-vs-libunwind #8028

Merged

Conversation

alexcrichton
Copy link
Member

When native unwinding information is enabled Wasmtime will use the __register_frame API on Unix platforms to inform the runtime of the unwinding information generated for wasm modules. This function, however, has a different interface in libgcc vs libunwind. This means that we need to detect which is being used and adapt our calls to it appropriately.

Previously this decision was static. FreeBSD and Linux glibc would assume libgcc and everything else was assumed to be libunwind. It's possible to use libgcc on other platforms, however, such as with musl. The goal of this PR is to make the detection here more robust.

Specifically this PR now probes for a symbol at runtime rather than relying on a compile-time decision. That way we can see what we got at runtime and make the decision then.

Closes #7997

When native unwinding information is enabled Wasmtime will use the
`__register_frame` API on Unix platforms to inform the runtime of the
unwinding information generated for wasm modules. This function,
however, has a different interface in libgcc vs libunwind. This means
that we need to detect which is being used and adapt our calls to it
appropriately.

Previously this decision was static. FreeBSD and Linux glibc would
assume libgcc and everything else was assumed to be libunwind. It's
possible to use libgcc on other platforms, however, such as with musl.
The goal of this PR is to make the detection here more robust.

Specifically this PR now probes for a symbol at runtime rather than
relying on a compile-time decision. That way we can see what we got at
runtime and make the decision then.

Closes bytecodealliance#7997
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.

libgcc_13: SIGABORT inside UnwindRegistration::drop, __deregister_frame.
2 participants