Skip to content
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

Merge 4520b478d2512b0f39764e0464dcb4cb961845b5 into 18.x #81084

Closed
brad0 opened this issue Feb 8, 2024 · 2 comments
Closed

Merge 4520b478d2512b0f39764e0464dcb4cb961845b5 into 18.x #81084

brad0 opened this issue Feb 8, 2024 · 2 comments
Labels
cmake Build system in general and CMake in particular libunwind release:backport

Comments

@brad0
Copy link
Contributor

brad0 commented Feb 8, 2024

MIPS/libunwind: Use -mfp64 if compiler is FPXX (#68521)

Libunwind supports FP64 and FP32 modes, but not FPXX. The reason is
that, FP64 and FP32 have different way to save/restore FPRs. If
libunwind is built as FPXX, we have no idea which one should we use.

It's not due to the code bug, but rather the nature of FPXX.
FPXX is an ABI which uses only a common subset of FR=1(FP64) and FR=0
(FP32).
So that FPXX binaries can link with both FP64 and FP32 ones, aka.
FPXX + FP32 -> FP32
FPXX + FP64 -> FP64

While for libunwind, we should save/restore all of FPRs. If we use FPXX,
we can only save/restore a common subset of FPRs, instead of superset.

If libunwind is built as FP64, it will interoperatable with FPXX/FP64
APPs, and if it is built as FP32, it will interoperatable with
FP32/FPXX. Currently most of O32 APPs are FPXX or FP64, while few are
FP32.

So if the compiler is FPXX, which is the default value of most
toolchain, let's switch it to FP64.

@brad0
Copy link
Contributor Author

brad0 commented Feb 8, 2024

/cherry-pick 4520b47

@llvmbot
Copy link
Member

llvmbot commented Feb 8, 2024

/pull-request #81085

@EugeneZelenko EugeneZelenko added cmake Build system in general and CMake in particular libunwind release:backport and removed new issue labels Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmake Build system in general and CMake in particular libunwind release:backport
Projects
Development

No branches or pull requests

3 participants