]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
loongarch64: disable simd when build efi
authorXiaotian Wu <wuxiaotian@loongson.cn>
Wed, 27 Dec 2023 08:25:22 +0000 (16:25 +0800)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 7 Mar 2024 10:14:30 +0000 (19:14 +0900)
LoongArch does not yet support the `-mgeneral-regs-only` option, so when
compiling for EFI, we need to use the `-mno-lsx` and `-mno-lasx` options
to disable SIMD instructions.

src/boot/efi/meson.build

index 6194099fe401df365745773bc9ddb40cb2f709d9..483e0ade0ce549815b50f16c181f48786c139426 100644 (file)
@@ -210,11 +210,13 @@ if cc.get_id() == 'clang'
 endif
 
 efi_arch_c_args = {
-        'aarch64' : ['-mgeneral-regs-only'],
-        'arm'     : ['-mgeneral-regs-only'],
+        'aarch64'     : ['-mgeneral-regs-only'],
+        'arm'         : ['-mgeneral-regs-only'],
+       # Until -mgeneral-regs-only is supported in LoongArch, use the following option instead:
+        'loongarch64' : ['-mno-lsx', '-mno-lasx'],
         # Pass -m64/32 explicitly to make building on x32 work.
-        'x86_64'  : ['-m64', '-march=x86-64', '-mno-red-zone', '-mgeneral-regs-only'],
-        'x86'     : ['-m32', '-march=i686', '-mgeneral-regs-only', '-malign-double'],
+        'x86_64'      : ['-m64', '-march=x86-64', '-mno-red-zone', '-mgeneral-regs-only'],
+        'x86'         : ['-m32', '-march=i686', '-mgeneral-regs-only', '-malign-double'],
 }
 efi_arch_c_ld_args = {
         # libgcc is not compiled with -fshort-wchar, but it does not use it anyways,