-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate code size for RISCV64 build vs AARCH64 #2
Comments
LTO support depends on edk2 support for LTO on RISCV |
-mrelax may be dangerous since gp isn't loaded anywhere (UEFI
|
Okay that assert is unrelated (it's caused by using a ConOut-based DebugLib with a high TPL, separate issue to file). The real issue is due -Os implying -fomit-frame-pointer. After calling CpuExitImage we hit a different assert with this backtrace: #0 0x000000017e177d5e in RiscVCpuPause () ...so basically SetJmp returns 0 after the LongJump in CpuExitImage, and we don't exit, but try to run. This is because LongJumpInternal implementation is broken and it just so happens that with -Os x8 is mostly 0 (at that point). See for fix andreiw/edk2-rv-wip@56871e7. Keeping this open... |
Fix has been upstreamed. |
RISCV64 build is 2x the size of AARCH64 build, when build with comparable options.
The difference almost comes from the -Os compared to the aarch64 parts. The RISC-V parts will have an even smaller code size with the below options enabled.
Also, look into LTO.
The text was updated successfully, but these errors were encountered: