Move linker script

This commit is contained in:
Sam Tebbs 2020-06-02 18:41:54 +01:00
parent 72269c28cc
commit cec5d3c68d
2 changed files with 6 additions and 4 deletions

View file

@ -31,7 +31,8 @@ pub fn build(b: *Builder) !void {
b.default_step.dependOn(&fmt_step.step);
const main_src = "src/kernel/kmain.zig";
const constants_path = try fs.path.join(b.allocator, &[_][]const u8{ "src/kernel/arch", arch, "constants.zig" });
const arch_root = "src/kernel/arch";
const constants_path = try fs.path.join(b.allocator, &[_][]const u8{ arch_root, arch, "constants.zig" });
const build_mode = b.standardReleaseOptions();
const rt_test = b.option(bool, "rt-test", "enable/disable runtime testing") orelse false;
@ -41,7 +42,8 @@ pub fn build(b: *Builder) !void {
exec.setOutputDir(b.cache_root);
exec.addBuildOption(bool, "rt_test", rt_test);
exec.setBuildMode(build_mode);
exec.setLinkerScriptPath("link.ld");
const linker_script_path = try fs.path.join(b.allocator, &[_][]const u8{ arch_root, arch, "link.ld" });
exec.setLinkerScriptPath(linker_script_path);
exec.setTarget(target);
const output_iso = try fs.path.join(b.allocator, &[_][]const u8{ b.exe_dir, "pluto.iso" });

View file

@ -36,8 +36,8 @@ SECTIONS {
.bss.stack ALIGN(4K) : AT (ADDR(.bss.stack) - KERNEL_ADDR_OFFSET) {
KEEP(*(.bss.stack))
KERNEL_STACK_END = .;
}
KERNEL_STACK_END = .;
}
KERNEL_VADDR_END = .;
KERNEL_PHYSADDR_END = . - KERNEL_ADDR_OFFSET;