diff options
author | Ayke van Laethem <[email protected]> | 2024-03-28 12:25:58 +0100 |
---|---|---|
committer | Ron Evans <[email protected]> | 2024-03-28 15:46:00 +0100 |
commit | 331cfb65b772612ad65f69718400f1ee1fb07d63 (patch) | |
tree | 03fd4371e160ab11a8623fd9c39770fe338920bd /compileopts | |
parent | 055950421aa563c0b03e9904ce68785ec597133b (diff) | |
download | tinygo-331cfb65b772612ad65f69718400f1ee1fb07d63.tar.gz tinygo-331cfb65b772612ad65f69718400f1ee1fb07d63.zip |
nix: fix wasi-libc include headers
Apparently Nix really doesn't like --sysroot, so we have to use
`-nostdlibinc` and `-isystem` instead.
Diffstat (limited to 'compileopts')
-rw-r--r-- | compileopts/config.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compileopts/config.go b/compileopts/config.go index 24da4e280..e3f67b11a 100644 --- a/compileopts/config.go +++ b/compileopts/config.go @@ -310,7 +310,9 @@ func (c *Config) CFlags(libclang bool) []string { ) case "wasi-libc": root := goenv.Get("TINYGOROOT") - cflags = append(cflags, "--sysroot="+root+"/lib/wasi-libc/sysroot") + cflags = append(cflags, + "-nostdlibinc", + "-isystem", root+"/lib/wasi-libc/sysroot/include") case "wasmbuiltins": // nothing to add (library is purely for builtins) case "mingw-w64": |