[bonnibel] Allow modules to list ld scripts in definition
Previously, to add a custom linker script, a module would need to modify its variables after the fact to add to ldflags. Now module constructors take a new keyword `ld_script` and handle the ldflags and dependencies properly.
This commit is contained in:
@@ -7,6 +7,7 @@ kernel = module("kernel",
|
||||
targets = [ "kernel" ],
|
||||
description = "jsix kernel",
|
||||
deps = [ "util", "cpu", "bootproto", "j6" ],
|
||||
ld_script = "kernel.ld",
|
||||
sources = [
|
||||
"apic.cpp",
|
||||
"assert.cpp",
|
||||
@@ -83,5 +84,3 @@ kernel.add_depends([
|
||||
"syscalls.inc.cog",
|
||||
"syscall_verify.cpp.cog",
|
||||
], definitions)
|
||||
|
||||
kernel.variables['ldflags'] = ["${ldflags}", "-T", "${source_root}/src/kernel/kernel.ld"]
|
||||
|
||||
@@ -6,6 +6,7 @@ panic = module("panic.serial",
|
||||
deps = [ "util", "elf", "kernel" ],
|
||||
includes = [ ".." ],
|
||||
description = "Serial panic handler",
|
||||
ld_script = "panic.serial.ld",
|
||||
sources = [
|
||||
"display.cpp",
|
||||
"entry.s",
|
||||
@@ -14,5 +15,3 @@ panic = module("panic.serial",
|
||||
"symbol_table.cpp",
|
||||
"../printf/printf.c",
|
||||
])
|
||||
|
||||
panic.variables['ldflags'] = ["${ldflags}", "-T", "${source_root}/src/kernel/panic.serial/panic.serial.ld"]
|
||||
|
||||
Reference in New Issue
Block a user