[build] Add build knowledge of dynamic libraries

Bonnibel will now build dynamic libraries when they're dependencies for
non-statically linked modules. It will also copy those shared libraries
into the initrd image for programs being copied into the image.
This commit is contained in:
Justin C. Miller
2023-08-26 19:06:18 -07:00
parent c4bb60299e
commit eda816ad90
15 changed files with 122 additions and 62 deletions

View File

@@ -1,8 +1,9 @@
# vim: ft=python
ldso = module("ld.so",
kind = "shared",
output = "ld.so",
kind = "lib",
static = True,
basename = "ld",
targets = [ "user" ],
deps = [ "libc", "util", "elf" ],
description = "Dynamic Linker",
@@ -12,4 +13,4 @@ ldso = module("ld.so",
"start.s",
])
ldso.variables["ldflags"] = ["${ldflags}", "--entry=_ldso_start"]
ldso.variables["ldflags"] = ["${ldflags}", "--entry=_ldso_start"]

View File

@@ -3,6 +3,7 @@
init = module("srv.init",
targets = [ "init" ],
deps = [ "libc", "elf", "bootproto", "zstd" ],
static = True,
description = "Init server",
ld_script = "init.ld",
sources = [