WIP : Glibc fixes to fix build errors and undefined symbol errors#793
Open
vidyalakshmir wants to merge 5 commits intomainfrom
Open
WIP : Glibc fixes to fix build errors and undefined symbol errors#793vidyalakshmir wants to merge 5 commits intomainfrom
vidyalakshmir wants to merge 5 commits intomainfrom
Conversation
…supported by wasm and caused build errors
…uilds which caused undefined symbol error for pow etc
Contributor
End-to-End Test ReportTest PreviewTest Report Deterministic TestsSummary
Test Results by Category
Fail TestsSummary
Test Results by Category
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rennergade
reviewed
Feb 21, 2026
| # which must be preserved. | ||
| # With SSE disabled, ensure -fpmath is not set to use sse either. | ||
| rtld-CFLAGS += -mno-sse -mno-mmx -mfpmath=387 | ||
| #rtld-CFLAGS += -mno-sse -mno-mmx -mfpmath=387 |
Contributor
There was a problem hiding this comment.
would prefer to remove rather than comment out? leave a comment that it was removed.
rennergade
approved these changes
Feb 21, 2026
Contributor
rennergade
left a comment
There was a problem hiding this comment.
Left a minor comment. Also the title of the PR would be better to be more descriptive.
Other than that looks good, approved.
Contributor
Author
|
Thanks. Will change the title. Would like to wait to merge this since I might have additional fixes. |
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.
This PR does additional glibc fixes:
It adds a placeholder for libdl.a which is required for apps like python
Adds unwind_def object file for libc.a
Updated s_frexpl.c with latest glibc code to fix the build error. Essentially control flow always matched #else of the preprocessing directive which was causing build error for the file.
Compiler flags -mno-sse, -mno-mmx and -mfpmath-387 were used to build files within elf/ for shared builds and this was compilation errors as these flags are not supported for wasm. Hence, removed these flags and all files within elf/ are successfully compiled and object files are created.
Undefined symbol error were observed for 'pow' and other functions while running tests with glibc shared build. WebAssembly does not support ELF-style symbol versioning (.symver).
When compiling glibc shared objects (.os), the Clang Wasm backend silently drops public symbols (like
pow) that are wrapped in these versioning macros. Furthermore, since Wasmtime does not use thestandard Linux
ld.sodynamic loader, glibc's internal PLT-bypassing and hidden visibility mechanisms are incompatible. This commit updatesinclude/libc-symbols.hto:SHAREDbuilds by redefiningsymbol_versionanddefault_symbol_versionto fallback to standard Cstrong_aliasandweak_aliasmacros.visibility("hidden")attribute block for shared builds (acting as a hard guarantee alongsideCFLAGS="-DNO_HIDDEN").These changes force the glibc shared build to emit standard, globally visible symbols, mirroring the behavior of static (.o) builds and allowing the Clang Wasm backend to correctly link the library.