diff options
author | deadprogram <[email protected]> | 2023-10-23 21:12:38 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2023-10-25 08:57:39 +0200 |
commit | 9fd9d9c05a5c03c11c385c3d920cfb4e64016168 (patch) | |
tree | 5c49ca7434f9924df1450adf070a17074b1d1723 /compileopts | |
parent | fd50227a3d2049ec1ba490a727ef54fc4c36179d (diff) | |
download | tinygo-9fd9d9c05a5c03c11c385c3d920cfb4e64016168.tar.gz tinygo-9fd9d9c05a5c03c11c385c3d920cfb4e64016168.zip |
compileopts: add cflag '-isystem' for resource directory search since needed for Xtensa
Signed-off-by: deadprogram <[email protected]>
Diffstat (limited to 'compileopts')
-rw-r--r-- | compileopts/config.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/compileopts/config.go b/compileopts/config.go index 36f7d8ed4..2260de2d2 100644 --- a/compileopts/config.go +++ b/compileopts/config.go @@ -265,11 +265,17 @@ func (c *Config) CFlags(libclang bool) []string { } resourceDir := goenv.ClangResourceDir(libclang) if resourceDir != "" { - // The resoure directory contains the built-in clang headers like + // The resource directory contains the built-in clang headers like // stdbool.h, stdint.h, float.h, etc. // It is left empty if we're using an external compiler (that already // knows these headers). - cflags = append(cflags, "-resource-dir="+resourceDir) + cflags = append(cflags, + "-resource-dir="+resourceDir, + ) + if strings.HasPrefix(c.Triple(), "xtensa") { + // workaround needed in LLVM 16, see: https://github.com/espressif/llvm-project/issues/83 + cflags = append(cflags, "-isystem", filepath.Join(resourceDir, "include")) + } } switch c.Target.Libc { case "darwin-libSystem": |