Make.defaults: disable LSX/LASX for loongarch64 EFI code#99
Open
MarsDoge wants to merge 1 commit into
Open
Conversation
UEFI applications should not rely on LoongArch SIMD state being available or preserved by firmware. When gnu-efi is built with toolchain defaults that enable LSX or LASX, libefi.a can contain SIMD instructions. One observed case is RtCompareGuid from libefi.a:efirtlib.o being compiled with LSX instructions such as vld, vsub.w, vbsrl.v, vor.v and vpickve2gr.w. EFI applications linking against libefi.a then inherit those instructions even if they disable SIMD in their own build flags. Add -mno-lsx and -mno-lasx for loongarch64 builds to keep the gnu-efi runtime libraries compatible with baseline LoongArch64 firmware environments. Reported-by: Zixuan Lu <luzixuan@loongson.cn> Co-authored-by: Xiaotian Wu <wuxiaotian@loongson.cn> Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>
elysia-best
added a commit
to multiarchstore/refind
that referenced
this pull request
May 9, 2026
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This prevents LoongArch64 gnu-efi libraries from carrying LSX/LASX SIMD
instructions into EFI applications.
I found this while building fwupd-efi on LoongArch64. fwupd-efi already adds
-mno-lsx and -mno-lasx for its own objects but the final fwup.so still
contained LSX instructions because RtCompareGuid was linked from gnu-efi:
UEFI applications should not rely on LoongArch SIMD state being available
or preserved by firmware. When gnu-efi is built with toolchain defaults
that enable LSX or LASX, libefi.a can contain SIMD instructions.
One observed case is RtCompareGuid from libefi.a:efirtlib.o being compiled
with LSX instructions such as vld, vsub.w, vbsrl.v, vor.v and
vpickve2gr.w. EFI applications linking against libefi.a then inherit those
instructions even if they disable SIMD in their own build flags.
Add -mno-lsx and -mno-lasx for loongarch64 builds to keep the gnu-efi
runtime libraries compatible with baseline LoongArch64 firmware
environments.
Reported-by: Zixuan Lu luzixuan@loongson.cn
Co-authored-by: Xiaotian Wu wuxiaotian@loongson.cn
Signed-off-by: Dongyan Qian qiandongyan@loongson.cn