commit e21ab557e00b7c94febf4ede8eebe4fb6cee8c34
parent 625fd7e22a5381b8a694651a78d46f86d1a6c33e
Author: Autumn! <autumnull@posteo.net>
Date: Wed, 10 May 2023 23:55:16 +0000
rt, cmd/hare: pass empty namespace for toplevel on libc
Signed-off-by: Autumn! <autumnull@posteo.net>
Diffstat:
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/cmd/hare/schedule.ha b/cmd/hare/schedule.ha
@@ -236,6 +236,7 @@ fn sched_hare_object(
module = strings::dup(ns),
});
+ let libc = false;
for (let i = 0z; i < len(plan.context.tags); i += 1) {
if (plan.context.tags[i].mode == module::tag_mode::INCLUSIVE
&& plan.context.tags[i].name == "test") {
@@ -246,11 +247,13 @@ fn sched_hare_object(
append(harec.cmd, "-T");
};
plan.context.paths = opaths;
- break;
+ } else if (plan.context.tags[i].mode == module::tag_mode::INCLUSIVE
+ && plan.context.tags[i].name == "libc") {
+ libc = true;
};
};
- if (len(namespace) != 0) {
+ if (len(ns) != 0 || libc) {
append(harec.cmd, ["-N", ns]...);
};
diff --git a/rt/start+libc.ha b/rt/start+libc.ha
@@ -1,7 +1,7 @@
// License: MPL-2.0
// (c) 2021 Drew DeVault <sir@cmpwn.com>
-@symbol("main") fn main() void;
+@symbol(".main") fn main() void;
@symbol("exit") fn c_exit(status: int) void;
const @symbol("__fini_array_start") fini_start: [*]*fn() void;
@@ -18,7 +18,7 @@ export fn fini() void = {
};
};
-export @noreturn fn start_ha() void = {
+export @symbol("main" )@noreturn fn start_ha() void = {
// libc runs @init and @fini for us (unless rt::exit() is called)
main();
c_exit(0);