commit 51905aa80860957ba19a9253699aaf581d919e69
parent d49e2d9cbce131e0ffbf72956cb9d49398517f92
Author: Lorenz (xha) <me@xha.li>
Date: Sat, 14 Sep 2024 16:02:23 +0200
disable debug on openbsd
Co-Authored-By: "B. Atticus Grobe" <grobe0ba@tcp80.org>
Signed-off-by: Lorenz (xha) <me@xha.li>
Diffstat:
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/cmd/hare/build/gather.ha b/cmd/hare/build/gather.ha
@@ -15,7 +15,7 @@ export fn gather(ctx: *context, input: str) ([]module::module | error) = {
if (ctx.test) {
module::gather(&ctx.ctx, &mods, ["test"])?;
};
- if (!ctx.release) {
+ if (!ctx.release && ctx.platform.debug_supported) {
module::gather(&ctx.ctx, &mods, ["debug"])?;
};
const nsubmods = if (ctx.submods) {
diff --git a/cmd/hare/build/platform.ha b/cmd/hare/build/platform.ha
@@ -5,6 +5,8 @@ export type platform = struct {
name: str,
// Do we always need to link with libc? (and use cc instead of ld)
need_libc: bool,
+ // Is debug:: supported on this platform?
+ debug_supported: bool,
// Additional default flags for this platform.
default_flags: [NSTAGES][]str,
};
@@ -12,19 +14,23 @@ export type platform = struct {
const platforms: [_]platform = [
platform {
name = "Linux",
+ debug_supported = true,
...
},
platform {
name = "FreeBSD",
+ debug_supported = true,
...
},
platform {
name = "NetBSD",
+ debug_supported = true,
...
},
platform {
name = "OpenBSD",
need_libc = true,
+ debug_supported = false,
default_flags = [
[],
[],
diff --git a/debug/fault.ha b/debug/fault.ha
@@ -15,7 +15,7 @@ def ALTSTACK_SIZE: size = 16384;
@init fn init_overflow() void = {
rt::sigaltstack(&rt::stack_t {
- ss_sp = rt::malloc(ALTSTACK_SIZE): *opaque,
+ ss_sp = &altstack,
ss_flags = 0,
ss_size = ALTSTACK_SIZE,
}, null)!;