Open ggj-1213 opened 6 months ago
Maybe it's a problem with llvm. I also create an issue in the llvm project.
@ggj-1213 Does the problem remain if you use -Zbuild-std
to rebuild the stdlib?
@ggj-1213 Does the problem remain if you use
-Zbuild-std
to rebuild the stdlib?
I build it using the following command, I have used the -Z build-std=core option.
cargo +nightly build -Z build-std=core --target aarch64-unknown-uefi -v --release
You mean build it with:
cargo +nightly build -Z build-std --target aarch64-unknown-uefi -v --release
I used this command to build it. The result is the same.
Ah, thank you for the information.
@ggj-1213 Was this fixed?
I'm going to reopen this issue because AFAICT there's no indication it was fixed. If it was actually fixed, please do share how you resolved it and then we can close it knowing that it was fixed. Even if this is an upstream LLVM bug, we'd still want to track it.
I'm going to reopen this issue because AFAICT there's no indication it was fixed. If it was actually fixed, please do share how you resolved it and then we can close it knowing that it was fixed. Even if this is an upstream LLVM bug, we'd still want to track it.
When I use options "-Z branch-protection=bti,pac-ret", issue disappeared. For comparison, the options I used before were "-C target-feature=+bti“ and ”-Z branch-protection=pac-ret". So, I'm guessing which of the two options may not be in effect when combined. I haven't tested this in depth.
Ah, I see.
When using aarch64-unknown-uefi to build the release version of the efi file, some bti instructions are removed, but there are still indirect jumps to the location of the removed bti instructions, such as'BLR X8'.
I tried this code:
.cargo/config.toml
Cargo.toml
and i build it :
rustc --version --verbose
:when I run uefi on board, BTI FAULT occurs:
When I disassembled the efi file, I found that there was no BTI instruction in place of the malfunctioning function.
The indirect jump function is as follows. I don't remember which BLR X8 instruction jumps to the function above.