Make building small again (in release mode)

This commit is contained in:
Quinten Kock 2020-12-21 13:39:24 +01:00
parent 75de049cbc
commit b5eaaf9112
2 changed files with 6 additions and 4 deletions

View File

@ -200,8 +200,8 @@ pub fn build(b: *Builder) !void {
// Standard release options allow the person running `zig build` to select
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
// b.setPreferredReleaseMode(std.builtin.Mode.ReleaseSafe);
const mode = b.standardReleaseOptions();
// const mode = b.standardReleaseOptions();
const mode = .ReleaseFast;
const files = try findFiles(ktarget);
@ -241,7 +241,9 @@ pub fn build(b: *Builder) !void {
exe.code_model = std.builtin.CodeModel.kernel;
exe.setLinkerScriptPath(getLinkerScript(ktarget));
// exe.setOutputDir("bin");
// exe.strip = true;
if(mode != .Debug) {
exe.strip = true;
}
// exe.single_threaded = true;
exe.install();

View File

@ -5,7 +5,7 @@ SECTIONS
kernel_phys_offset = 0xffffffff80000000;
. = kernel_phys_offset + 1M;
.stivale2hdr ALIGN(4K) :
.stivale2hdr ALIGN(1K) :
{
KEEP(*(.stivale2hdr))
}