Update how wasi-sdk uses cmake - #161
Merged
Merged
Conversation
sbc100
reviewed
Oct 15, 2020
| # run the compiler to see if it produces working binaries succeed. | ||
| mkdir -p $(PREFIX)/lib/clang/$(CLANG_VERSION)/lib/wasi | ||
| $(AR) cr $(PREFIX)/share/wasi-sysroot/lib/wasm32-wasi/libc++.a | ||
| $(AR) cr $(PREFIX)/share/wasi-sysroot/lib/wasm32-wasi/libc++abi.a |
Member
There was a problem hiding this comment.
This is a little gross.. but I don't know that right way to bootstrap here.
Member
There was a problem hiding this comment.
Actually I think its slightly better to do -DCMAKE_C_COMPILER_WORKS=ON on the command line here. Basically saying "we are bootstrapping here so skip compiler checks".
Doing it in the wasi-sdk.cmake globally was wrong but going it locally is not so bad IMHO.
Member
Author
There was a problem hiding this comment.
I like that idea. I've now updated the PR to do this, and removed all the empty-archive hacks.
sbc100
reviewed
Oct 15, 2020
|
|
||
| # Flags for libcxxabi. | ||
| LIBCXXABI_CMAKE_FLAGS = \ | ||
| -DCMAKE_C_COMPILER_WORKS=ON \ |
Member
There was a problem hiding this comment.
Oh.. looks like these were already specified below!
sbc100
approved these changes
Oct 15, 2020
Change `CMAKE_SYSTEM_NAME` to `WASI`, use a `CMAKE_MODULE_PATH`, remove `CACHE` usage, and fix the compiler autodetection code so that the "compiler works" hacks are no longer needed, following the advice in [this comment](https://gitlab.kitware.com/cmake/cmake/-/issues/19223#note_567327). This is hopefully a step towards re-submitting WASI support to upstream cmake.
This ensures that it finds the built sysroot when testing whether the C compiler works.
compiler-rt depends on some libc headers, so it needs a sysroot.
sunfishcode
force-pushed
the
sunfishcode/cmake-module-path
branch
from
November 30, 2020 21:30
fc51f5f to
985879e
Compare
It appears with the removal of the AR checks cmake is no longer autodetecting CMAKE_AR, so set it explicitly.
kildom
pushed a commit
to kildom/clang-wasi-port
that referenced
this pull request
Jul 14, 2021
…bly#161) This is a minor code-size optimization.
alexcrichton
pushed a commit
to alexcrichton/wasi-sdk
that referenced
this pull request
Apr 5, 2023
This change was mostly generated by changing the upstream llvm branch to 9.x and running: $ git submodule update --remote As well as switching the llvm 9 this change also bring in the following wasi-libc changes: 5933c20 fix macos filename, use https 7c39519 CI: upgrade to llvm 9.0.0 9ca5187 remove no-self-update workaround for windows azure 9580a25 deprecate azure pipelines CI, build libc on GH Actions 2c2fc9a Don't call `free` on paths which are about to call `_Exit`. (WebAssembly#161) c6f2c05 gen-headers: Generate assertions of layout from witx (WebAssembly#149) 37c663f Correct minor typo in c_headers.rs (WebAssembly#166) 12f5832 Convert more wasi-libc code to `//`-style comments. (WebAssembly#153) ec86d4d Improvements to wasi-headers tool (WebAssembly#160) 1fad338 Fix environment variable init to exit successfully. (WebAssembly#159) a280fea Move math source files. (WebAssembly#151) dd010be Avoid using cast expressions in WASI API constants. (WebAssembly#148) Fixes: WebAssembly#101
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.
Change
CMAKE_SYSTEM_NAMEtoWASI, use aCMAKE_MODULE_PATH,remove
CACHEusage, and fix the compiler autodetection code so thatthe "compiler works" hacks are no longer needed, following the advice in
this comment.
This is hopefully a step towards re-submitting WASI support to upstream cmake.