-
Notifications
You must be signed in to change notification settings - Fork 197
Add an option to specify CFLAGS for wasm features and make lime1 the default #527
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
base: main
Are you sure you want to change the base?
Conversation
5e94f81
to
c6d8505
Compare
Should we have the wasi target default to lime1 instead? |
it's a valid solution. my feeling is it's app developers' choice which set of features it targets to though. the intention of this PR is "do not enable extra features we ourselves (eg. libc) doesn't benefit from". |
Up to a point this is true, but we also what sensible defaults. Developers who want to target specs older than out defaults can/should be asked to rebuild libc themselves, right? My understanding was the lime1 was specifically designed as a sensible subset of
extended-const does benefit shared library builds (it allows data segments to express their offset without extra startup code). |
honestly speaking, i don't understand why "generic" and wasi should have different defaults.
it's true. |
Could you comment on the practical impact of this change? Which features in the wasi-libc build are you looking to disable? Or is there some other purpose here? |
reference-types makes some environment unhappy. |
It is in some, it's behind a flag in others, and it's expected to be easy to implement for the rest. And it also happens to be shipping in all the web runtimes already. And, it enables significantly better dynamic libraries. There's a tradeoff here, but unless we know of some significant burden this creates, I think it makes sense to keep the ecosystem moving forward, and leave extended-const enabled here. |
My motivation is to allow -mcpu=lime1 build with LLVM 20. Note that extended-const is a part of lime1. https://github.com/WebAssembly/tool-conventions/blob/main/Lime.md#lime1 cf. WebAssembly/wasi-sdk#527
ok. |
My motivation is to allow -mcpu=lime1 build with LLVM 20. Note that extended-const is a part of lime1. https://github.com/WebAssembly/tool-conventions/blob/main/Lime.md#lime1 cf. WebAssembly/wasi-sdk#527
i filed llvm/llvm-project#140010 while testing this |
To include: WebAssembly/wasi-libc#582
…default Add a cmake option WASI_SDK_CPU_CFLAGS to specify CFLAGS to control wasm features to enable/disable. Make the default `-mcpu=lime1`. Comparing to the default "generic" target of the recent llvm, this effectively: * disables reference-types and bulk-memory (enable their partial counterparts instead) * enables extended-const Note: as of writing this, a few popular runtimes, including wasm3 and wasm-micro-runtime, don't support extented-const yet. Note: regardless of this, wasi-libc enables necessary features for certain files. (bulk-memory and exception-handling) cf. WebAssembly#525 References: https://github.com/WebAssembly/tool-conventions/blob/main/Lime.md bytecodealliance/wasm-micro-runtime#4272
Add a cmake option WASI_SDK_CPU_CFLAGS to specify CFLAGS to control wasm features to enable/disable.
Make the default
-mcpu=lime1
.Comparing to the default "generic" target of the recent llvm, this effectively
Note: as of writing this, a few popular runtimes, including wasm3 and wasm-micro-runtime,
don't support extented-const yet.
Note: regardless of this, wasi-libc enables necessary features for certain files. (bulk-memory and exception-handling)
cf. #525
References:
https://github.com/WebAssembly/tool-conventions/blob/main/Lime.md
bytecodealliance/wasm-micro-runtime#4272