aboutsummaryrefslogtreecommitdiffhomepage
path: root/compileopts/target.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2024-11-07 14:38:31 +0100
committerRon Evans <[email protected]>2024-11-20 18:50:34 +0100
commitdd1ebbd31bd23474148686bd1d7a7298fe85038d (patch)
treefde74a680d8a6290291164d7fde201d459602d57 /compileopts/target.go
parent95671469c75cb56e7bdee9a061bc20114b4c2dc0 (diff)
downloadtinygo-dd1ebbd31bd23474148686bd1d7a7298fe85038d.tar.gz
tinygo-dd1ebbd31bd23474148686bd1d7a7298fe85038d.zip
runtime: implement race-free signals using futexes
This requires an API introduced in MacOS 11. I think that's fine, since the version before that (MacOS 10.15) is EOL since 2022. Though if needed, we could certainly work around it by using an older and slightly less nice API.
Diffstat (limited to 'compileopts/target.go')
-rw-r--r--compileopts/target.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/compileopts/target.go b/compileopts/target.go
index 3dc8af02f..f60ee3097 100644
--- a/compileopts/target.go
+++ b/compileopts/target.go
@@ -390,6 +390,7 @@ func defaultTarget(options *Options) (*TargetSpec, error) {
"-platform_version", "macos", platformVersion, platformVersion,
)
spec.ExtraFiles = append(spec.ExtraFiles,
+ "src/internal/futex/futex_darwin.c",
"src/runtime/os_darwin.c",
"src/runtime/runtime_unix.c",
"src/runtime/signal.c")
@@ -413,6 +414,7 @@ func defaultTarget(options *Options) (*TargetSpec, error) {
spec.CFlags = append(spec.CFlags, "-mno-outline-atomics")
}
spec.ExtraFiles = append(spec.ExtraFiles,
+ "src/internal/futex/futex_linux.c",
"src/runtime/runtime_unix.c",
"src/runtime/signal.c")
case "windows":