Turn off shared library signature check when configuring - #27470
Open
hoodmane wants to merge 1 commit into
Open
Conversation
`AC_CHECK_LIB(somelib, func)` writes the following to conftest.c:
```C
char func ();
int main(void) {
return func ();
}
```
Then runs `emcc conftest.c -lsomelib` and checks whether it succeeds. With
static libraries the signature mismatch is just a warning but with shared
libraries it is a hard error. Before emcc 6.0.0, even if configure tried to make
a shared library it would make a fake dynamic library instead and we didn't see
this problem. But since then it makes a real dynamic library and then fails to
configure.
The fix is if we are configuring pass `-Wl,--no-shlib-sigcheck` to disable the
signature check.
hoodmane
added a commit
to pyodide/pyodide
that referenced
this pull request
Jul 31, 2026
emscripten-core/emscripten#27470 AC_CHECK_LIB(somelib, func)` writes the following to conftest.c: ```C char func (); int main(void) { return func (); } ``` Then runs `emcc conftest.c -lsomelib` and checks whether it succeeds. With static libraries the signature mismatch is just a warning but with shared libraries it is a hard error. Before emcc 6.0.0, even if configure tried to make a shared library it would make a fake dynamic library instead and we didn't see this problem. But since then it makes a real dynamic library and then fails to configure. The fix is if we are configuring pass `-Wl,--no-shlib-sigcheck` to disable the signature check.
sbc100
reviewed
Aug 1, 2026
| # comes from an object file or an archive lld only warns about the | ||
| # resulting signature mismatch and synthesizes a thunk, but when it comes | ||
| # from a shared library the mismatch is a hard error. This turns off the | ||
| # shared library check. |
Collaborator
There was a problem hiding this comment.
I think the comment comment above on line 889 is already describing the issue.
Maybe we can just say "For the same reason, we need to disable signature check for shared library symbols."?
Its kind of strange to me that static signature checks would be a warning but not shared signature checks would be an error? I believe the reason static signature checks are only a warning by default is precisely to allow for autoconf/cmake games like this. If that is true then the same logic should apply for shared libraries.
Perhaps if we are going to land this we should add a TOTO with a link to and llvm bug to consider changing the default?
sbc100
reviewed
Aug 1, 2026
sbc100
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for working on this!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AC_CHECK_LIB(somelib, func)writes the following to conftest.c:Then runs
emcc conftest.c -lsomeliband checks whether it succeeds. With static libraries the signature mismatch is just a warning but with shared libraries it is a hard error. Before emcc 6.0.0, even if configure tried to make a shared library it would make a fake dynamic library instead and we didn't see this problem. But since then it makes a real dynamic library and then fails to configure.The fix is if we are configuring pass
-Wl,--no-shlib-sigcheckto disable the signature check.