aboutsummaryrefslogtreecommitdiffhomepage
path: root/compileopts/target.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2024-08-02 17:10:52 +0200
committerRon Evans <[email protected]>2024-10-23 12:25:27 +0100
commitb8fe75a9dd4949a08b78b2f3dd06fa3c697573dd (patch)
tree79350981ea8af9440f86818cd17c49741a948c89 /compileopts/target.go
parent0f95b4102d83b6977277ea7d5e87ad538eddc5ef (diff)
downloadtinygo-b8fe75a9dd4949a08b78b2f3dd06fa3c697573dd.tar.gz
tinygo-b8fe75a9dd4949a08b78b2f3dd06fa3c697573dd.zip
runtime: add support for os/signal
This adds support for enabling and listening to signals on Linux and MacOS.
Diffstat (limited to 'compileopts/target.go')
-rw-r--r--compileopts/target.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/compileopts/target.go b/compileopts/target.go
index ab9f871f3..b5df5b911 100644
--- a/compileopts/target.go
+++ b/compileopts/target.go
@@ -391,7 +391,8 @@ func defaultTarget(options *Options) (*TargetSpec, error) {
)
spec.ExtraFiles = append(spec.ExtraFiles,
"src/runtime/os_darwin.c",
- "src/runtime/runtime_unix.c")
+ "src/runtime/runtime_unix.c",
+ "src/runtime/signal.c")
case "linux":
spec.Linker = "ld.lld"
spec.RTLib = "compiler-rt"
@@ -412,7 +413,8 @@ func defaultTarget(options *Options) (*TargetSpec, error) {
spec.CFlags = append(spec.CFlags, "-mno-outline-atomics")
}
spec.ExtraFiles = append(spec.ExtraFiles,
- "src/runtime/runtime_unix.c")
+ "src/runtime/runtime_unix.c",
+ "src/runtime/signal.c")
case "windows":
spec.Linker = "ld.lld"
spec.Libc = "mingw-w64"