-
Notifications
You must be signed in to change notification settings - Fork 186
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
Unable to compile for wasm32-wasi
using standalone sysroot: "no available targets are compatible"
#172
Comments
It looks like perhaps your clang binary doesn't have support for WebAssembly. Although then I would expect to see an error message more like this:
You can see the targets that are included by running
|
Right, surprising to have such a recent clang version without wasm, but makes sense. The xcode CLI tools also didn't seem to come with a standalone I'll try using the prebuilt clang's y'all have in releases and see if I can make progress that way. |
You need to install |
Indeed, thanks! |
Firefox requires a bunch of build tools (aka "toolchains") to be built. Until recently, default MacOS clang (that comes with Xcode) was sufficient to compile firefox. However, Firefox 95 started to use WebAssembly. This yielded the following issues specific to MacOS (somehow builds complete successfully on other platforms): - Default MacOS clang that comes with XCode doesn't support WebAssembly: WebAssembly/wasi-sdk#172 (comment) - Clang that comes from Homebrew is missing `libclang_rt.builtins-wasm32.a`: https://github.com/jedisct1/libclang_rt.builtins-wasm32.a/blob/79b9b39f9be950110d3a7d6f91d86074349d8302/README.md - Firefox also requires `wasi sysroot` Now, depending on which branch firefox checkout comes from (`mozilla-release` vs `mozilla-beta`), firefox build system **might** or **might not** be able to download all the required toolchains in the `$HOME/.mozbuild` folder: - `mozilla-beta` branch supports toolchain auto-download - `mozilla-release` **does not** support it yet: https://bugzilla.mozilla.org/show_bug.cgi?id=1744197#c2 The recommended solution is to download toolchains using non-release firefox branch, and then re-use these toolchains to compile firefox from release branch. This patch does exactly this: relies on pre-downloaded toolchains for release firefox compilation using a combination of `MOZ_AUTOMATION` and `MOZ_FETCH_DIR` environment variables - these are also used on the official Firefox CI to compile release builds. This almost works, but there's a catch: the `MOZ_AUTOMATION` environment variable auto-adds ("implies") the `--enable-release` configuration option, which is supposed to yield a better binary, but is also more picky about the source code: for example, it complains about unused return values. Browser changes in this patch are addressing these. References microsoft#10759
Firefox requires a bunch of build tools (aka "toolchains") to be built. Until recently, default MacOS clang (that comes with Xcode) was sufficient to compile firefox. However, Firefox 95 started to use WebAssembly. This yielded the following issues specific to MacOS (somehow builds complete successfully on other platforms): - Default MacOS clang that comes with XCode doesn't support WebAssembly: WebAssembly/wasi-sdk#172 (comment) - Clang that comes from Homebrew is missing `libclang_rt.builtins-wasm32.a`: https://github.com/jedisct1/libclang_rt.builtins-wasm32.a/blob/79b9b39f9be950110d3a7d6f91d86074349d8302/README.md - Firefox also requires `wasi sysroot` Now, depending on which branch firefox checkout comes from (`mozilla-release` vs `mozilla-beta`), firefox build system **might** or **might not** be able to download all the required toolchains in the `$HOME/.mozbuild` folder: - `mozilla-beta` branch supports toolchain auto-download - `mozilla-release` **does not** support it yet: https://bugzilla.mozilla.org/show_bug.cgi?id=1744197#c2 The recommended solution is to download toolchains using non-release firefox branch, and then re-use these toolchains to compile firefox from release branch. This patch does exactly this: relies on pre-downloaded toolchains for release firefox compilation. To re-use pre-downloaded toolchains, we set a combination of `MOZ_AUTOMATION` and `MOZ_FETCH_DIR` environment variables - this is the same approach that is used on the official Firefox CI (see `about:buildconfig` page in the stable firefox 95). This almost works, but there's a catch: the `MOZ_AUTOMATION` environment variable auto-adds ("implies") the `--enable-release` configuration option, which is supposed to yield a better binary, but is also more picky about the source code: for example, it complains about unused return values. Browser changes in this patch are addressing these. References microsoft#10759
Firefox requires a bunch of build tools (aka "toolchains") to be built. Until recently, default MacOS clang (that comes with Xcode) was sufficient to compile firefox. However, Firefox 95 started to use WebAssembly. This yielded the following issues specific to MacOS (somehow builds complete successfully on other platforms): - Default MacOS clang that comes with XCode doesn't support WebAssembly: WebAssembly/wasi-sdk#172 (comment) - Clang that comes from Homebrew is missing `libclang_rt.builtins-wasm32.a`: https://github.com/jedisct1/libclang_rt.builtins-wasm32.a/blob/79b9b39f9be950110d3a7d6f91d86074349d8302/README.md - Firefox also requires `wasi sysroot` Now, depending on which branch firefox checkout comes from (`mozilla-release` vs `mozilla-beta`), firefox build system **might** or **might not** be able to download all the required toolchains in the `$HOME/.mozbuild` folder: - `mozilla-beta` branch supports toolchain auto-download - `mozilla-release` **does not** support it yet: https://bugzilla.mozilla.org/show_bug.cgi?id=1744197#c2 The recommended solution is to download toolchains using non-release firefox branch, and then re-use these toolchains to compile firefox from release branch. This patch does exactly this: relies on pre-downloaded toolchains for release firefox compilation. To re-use pre-downloaded toolchains, we set a combination of `MOZ_AUTOMATION` and `MOZ_FETCH_DIR` environment variables - this is the same approach that is used on the official Firefox CI (see `about:buildconfig` page in the stable firefox 95). This almost works, but there's a catch: the `MOZ_AUTOMATION` environment variable auto-adds ("implies") the `--enable-release` configuration option: https://github.com/mozilla/gecko-dev/blob/9e1cd985485c0e01c5faa9b5072a405b344ebde7/moz.configure#L162 The `--enable-release` is supposed to yield a better binary, but is also more picky about the source code: for example, it complains about unused return values. Browser changes in this patch are addressing these. References microsoft#10759
Firefox requires a bunch of build tools (aka "toolchains") to be built. Until recently, default MacOS clang (that comes with Xcode) was sufficient to compile firefox. However, Firefox 95 started to use WebAssembly. This yielded the following issues specific to MacOS (somehow builds complete successfully on other platforms): - Default MacOS clang that comes with XCode doesn't support WebAssembly: WebAssembly/wasi-sdk#172 (comment) - Clang that comes from Homebrew is missing `libclang_rt.builtins-wasm32.a`: https://github.com/jedisct1/libclang_rt.builtins-wasm32.a/blob/79b9b39f9be950110d3a7d6f91d86074349d8302/README.md - Firefox also requires `wasi sysroot` Now, depending on which branch firefox checkout comes from (`mozilla-release` vs `mozilla-beta`), firefox build system **might** or **might not** be able to download all the required toolchains in the `$HOME/.mozbuild` folder: - `mozilla-beta` branch supports toolchain auto-download - `mozilla-release` **does not** support it yet: https://bugzilla.mozilla.org/show_bug.cgi?id=1744197#c2 The recommended solution is to download toolchains using non-release firefox branch, and then re-use these toolchains to compile firefox from release branch. This patch does exactly this: relies on pre-downloaded toolchains for release firefox compilation. To re-use pre-downloaded toolchains, we set a combination of `MOZ_AUTOMATION` and `MOZ_FETCH_DIR` environment variables - this is the same approach that is used on the official Firefox CI (see `about:buildconfig` page in the stable firefox 95). This almost works, but there's a catch: the `MOZ_AUTOMATION` environment variable auto-adds ("implies") the `--enable-release` configuration option: https://github.com/mozilla/gecko-dev/blob/9e1cd985485c0e01c5faa9b5072a405b344ebde7/moz.configure#L162 The `--enable-release` is supposed to yield a better binary, and we want builds to be the same across platforms, so this patch adds this option **unconditionally on all platforms**. The `--enable-release` is also more picky about the source code: for example, it complains about unused return values. Browser changes in this patch are addressing these. References microsoft#10759
works for me |
I'm trying out the SDK and have downloaded only the sysroot. It's extracted to
/Users/adam/code/wasi-sysroot
, but when I pass it to clang I get an error:The contents of
main.cc
don't seem to matter but the error above came from a file withint main() {}
as its contents.I see that your release tarballs are using clang 11, whereas the xcode tools seem to have given me 12:
Maybe that's the issue?
This error was one of several others I was seeing in the larger project from which I pulled this command. The contents of the sysroot seem valid on disk, as the other errors disappeared when I began passing
--sysroot=...
.The text was updated successfully, but these errors were encountered: