-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
64-bit big endian PowerPC ABIv2 support #12667
64-bit big endian PowerPC ABIv2 support #12667
Conversation
This updates the asmgen code the same way the runtime assembler was updated in 05d82f9.
This will only work on ABIv2 systems, such as Linux on musl libc and FreeBSD/OpenBSD. Tested on musl libc system and all tests pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified to not cause any regression building and running the compiler testsuite on powerpc64le.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to see that the ELFv2 ABI works equally well in big-endian than in little-endian. Thanks! This is good to go, but the configure script may need to be hardened later to check that the ABI is actually ELFv2.
@@ -1262,6 +1262,8 @@ AS_CASE([$host], | |||
[arch=amd64; system=win64], | |||
[[powerpc64le*-*-linux*]], | |||
[has_native_backend=yes; arch=power; model=ppc64le; system=linux], | |||
[[powerpc64*-*-linux-musl*]], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming that given the history of Musl on Power, this implies that the ELFv2 ABI is used.
I wish config.guess was more explicit about which version of the ABI is used. E.g. on Ubuntu 16.04 PPC (the last Ubuntu to support big-endian PPC, using the ELFv1 ABI), config.guess reports powerpc64-unknown-linux-gnu
, which does not obviously imply that it's ELFv1 and not ELFv2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The v2 ABI requires the preprocessor symbol _CALL_ELF
to be defined with a value of 2
. Some autoconf machinery could check for this and only enable native code on v2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. For the time being, I just added a check on _CALL_ELF in runtime/power.S, to abort in case of ABI mismatch. We'll see later if this needs to be done in configure.
Makes me feel safer about possible misdetection by config.guess and configure.
c638ff8
to
782709f
Compare
Thank you, @awilfox. |
Passes on:
Linux gwyn.foxkit.us 5.15.98-mc4-easy #1 SMP Sun Apr 2 00:16:18 CDT 2023 ppc64 GNU/Linux
Fixes: #12656