nix: fix wasi-libc include headers

Apparently Nix really doesn't like --sysroot, so we have to use
`-nostdlibinc` and `-isystem` instead.
This commit is contained in:
Ayke van Laethem
2024-03-28 12:25:58 +01:00
committed by Ron Evans
parent 055950421a
commit 331cfb65b7
+3 -1
View File
@@ -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":