Due to [a change] in LLVM, Clang will expect to find the
`libclang_rt.builtins-wasm32.a` file in a path that only contains the
major version (`16`) instead of the entire version (`16.0.0`) as was
previously the case. This change modifies the `CMAKE_INSTALL_PREFIX` to
use Clang's major version only.
[a change]: https://reviews.llvm.org/D125860
* Update wasi-libc to latest HEAD
This pulls in a variety of changes, many of them related to enabling
threads in wasi-libc. There may be more changes necessary before
releasing a prelease version of wasi-sdk that supports the new
`wasm32-wasi-threads` target, but this should get the majority of them.
* review: incorporate WebAssembly/wasi-libc#324
* Add a variation of wasi-sdk.cmake for pthread-using apps
* Install wasi-sdk-pthread.cmake
* Build wasi-libc with THREAD_MODEL=posix as well
* wasi-sdk-pthread.cmake: target rename to wasm32-wasi-threads
after https://github.com/WebAssembly/wasi-libc/pull/381
* Update llvm-project to the latest release/15.x
This pulls in the `__heap_end` symbol, which fixes the issue discussed
in https://github.com/WebAssembly/wasi-libc/pull/377.
* Update to the official 15.0.7 release.
The version 11.0 is chosen because Apple seems providing
support for two previous releases.
(As of writing this, the latest is 13.)
REVISIT: as we don't need any brand-new OS features, it
might make more sense to specify even older version.
This might explain the following error i've seen with wasi-sdk-17.0
release binary on macos-11.0:
```
Run Build Command(s):/usr/bin/make -f Makefile cmTC_254ef/fast && /Applications/Xcode_13.2.1.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_254ef.dir/build.make CMakeFiles/cmTC_254ef.dir/build
Building C object CMakeFiles/cmTC_254ef.dir/testCCompiler.c.obj
/Users/runner/work/toywasm/toywasm/.wasi-sdk-17.0/bin/clang -o CMakeFiles/cmTC_254ef.dir/testCCompiler.c.obj -c /Users/runner/work/toywasm/toywasm/build.wasm/CMakeFiles/CMakeScratch/TryCompile-aWXHXM/testCCompiler.c
dyld: Symbol not found: __ZTTNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE
Referenced from: /Users/runner/work/toywasm/toywasm/.wasi-sdk-17.0/bin/clang (which was built for Mac OS X 12.0)
Expected in: /usr/lib/libc++.1.dylib
in /Users/runner/work/toywasm/toywasm/.wasi-sdk-17.0/bin/clang
make[1]: *** [CMakeFiles/cmTC_254ef.dir/testCCompiler.c.obj] Abort trap: 6
make: *** [cmTC_254ef/fast] Error 2
```
References:
https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_DEPLOYMENT_TARGET.html
Update to wasi-libc a1c7c2c7a4b2813c6f67bd2ef6e0f430d31cebad
- Don't use sbrk(0) to determine the initial heap size (WebAssembly/wasi-libc#377)
- Fix more headers to avoid depending on `max_align_t` (WebAssembly/wasi-libc#375)
- Use `ENOENT` rather than `ENOTCAPABLE` for missing preopens. (WebAssembly/wasi-libc#370)
- Adjust Makefile for LLVM trunk (16) as of 2022-11-08 (WebAssembly/wasi-libc#344)
These dependencies are not needed in wasi-sdk, and if they're enabled,
the msys2 dll depenndencies will leak into build products. Also
statically links libstdc++, required for the windows build.
- Fix utimensat to avoid passing uninitialized values into WASI calls.
- Optimize memcpy etc. using bulk-memory
- Update to musl 1.2.3.
- Fix `gettimeofday` to correctly handle a null argument.
- Remove support for `__original_main`. (#295)
This is the new method to build runtimes as of LLVM 12, and the previous
standalone method is deprecated since LLVM 14 and unsupported since
LLVM 15 (6f17768e11)
Building libcxx and libcxxabi in one go simplifies the setup necessary
as:
- tests CMakeLists.txt have some wrong dependencies which would need
to be worked around.
- LIBCXXABI_LIBCXX_INCLUDES is not recognized when building separately
and passing -I paths via the command line yields msys path munging
problems on Windows.
This effectively drops support for LLVM 11 and older.
* Update to the latest wasi-libc and LLVM 14.0.3
This updates:
- llvm-project to the llvmorg-14.0.3 tag
- wasi-libc to the current main branch
- config to the current master branch
* Update wasi-libc to pick up WebAssembly/wasi-libc#289.
The virtual-environments documents are at: https://github.com/actions/virtual-environments .
Currently, the `windows-latest` == `windows-2022`
We currently are using `Microsoft Visual Studio\2019` installed with `windows-2019` and that not installed in `windows-2022`
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
When building wasi-sdk locally, we doesn't need so verbose output that not easily distinguish
the error command from the normal command. So refactoring -v option into workflow scripts
With the following building commands:
```
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
set MSYS2_PATH_TYPE=inherit
set MSYSTEM=MINGW32
set CC=cl
set CXX=cl
set "HOME=%CD%"
bash.exe --login -c "make package"
bash.exe --login -c "make check"
cmd /k
```
Fixes following error:
c:\wasi-sdk\bin\clang++.exe --target=wasm32-wasi -DNDEBUG -D_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -Iinclude/c++build -fdebug-prefix-map=C:\work\wasi-sdk=wasisdk;\v13.5g73d30af917c4 --sysroot=c;C:\CI-Tools\msys64\wasi-sdk\share\wasi-sysroot -fPIC -DLIBCXX_BUILDING_LIBCXXABI -IC:/work/wasi-sdk/build/libcxx/include/c++/v1 -std=c++20 -MD -MT src/CMakeFiles/cxx_static.dir/regex.cpp.obj -MF src\CMakeFiles\cxx_static.dir\regex.cpp.obj.d -o src/CMakeFiles/cxx_static.dir/regex.cpp.obj -c C:/work/wasi-sdk/src/llvm-project/libcxx/src/regex.cpp
In file included from C:/work/wasi-sdk/src/llvm-project/libcxx/src/regex.cpp:9:
In file included from C:/work/wasi-sdk/build/libcxx/include/c++/v1\regex:766:
In file included from C:/work/wasi-sdk/build/libcxx/include/c++/v1\__debug:14:
In file included from C:/work/wasi-sdk/build/libcxx/include/c++/v1\iosfwd:98:
C:/work/wasi-sdk/build/libcxx/include/c++/v1\wchar.h:119:15: fatal error: 'wchar.h' file not found
#include_next <wchar.h>
^~~~~~~~~