diff options
author | Nathan Ringo <nathan@remexre.com> | 2024-09-01 21:40:34 -0500 |
---|---|---|
committer | Nathan Ringo <nathan@remexre.com> | 2024-09-01 21:40:34 -0500 |
commit | 158b7123b6a50b2e8d37529e01ccd94c9106c11a (patch) | |
tree | 9af446b259b8ac99524843e215513355668908ef /boards | |
parent | 8cb34498eceef231927c444507b6787128c5f0d8 (diff) |
Fix debuginfo and restore apps.
Diffstat (limited to 'boards')
-rw-r--r-- | boards/configure.py | 10 | ||||
-rw-r--r-- | boards/default.nix | 5 |
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 ); |