summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-07-10 23:20:03 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-07-10 23:20:03 +0800
commit48ef95c24e9ac3d11200b61af617a01b10b507d1 (patch)
tree57f0e26ab98e795b19839b6eece98ca58a4b702d /usr
parentb9ff206e6bd3f4d67851263a6f2acb5f575cf3b0 (diff)
downloadlume-48ef95c24e9ac3d11200b61af617a01b10b507d1.tar.gz
lume-48ef95c24e9ac3d11200b61af617a01b10b507d1.tar.xz
build: introduce declarative non-recursive build graph
Diffstat (limited to 'usr')
-rw-r--r--usr/Build.mk4
-rw-r--r--usr/initramfs.S17
2 files changed, 21 insertions, 0 deletions
diff --git a/usr/Build.mk b/usr/Build.mk
new file mode 100644
index 0000000..f734640
--- /dev/null
+++ b/usr/Build.mk
@@ -0,0 +1,4 @@
+targets += host/gen_init_cpio
+target.host/gen_init_cpio.kind := host-tool
+target.host/gen_init_cpio.sources := usr/gen_init_cpio.c
+target.host/gen_init_cpio.host-cflags := -Wno-sign-compare
diff --git a/usr/initramfs.S b/usr/initramfs.S
new file mode 100644
index 0000000..fa21553
--- /dev/null
+++ b/usr/initramfs.S
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+/*
+ * Embed the generated CPIO through the target assembler instead of converting
+ * it with `objcopy -I binary`. The resulting object inherits the target ABI
+ * attributes (notably RISC-V float ABI flags), which keeps both GNU ld and LLD
+ * strict-linking compatible.
+ */
+
+#ifndef INITRAMFS_IMAGE
+#error "INITRAMFS_IMAGE must name the generated CPIO archive"
+#endif
+
+ .section .init.ramfs, "a", @progbits
+ .balign 8
+ .incbin INITRAMFS_IMAGE
+