From 8fb93fbac4582b0a4af0ac78eed27a3852281f8e Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Fri, 15 Apr 2022 21:35:30 +0200 Subject: [PATCH] esp: support CGo Without this patch, the include directory isn't found and picolibc.h (used indirectly by stdint.h for example) can't be found. I would like to add tests for this but we currently don't run Xtensa tests. This should be possible however using https://github.com/espressif/qemu/wiki (see also: https://github.com/tinygo-org/tinygo/pull/2780). --- compileopts/config.go | 1 + 1 file changed, 1 insertion(+) diff --git a/compileopts/config.go b/compileopts/config.go index a06aa8fd..9fb6a3bb 100644 --- a/compileopts/config.go +++ b/compileopts/config.go @@ -287,6 +287,7 @@ func (c *Config) CFlags() []string { path, _ := c.LibcPath("picolibc") cflags = append(cflags, "--sysroot="+path, + "-isystem", filepath.Join(path, "include"), // necessary for Xtensa "-isystem", filepath.Join(picolibcDir, "include"), "-isystem", filepath.Join(picolibcDir, "tinystdio"), )