* Add DWARF debugging information to all artifacts by default
This commit adds DWARF debugging information with the `-g` compiler flag
to all WASI artifacts for wasi-sdk. The LLVM build itself does not have
debugging information, only the sysroot artifacts. This is intended to
assist with debugging. The main downside to this is binary size of
generated artifacts will, by default, be larger. Stripping debug
information from an artifact though involves removing custom sections
which is generally pretty easy to do through wasm tooling.
* Pass extra cflags to wasi-libc
* Fix tests from previous commit
* Update some expected error messages and remove some files with
duplicate error messages that are no longer needed.
* Remove undefined behavior in `stat.c` where padding bytes were being
compared.
* Update LLVM to 18.1.2 and add wasm-component-ld
This commit has two intertwined changes within it. First the LLVM
submodule is updated to the 18.1.2 release branch. This alone would
cause CI and tests to fail due to differing behavior for the
`wasm32-wasip2` target. To fix these test failures the
`wasm-component-ld` tool is added to the build. This tool is a
Rust-written tool and installed via `cargo install` as part of the build
at a pinned version written in the `Makefile`. This linker, used for
components, is then used for the `wasm32-wasip2` target.
Tests and CI are then updated to skip the need to have `wasm-tools` or
the adapter for WASI when making components since that's now the job of
`wasm-component-ld`. This then necessitated some changes to tests too.
* Add back accidentally deleted CI
* Inherit tools on PATH on Windows
* Add Rust to docker build
* Put rust in a different location in docker
* Try to fix permissions
* Review comments
* Revert changes to test outputs
This updates the `wasi-libc` submodule to point to `main` and also:
- update tests/testcase.sh to use new wasm32-wasip2 target name
- update various tests/**/*.expected files to match Wasmtime output
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
* Explicitly set LIBCXXABI_USE_LLVM_UNWINDER off
Clang trunk has recently turned it on, and also now fails the build when
libunwind is not built at the same time.
* Bump LLVM to 18.1.0
---------
Co-authored-by: Mike Hommey <mh@glandium.org>
* Start renaming preview1 to p1 and preview2 to p2
This commit is a reflection of WebAssembly/wasi-libc#478 into this
repository where a few changes are happening:
* A new `wasm32-wasip1` sysroot is prepared matching `wasm32-wasi`
* A new `wasm32-wasip1-threads` sysroot is prepared matching `wasm32-wasi-threads`
* The `wasm32-wasi-preview2` target is renamed `wasm32-wasip2`
I've done a bit of makefile refactoring to deduplicate things a bit now
that there's a number of targets being built.
The long-term goal would be to remove the `wasm32-wasi` and
`wasm32-wasip1-threads` targets, but that's not proposed just yet at
this time.
* Use $(CLANG_VERSION) instead of hardcoding
As of LLVM 17, which includes https://reviews.llvm.org/D152168, libcxx has
combined the old `_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY` and
`_LIBCPP_HAS_NO_FSTREAM` preprocessor symbols into a single
`_LIBCPP_HAS_NO_FILESYSTEM` symbol, which means there's no longer any way to
enable `<fstream>` without enabling `<filesystem>`.
The solution is to set `-DLIBCXX_ENABLE_FILESYSTEM:BOOL=ON` and update
`wasi-libc`, which includes stubs for the functions required by libcxx's
`<filesystem>` implementation.
Fixes#373
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
* build and test `wasm32-wasi-preview2` target
This updates `wasi-libc` to include
https://github.com/WebAssembly/wasi-libc/pull/457, which adds preliminary
support for the new `wasm32-wasi-preview2` target.
It also adds support for testing the new target using Wasmtime 16.0.0 and
`wit-component`. Note that Wasmtime produces different output when reporting
errors for Preview 2 components than it does for Preview 1 modules, so I've
added a few .expected files specific to Preview 2.
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
* test all three targets
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
---------
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
WebAssembly/wasi-libc#403 fixed an issue with `a_barrier` that should be
included in the next release of wasi-sdk. This change updates wasi-libc
to the latest `HEAD` of `main` to include it.
* llvm-project: update to 16.0.0 release
This changes updates the `src/llvm-project` submodule to the `HEAD` of
`release/16.x`, the same commit used to [release] the LLVM 16.0.0
binaries.
[release]: https://github.com/llvm/llvm-project/releases/tag/llvmorg-16.0.0
* fix: use only Clang's major version in install prefix
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
* review: only use `llvm_version_major.sh`
Since the `Makefile` can get by with only knowing Clang's major version,
this change removes `llvm_version.sh` and sets `CLANG_VERSION` to use
only the major part.
* 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
* 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.
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)
- 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)
* 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.
It appears I accidentally merged in a git submodule diff in #197
which reverted the LLVM, wasi-libc, and config updates. Revert
that change, updating wasi-sdk again to LLVM 13.0 and the latest
wasi-libc and config.
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`. (#161)
c6f2c05 gen-headers: Generate assertions of layout from witx (#149)
37c663f Correct minor typo in c_headers.rs (#166)
12f5832 Convert more wasi-libc code to `//`-style comments. (#153)
ec86d4d Improvements to wasi-headers tool (#160)
1fad338 Fix environment variable init to exit successfully. (#159)
a280fea Move math source files. (#151)
dd010be Avoid using cast expressions in WASI API constants. (#148)
Fixes: #101
This brings in the following changes:
f645f49 Update signal macros after upgrade to snapshot1 (#144)
8b3266d github actions: pin checkout action to v1 (#145)
410c660 Use constructor functions for optional init routines. (#142)
fe13053 c header generation updated for reorganized witx ast (#139)
cd74e1d Correct the version of #136 on master (#141)
446cb3f Wasi snapshot preview1 (#140)
54102f0 Ignore rights in libpreopen. (#129)
8c9e1c6 Make the `__original_main` definition weak, fixing -flto. (#138)
cf81683 Optimize `fmin`, `fmax`, etc. (#120)
deb8eae Don't pre-check capabilities in `openat`. (#130)
ca9046d Use consistent style for wasi-libc C source files. (#131)
951cc3e Fix unintended recursion in __wasilibc_register_preopened_fd. (#133)
5216983 Avoid a `strdup` call in `__wasilibc_populate_libpreopen`. (#128)
70099d4 Don't link in libpreopen initialization code when it isn't needed. (#127)
ec4549d Temporarily disable the use of `__heap_base`. (#132)
a214f1c Use __heap_base by dlmalloc (#114)
a94d2d0 Avoid varargs conventions when calling open (#126)
7fcc4f2 Revamp and simplify the libpreopen code. (#110)
eb7230c Remove more unsupported headers. (#123)