From 48ef95c24e9ac3d11200b61af617a01b10b507d1 Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Fri, 10 Jul 2026 23:20:03 +0800 Subject: build: introduce declarative non-recursive build graph --- usr/Build.mk | 4 ++++ usr/initramfs.S | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 usr/Build.mk create mode 100644 usr/initramfs.S (limited to 'usr') 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 + -- cgit v1.2.3