wasm-ld: Align default for signature mismatches between static and dynamic link?
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
When statically linking, a function signature mismatch generates a warning but the link succeeds. When linking against a shared library, by default a mismatch is a hard error. This error can be disabled with `--no-shlib-sigcheck`. Should these behaviors be aligned? As I see it there are three reasonable options:
* Both hard error
* Both warn
* Keep current behavior: hard error when dynamic library signature check fails, warning when static linking with a signature mismatch.
An important use case here is configuring. `AC_CHECK_LIB` declares a function as `char some_symbol(void)` and then tries to link against it. It's desirable that this check should succeed if `some_symbol` is present in `libsomething.a` or `libsomething.so` regardless of signature. On the other hand, when _not_ configuring, I think the error is preferable.
I think that the circumstances are worse with shared libraries because with a static library the linker can make a thunk to fix up the signature mismatch whereas with a dynamic library there will be a hard load error at runtime.
Contributor guide
Research direction
Start at the wasm-ld implementation of static signature-mismatch diagnostics and shared-library signature checking; the issue does not name files or tests. Compare the current warning, hard-error, and --no-shlib-sigcheck paths, then determine which policy should apply to configuration checks and runtime safety. Done means the behavior is deliberately aligned or retained with regression coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- wasm
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100