aboutsummaryrefslogtreecommitdiffhomepage
path: root/compileopts
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2024-11-06 14:57:56 +0100
committerAyke <[email protected]>2024-11-20 07:53:59 +0100
commit6593cf22fad6fab2a201ed00c2cc20c76e29161a (patch)
tree929fba3e751e9665844c2e7c8b2783a872ccb1dd /compileopts
parent548fba82e691b125bdac71f6c393f67fcf4d769f (diff)
downloadtinygo-6593cf22fad6fab2a201ed00c2cc20c76e29161a.tar.gz
tinygo-6593cf22fad6fab2a201ed00c2cc20c76e29161a.zip
cgo: support errno value as second return parameter
Making this work on all targets was interesting but there's now a test in place to make sure this works on all targets that have the CGo test enabled (which is almost all targets).
Diffstat (limited to 'compileopts')
-rw-r--r--compileopts/config.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/compileopts/config.go b/compileopts/config.go
index 76215b181..ee5c34537 100644
--- a/compileopts/config.go
+++ b/compileopts/config.go
@@ -331,6 +331,7 @@ func (c *Config) CFlags(libclang bool) []string {
"-isystem", filepath.Join(path, "include"),
"-isystem", filepath.Join(picolibcDir, "include"),
"-isystem", filepath.Join(picolibcDir, "tinystdio"),
+ "-D__PICOLIBC_ERRNO_FUNCTION=__errno_location",
)
case "musl":
root := goenv.Get("TINYGOROOT")
@@ -340,6 +341,7 @@ func (c *Config) CFlags(libclang bool) []string {
"-nostdlibinc",
"-isystem", filepath.Join(path, "include"),
"-isystem", filepath.Join(root, "lib", "musl", "arch", arch),
+ "-isystem", filepath.Join(root, "lib", "musl", "arch", "generic"),
"-isystem", filepath.Join(root, "lib", "musl", "include"),
)
case "wasi-libc":