summaryrefslogtreecommitdiffstats
path: root/src/arch/riscv/Makefile.sbi
diff options
context:
space:
mode:
authorSimon Rettberg2026-01-28 12:53:53 +0100
committerSimon Rettberg2026-01-28 12:53:53 +0100
commit8e82785c584dc13e20f9229decb95bd17bbe9cd1 (patch)
treea8b359e59196be5b2e3862bed189107f4bc9975f /src/arch/riscv/Makefile.sbi
parentMerge branch 'master' into openslx (diff)
parent[prefix] Make unlzma.S compatible with 386 class CPUs (diff)
downloadipxe-openslx.tar.gz
ipxe-openslx.tar.xz
ipxe-openslx.zip
Merge branch 'master' into openslxopenslx
Diffstat (limited to 'src/arch/riscv/Makefile.sbi')
-rw-r--r--src/arch/riscv/Makefile.sbi31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/arch/riscv/Makefile.sbi b/src/arch/riscv/Makefile.sbi
new file mode 100644
index 000000000..5e5dc9a6b
--- /dev/null
+++ b/src/arch/riscv/Makefile.sbi
@@ -0,0 +1,31 @@
+# -*- makefile -*- : Force emacs to use Makefile mode
+
+# Build a position-independent executable, with relocations required
+# only for data values. Runtime relocations are applied by the
+# prefix code.
+#
+CFLAGS += -mcmodel=medany -fpie
+LDFLAGS += -pie --no-dynamic-linker -z combreloc
+
+# Place explicitly zero-initialised variables in the .data section
+# rather than in .bss, so that we can rely on their values even during
+# parsing of the system memory map prior to relocation (and therefore
+# prior to explicit zeroing of the .bss section).
+#
+CFLAGS += -fno-zero-initialized-in-bss
+
+# Linker script
+#
+LDSCRIPT = arch/riscv/scripts/sbi.lds
+
+# Media types
+#
+MEDIA += sbi
+MEDIA += lkrn
+
+# Padded flash device images (e.g. for QEMU's -pflash option)
+#
+NON_AUTO_MEDIA += pf32
+%.pf32 : %.sbi $(MAKEDEPS)
+ $(Q)$(CP) $< $@
+ $(Q)$(TRUNCATE) -s 32M $@