aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2024-09-24 19:15:11 +0100
committerMichael Brown <mcb30@ipxe.org>2024-09-24 19:17:34 +0100
commit8844a3d5464c4632a1374cbb9304aeea61d0166f (patch)
treec6303d54a2071d792dbf35ddb61b6c4a3475a6c0
parente0282688c1d9795a1400718b8c9e3f468530ae97 (diff)
downloadipxe-master.zip
ipxe-master.tar.gz
ipxe-master.tar.bz2
[arm] Support building as a Linux userspace binary for AArch32HEADmaster
Add support for building as a Linux userspace binary for AArch32. This allows the self-test suite to be more easily run for the 32-bit ARM code. For example: make CROSS=arm-linux-gnu- bin-arm32-linux/tests.linux qemu-arm -L /usr/arm-linux-gnu/sys-root/ \ ./bin-arm32-linux/tests.linux Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r--src/arch/arm32/Makefile.linux25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/arch/arm32/Makefile.linux b/src/arch/arm32/Makefile.linux
new file mode 100644
index 0000000..289118f
--- /dev/null
+++ b/src/arch/arm32/Makefile.linux
@@ -0,0 +1,25 @@
+# -*- makefile -*- : Force emacs to use Makefile mode
+
+# The number of different ABIs for 32-bit ARM is insane. It is
+# unclear whether or not unaligned accesses ought to work in a 32-bit
+# Linux userspace binary. When running in QEMU, unaligned accesses
+# result in a SIGBUS. Since this is likely to be the most common use
+# case (for running self-tests on an x86 build machine), and since we
+# don't particularly care about performance for Linux userspace
+# binaries, force the compiler to never generate an unaligned access.
+#
+CFLAGS += -mno-unaligned-access
+
+# Inhibit the harmless warning about wchar_t size mismatch between the
+# linux_api.o helper object and the rest of iPXE.
+#
+LINUX_CFLAGS += -Wl,--no-wchar-size-warning
+
+# Starting virtual address
+#
+LDFLAGS += -Ttext=0x10000
+
+# Include generic Linux Makefile
+#
+MAKEDEPS += arch/arm/Makefile.linux
+include arch/arm/Makefile.linux