-
Notifications
You must be signed in to change notification settings - Fork 8
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
Use wasm opt #193
base: main
Are you sure you want to change the base?
Use wasm opt #193
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the new version on several smart contracts. LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently this produces a linker error on Windows that we probably need to figure out how to resolve:
= note: C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Thomas\Documents\concordium\concordium-smart-contract-tools\cargo-concordium\target\release\deps\libwasm_opt_sys-43fb2d296010354e.rlib(33c8a920b262e069-wasm-validator.o):wasm-validator:(.text$_ZN4wasm4Pass13runOnFunctionEPNS_6ModuleEPNS_8FunctionE+0x0): multiple definition of `wasm::Pass::runOnFunction(wasm::Module*, wasm::Function*)'; C:\Users\Thomas\Documents\concordium\concordium-smart-contract-tools\cargo-concordium\target\release\deps\libwasm_opt_cxx_sys-29cb707347905cdf.rlib(aeea60e054e9ce5c-lib.rs.o):lib.rs.cc:(.text$_ZN4wasm4Pass13runOnFunctionEPNS_6ModuleEPNS_8FunctionE[_ZN4wasm4Pass13runOnFunctionEPNS_6ModuleEPNS_8FunctionE]+0x0): first defined here␍
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Thomas\Documents\concordium\concordium-smart-contract-tools\cargo-concordium\target\release\deps\libwasm_opt_sys-43fb2d296010354e.rlib(33c8a920b262e069-wasm-validator.o):wasm-validator:(.text$_ZN4wasm4Pass3runEPNS_6ModuleE+0x0): multiple definition of `wasm::Pass::run(wasm::Module*)'; C:\Users\Thomas\Documents\concordium\concordium-smart-contract-tools\cargo-concordium\target\release\deps\libwasm_opt_cxx_sys-29cb707347905cdf.rlib(aeea60e054e9ce5c-lib.rs.o):lib.rs.cc:(.text$_ZN4wasm4Pass3runEPNS_6ModuleE[_ZN4wasm4Pass3runEPNS_6ModuleE]+0x0): first defined here␍
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Thomas\Documents\concordium\concordium-smart-contract-tools\cargo-concordium\target\release\deps\libwasm_opt_sys-43fb2d296010354e.rlib(33c8a920b262e069-wasm-validator.o):wasm-validator:(.text$_ZN4wasm4Pass6createEv+0x0): multiple definition of `wasm::Pass::create()'; C:\Users\Thomas\Documents\concordium\concordium-smart-contract-tools\cargo-concordium\target\release\deps\libwasm_opt_cxx_sys-29cb707347905cdf.rlib(aeea60e054e9ce5c-lib.rs.o):lib.rs.cc:(.text$_ZN4wasm4Pass6createEv[_ZN4wasm4Pass6createEv]+0x0): first defined here␍
collect2.exe: error: ld returned 1 exit status
wasm_opt::OptimizationOptions::new_optimize_for_size() | ||
.run(&filename, &filename) | ||
.context("Failed running wasm_opt")?; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that we should optimize here. Isn't this liable to break reproducible builds?
Purpose
Use
wasm-opt
in cargo concordium when building to workaround the issue of concordium smart contract runtime not supporting 5 bytes encodings of zero in certain places introduced in LLVM 19 (Rust 1.82)