summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames T. Lee <james@james.tl>2020-03-07 18:05:34 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-03-26 14:31:21 +0100
commitfb95466dc8ddfeb49986ee09734230f3af7d7bb6 (patch)
treec80e63d0133e6484f4df4c49c4c4dd727675f49a
parentf8dd0f2f15a566ede668c59e3c810c61f9d62c51 (diff)
downloadsystemd-fb95466dc8ddfeb49986ee09734230f3af7d7bb6.tar.gz
boot: Ensure ARM UEFI binary does not contain FP/SIMD instructions
ARM toolchains will sometimes optimize otherwise floating-point-free code with floating point and SIMD instructions. This was happening with systemd-bootarm.efi and it was causing U-Boot to crash and reset the CPU. U-Boot does not support the ARM VFP floating point coprocessor, which is an optional piece of hardware anyway [1]. Ensure the compiler does not generate FP/SIMD instructions by supplying the `-mgeneral-regs-only` option when building for ARM [2]. The other option you often see to solve these problems is `-msoft-float`, but that changes the ABI and prevents linking with libgnuefi. [1] https://lists.denx.de/pipermail/u-boot/2011-February/087736.html [2] https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html#index-mgeneral-regs-only-1 (cherry picked from commit 1ad6056239b70ce69ea70108cf4e49a05a9c2a1d) (cherry picked from commit 73678d2307042a45ceb3d7fe2fd182f6f6ec3f2d) (cherry picked from commit 869614a5515fd21c7c639cdbf5d96889f4316463)
-rw-r--r--src/boot/efi/meson.build2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build
index c1fe04597b..ed81cefcd5 100644
--- a/src/boot/efi/meson.build
+++ b/src/boot/efi/meson.build
@@ -155,6 +155,8 @@ if have_gnu_efi
elif efi_arch == 'ia32'
compile_args += ['-mno-sse',
'-mno-mmx']
+ elif efi_arch == 'arm'
+ compile_args += ['-mgeneral-regs-only']
endif
if get_option('werror') == true
compile_args += ['-Werror']