mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-12 23:13:40 +00:00
builder: build wasi-libc inside TinyGo
Instead of relying on a build when TinyGo is being built, do it like all
other libraries when it is needed.
This brings a few benefits:
* No more running `make wasi-libc` on the command line as a special
case for WebAssembly. The generic `git submodule update --init` step
is now enough for wasi-libc.
* It becomes much easier to customize the build per system. For
example: include/exclude malloc as needed, disable/enable bulk
memory operations per target, etc.
This commit is contained in:
committed by
Ron Evans
parent
4c54aa20da
commit
632357ffb9
@@ -371,10 +371,10 @@ func (c *Config) LibcCFlags() []string {
|
||||
"-isystem", filepath.Join(root, "lib", "musl", "include"),
|
||||
}
|
||||
case "wasi-libc":
|
||||
root := goenv.Get("TINYGOROOT")
|
||||
path := c.LibcPath("wasi-libc")
|
||||
return []string{
|
||||
"-nostdlibinc",
|
||||
"-isystem", root + "/lib/wasi-libc/sysroot/include",
|
||||
"-isystem", filepath.Join(path, "include"),
|
||||
}
|
||||
case "wasmbuiltins":
|
||||
// nothing to add (library is purely for builtins)
|
||||
|
||||
Reference in New Issue
Block a user