-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
SIGILL Illegal Instruction on PPC64 #110278
Comments
One relevant piece is the crosstool-ng config for C and C++, which should be POWER4 but tuned for POWER6. Lines 364 to 365 in e4dae0d
rust/src/ci/docker/host-x86_64/dist-powerpc64-linux/powerpc64-linux-gnu.config Lines 138 to 139 in e4dae0d
Then for Rust code, the target is set for "ppc64", which looks pretty much the same as "pwr4".
https://github.com/rust-lang/llvm-project/blob/585a6eb3ebf7c40fd7c1b23e3ece557b3cc2aa36/llvm/lib/Target/PowerPC/PPC.td#L657-L662 https://github.com/rust-lang/llvm-project/blob/585a6eb3ebf7c40fd7c1b23e3ece557b3cc2aa36/llvm/lib/Target/PowerPC/PPC.td#L616-L619 |
Can you run under gdb, and use the command Do any older versions work? It would help if we can narrow anything that changed. |
Thanks for the help! Unsure if any version ever worked on this combo, came across this as a dependency build failure for a Python module but can reproduce on both IBM POWER5 and Apple G5 machines FWIW. The PowerPC (32b) binary works ok these same machines. Offending instruction looks to be a Backtrace:
|
That uses an even older CPU baseline since #41080.
That's Vector Logical XOR, an AltiVec instruction. I can see that instruction in binaries all the way back to Rust 1.8, the first that shipped for this target at all, so at least this seems not to be a regression.
I think those should have AltiVec, but I'm not sure. Does Debian's own |
Yes I had to use an even older target build to simply build this Python dependency... unfortunately the Debian package is similarly broken, which led me to trying the official rust distribution. Can only guess this was never tested on actual hardware shrugs |
Can I please know what the source is for this idea vxor exists in AltiVec on POWER5? It does not appear in any IBM reference material that I can find, maybe that tuning for power6 has broken power4 compatibility? |
I was looking at https://en.wikipedia.org/wiki/Power_ISA#Power_ISA_v.2.03 which includes AltiVec, and lists the 970 (aka G5) and POWER5 as being compliant. There's an archive link to the spec too, with
I think that's only relevant to C and C++ components, while you're seeing this in pure Rust code. Sorry for the red herring. |
That's the instruction set reference, only certain manufacturers like NXP implemented it AFAIK(?) but it might also be on the PS3 and iBooks etc (due graphics) The IBM reference omits mention of this instruction, suggesting it does not feature on the POWER5+ (gs). I would not assume vxor exists unless specifically mentioned in the manufacturer's assembly reference manual (and it is not). |
Ok, well I don't know. This is coming from LLVM codegen, which has included |
Just thinking aloud, you probably know more than me, and thanks again for looking! The Power ISA docs is the complete list of instructions, was under the impression embedded and server platforms omit some. Interesting to note GCC does not appear to offer accelerated calls that output the AltiVec XOR opcode for the same build target? Can only assume there's some reason for that (shrugs again) |
GCC lists |
Ah thanks, I stand corrected! Will keep digging around here, Debian also broke their kernel package on this machine :-| |
Hi all, need to bump this issue, the presence of this xvor instruction in the cargo and rustup-init binaries for powerpc64 is AFAIK limiting compatibility to only Apple hardware, more recent IBM POWER hardware (eg the POWER5 9406-520) is throwing this SIGILL. POWER6-7 or newer I would expect to work, but that means skipping a whole POWER generation(?) Can the installer be built without such AltiVec optimisations, to improve compatibility (like how x86-64 targets a basic flag set)? |
For some context, that model lists Marketing Withdrawn on 2008-07-08 and Service Discontinued on 2019-01-31. But we also did allow very old 32-bit powerpc in #41080, so there's some precedent. Nominating for discussion -- does the compiler team want to support older powerpc64 (big-endian) hardware? @rustbot label +I-compiler-nominated |
As far as I know, the aforementioned OS (Debian Linux) does not support ppc64 in recent releases, but rather supports ppc64le. It does support powerpc (32-bit), and POWER5 machines can generally run 32-bit powerpc binaries because the architectures treat bit-width as a mode of a single CPU ISA, unlike, say, aarch64, which treats 64-bit instructions as an entirely different ISA. I believe Adélie Linux, one of the rare Linux distros which explicitly supports Power ISA in big-endian mode, does in fact assume Altivec support in their builds. |
It seems to be in Debian ports: https://wiki.debian.org/PPC64 |
I suppose it comes down to your definition of "support", then. Regarding the PowerMac G5, it should have the Altivec instructions. Because of the conflicting reports in this thread regarding whether it is compatible or not, I am going to obtain a G5 to verify its compatibility myself and remove all doubt. |
Thanks, this sans-AltiVec IBM (9406-520) hardware is old/uncommon for sure, I guess I'll look into cross building and removing -mabi=altivec or similar too. Grateful for any clarification! |
Building a fork which changes the
|
Discussed yesterday in T-compiler meeting (on Zulip). Agreed that we need to discuss this topic once more to be able to make a call. Leaving this issue nominated for now. |
Thanks for looking into this! I re-tested on an Apple Xserve G5 yesterday (w/AltiVec) and found no issues, sorry for the confusion, I think it can be narrowed down to this IBM hardware (9406-520 and similar POWER5 machines) |
Discusses in T-compiler meeting (on Zulip). There is a bit of unclarity on how to proceed, we're also not sure about the actual user base. One concrete proposal was perhaps to split this support target and add a new Tier 3 support target for this architecture (POWER5) that is currently not compiling under our PPC64 target. Seems a good task for a contribution. For context, our tier support targets list. @rustbot label -I-compiler-nominated |
Unable to install rust on Debian Bookworm PPC64 (POWER5+)
Meta
rustc --version --verbose
:When running cargo from rust 1.68.2-powerpc64-unknown-linux-gnu (downloaded from the rust website), I get the following backtrace
Backtrace
The text was updated successfully, but these errors were encountered: