-
Notifications
You must be signed in to change notification settings - Fork 30
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
Enable wasm-ld's --gc-sections
option for code size and import requirements
#5128
Comments
The recent wasi-libc introduced |
The recent wasi-libc includes some new syscalls not implemented in @wasmer-js/wasi and we currently disable `--gc-sections` (see swiftwasm/swift#5128), so binaries built with SwiftWasm 5.9 toolchain contains references to those unimplemented syscalls. This commit allows running such binaries by inserting dummy functions for unimplemented syscalls.
The recent wasi-libc includes some new syscalls not implemented in @wasmer-js/wasi and we currently disable `--gc-sections` (see swiftwasm/swift#5128), so binaries built with SwiftWasm 5.9 toolchain contains references to those unimplemented syscalls. This commit allows running such binaries by inserting dummy functions for unimplemented syscalls.
Resolved by following changes: |
Based on my experiments, hello world program is now smaller: 7.1MB -> 6.7MB (-5%) |
Now wasm-ld strips data segments referenced through
__start/__stop
symbols during GC, and it removes Swift metadata sections like swift5_protocolsWe should add support of SHF_GNU_RETAIN-like flag for
__attribute__((retain))
to LLVM and wasm-ld. For now, just disable section GC for Wasm target.The text was updated successfully, but these errors were encountered: