summaryrefslogtreecommitdiff
path: root/boards
diff options
context:
space:
mode:
Diffstat (limited to 'boards')
-rw-r--r--boards/configure.py10
-rw-r--r--boards/default.nix5
2 files changed, 12 insertions, 3 deletions
diff --git a/boards/configure.py b/boards/configure.py
index 5b01652..cbe255a 100644
--- a/boards/configure.py
+++ b/boards/configure.py
@@ -25,12 +25,14 @@ def main():
ninja = Ninja(f)
# Inherit some environment variables.
- for var in ["AS", "ASFLAGS", "LD", "LDFLAGS"]:
+ for var in ["AS", "ASFLAGS", "LD", "LDFLAGS", "STRIP"]:
ninja.variable(var, getenv(var))
# Add rules to assemble and link.
ninja.rule("as", "$AS $ASFLAGS -g -o $out $in")
ninja.rule("ld", f"$LD $LDFLAGS -T{linker_script} -o $out $in")
+ ninja.rule("strip", f"$STRIP -o $out $in")
+ ninja.rule("strip-onlysyms", f"$STRIP --only-keep-debug -o $out $in")
for path in srcdir.iterdir():
if path.suffix != ".s":
@@ -38,7 +40,11 @@ def main():
obj = str(objdir / f"{path.stem}.o")
ninja.build(obj, "as", str(path))
objs.append(obj)
- ninja.build("kernel.elf", "ld", objs + [str(libkernel)])
+ ninja.build("vernos_kernel_unstripped.elf", "ld", objs + [str(libkernel)])
+ ninja.build("vernos_kernel.elf", "strip", "vernos_kernel_unstripped.elf")
+ ninja.build(
+ "vernos_kernel.sym", "strip-onlysyms", "vernos_kernel_unstripped.elf"
+ )
if __name__ == "__main__":
diff --git a/boards/default.nix b/boards/default.nix
index 6c8c8a9..de0eb34 100644
--- a/boards/default.nix
+++ b/boards/default.nix
@@ -40,12 +40,15 @@ let
'';
installPhase = ''
runHook preInstall
- install -Dt $out kernel.elf
+ install -m0755 -Dt $out vernos_kernel.elf
+ install -m0644 -Dt $out vernos_kernel.sym
runHook postInstall
'';
+ dontFixup = true;
AS = "${arch.crossSystem}-as";
LD = "${arch.crossSystem}-ld";
+ STRIP = "${arch.crossSystem}-strip";
}
// args
);