summaryrefslogtreecommitdiff
path: root/myrbuild
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2012-10-02 01:17:17 -0400
committerOri Bernstein <ori@eigenstate.org>2012-10-02 01:17:17 -0400
commit5778299b7291336a05a50d7387d99c9f28013937 (patch)
treede36841d8c080ca46f5b34f799ab027ef72b74eb /myrbuild
parent410752ea2d5f6661e363379d14bd255521ca46e7 (diff)
downloadmc-5778299b7291336a05a50d7387d99c9f28013937.tar.gz
Use C strings for system calls.
We used Myrddin strings, which are not nul terminated, when entering the system. Since Posix systems use nul terminated strings for paths and such in system calls, this was wrong. Now, strings are allocated on the stack by an assembly function that does some trickery with stack pointer adjustment, and passed to the kernel that way. This should not be a bottleneck, and allows us to keep slicing strings.
Diffstat (limited to 'myrbuild')
-rw-r--r--myrbuild/myrbuild.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/myrbuild/myrbuild.c b/myrbuild/myrbuild.c
index e3ff37a..7aabbb7 100644
--- a/myrbuild/myrbuild.c
+++ b/myrbuild/myrbuild.c
@@ -162,7 +162,7 @@ void compile(char *file)
char *localdep;
char *deps[512];
char buf[1024];
- char *extra[2] = {"-o", "" /* filename */};
+ char *extra[] = {"-g", "-o", "" /* filename */};
if (hassuffix(file, ".myr")) {
getdeps(file, deps, 512, &ndeps);
@@ -189,8 +189,8 @@ void compile(char *file)
} else if (hassuffix(file, ".s")) {
swapsuffix(buf, sizeof buf, file, ".s", ".o");
if (isfresh(file, buf)) {
- extra[1] = buf;
- gencmd(&cmd, &ncmd, as, file, extra, 2);
+ extra[2] = buf;
+ gencmd(&cmd, &ncmd, as, file, extra, 3);
run(cmd);
}
}