-
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
powerpc-unknown-linux-gnuspe illegal instruction #96394
Comments
What cpu are you trying to run it on? I suspect your cpu doesn't support an atomic instruction LLVM emits. |
@bjorn3 its P1010 |
It seems to be running an e500 cpu core produced by nxp which according to the reference manual supports atonic instructions. Could you use the disassemble command in gdb to show the exact crashing instruction? As for disabling atomic usage you need to change the target spec or provide a custom one in json format. Also note that any library that depends on atomics will not compile in that case. We don't emulate them using a lock if they are unavailable. |
@bjorn3 Program received signal SIGILL, Illegal instruction. |
Looks like the e500 cpu doesn't support lwsync and needs the sync instruction instead. Does it work if you use |
I have a similar problem (or maybe the same?), but the disassembly seems to differ (I haven't used gdb much, so I'm not entirely sure I understand how to read it). I'm on a Synology DS213+ NAS with a FREESCALE QorIQ P1022 CPU (ppc e500 variant iirc). gdb output
|
It is possible the gdb version you are using doesn't know how to disassemble lwsync. I don't know exactly what the encoded version of it is though. |
Seems likely. I have GNU gdb (GDB) 8.0.1, which is the latest version available in the package manager (using optware-ng), but apparently quite old. |
@bjorn3 |
I tried building with |
@bjorn3 |
@mortenlj congratulations |
@bjorn3 I tested under target, "-Ctarget-cpu=e500" works. |
Having the exact same problem, |
I build the tier 3 support first, using the synology toolchain (downloadable from some synology support site) You can see the buildscript here (using Earthly): |
@mortenlj thnx for the hint!
I'm a SynoCommunity maintainer and we're using spksrc framework to build Synology compatible packages. In turns it does use the various synology toolchain matching arch & version.
First time I hear about it and will certainly have a look. But I wonder, do you hapen to have traces or logs of what it actually does behind the scene that I could manually reproduce to integrate into the framework. Later on I could potentially look into migrating things to earthly... I mean, I was able to build stage1, stage2 working out also but it fails at building the toolchain later on. |
Earthly is mostly just Docker on steroids, there is nothing magical happening behind the scenes. If you follow the imports at the top, you get the definitions of the various |
Hi all, I know this thread is closed and I did opened-up a distinct one but I can't get to build a working powerpc gnuspe toolchain. It does build succesfully but the resulting library includes My configuration is as follow:
And the build call is this:
Help would be really much appreciated. |
…gjubilee rustc_target: Add msync target feature and enable it on powerpcspe targets Some older PowerPC processors do not have the `sync` (`sync 0`) and `lwsync` (`sync 1`) instructions, but instead have the `msync` instruction. (IIRC `msync` and `sync` will be assembled into the same bit-pattern, but `lwsync` will be SIGILL. See also https://gcc.gnu.org/legacy-ml/gcc-patches/2006-11/msg01238.html.) LLVM recognizes this as the [`msync` feature](https://github.com/llvm/llvm-project/blob/cc5d8a4b2fc765c3c432f1ad0b185dae518d41bd/llvm/lib/Target/PowerPC/PPC.td#L140) and enables for some cpus such as [e500](https://github.com/llvm/llvm-project/blob/cc5d8a4b2fc765c3c432f1ad0b185dae518d41bd/llvm/lib/Target/PowerPC/PPC.td#L644). powerpcspe is a target for CPUs such as e500 ([Debian Wiki](https://wiki.debian.org/PowerPCSPEPort)). However, the `msync` feature is currently not enabled except for vxworks, and at least since 2022-04, powerpc-unknown-linux-gnuspe was known to not work on real hardware without `-C target-cpu` (e.g., rust-lang#96394, rust-lang#117361). https://github.com/rust-lang/rust/blob/8c392966a013fd8a09e6b78b3c8d6e442bc278e1/compiler/rustc_target/src/spec/targets/powerpc_wrs_vxworks_spe.rs#L28 Fixes rust-lang#117361 cc `@BKPepe` ([powerpc-unknown-linux-muslspe target maintainer](https://doc.rust-lang.org/nightly/rustc/platform-support/powerpc-unknown-linux-muslspe.html#target-maintainers)) cc `@glaubitz` (who added powerpc-unknown-linux-gnuspe in rust-lang#48484) cc `@th0ma7` (who opened rust-lang#117361) r? workingjubilee `@rustbot` label +O-PowerPC +A-target-feature
Rollup merge of rust-lang#137860 - taiki-e:powerpcspe-msync, r=workingjubilee rustc_target: Add msync target feature and enable it on powerpcspe targets Some older PowerPC processors do not have the `sync` (`sync 0`) and `lwsync` (`sync 1`) instructions, but instead have the `msync` instruction. (IIRC `msync` and `sync` will be assembled into the same bit-pattern, but `lwsync` will be SIGILL. See also https://gcc.gnu.org/legacy-ml/gcc-patches/2006-11/msg01238.html.) LLVM recognizes this as the [`msync` feature](https://github.com/llvm/llvm-project/blob/cc5d8a4b2fc765c3c432f1ad0b185dae518d41bd/llvm/lib/Target/PowerPC/PPC.td#L140) and enables for some cpus such as [e500](https://github.com/llvm/llvm-project/blob/cc5d8a4b2fc765c3c432f1ad0b185dae518d41bd/llvm/lib/Target/PowerPC/PPC.td#L644). powerpcspe is a target for CPUs such as e500 ([Debian Wiki](https://wiki.debian.org/PowerPCSPEPort)). However, the `msync` feature is currently not enabled except for vxworks, and at least since 2022-04, powerpc-unknown-linux-gnuspe was known to not work on real hardware without `-C target-cpu` (e.g., rust-lang#96394, rust-lang#117361). https://github.com/rust-lang/rust/blob/8c392966a013fd8a09e6b78b3c8d6e442bc278e1/compiler/rustc_target/src/spec/targets/powerpc_wrs_vxworks_spe.rs#L28 Fixes rust-lang#117361 cc `@BKPepe` ([powerpc-unknown-linux-muslspe target maintainer](https://doc.rust-lang.org/nightly/rustc/platform-support/powerpc-unknown-linux-muslspe.html#target-maintainers)) cc `@glaubitz` (who added powerpc-unknown-linux-gnuspe in rust-lang#48484) cc `@th0ma7` (who opened rust-lang#117361) r? workingjubilee `@rustbot` label +O-PowerPC +A-target-feature
@alexcrichton
I use following command to build std for powerpc gnuspe,
cargo build -Z build-std --target=powerpc-unknown-linux-gnuspe
and run under target, crash is as following,
Program received signal SIGILL, Illegal instruction.
0x204f2610 in core::sync::atomic::atomic_compare_exchange::hdd78233f59efc1d2 ()
at /usr/share/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:2643
2643 /usr/share/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/sync/atomic.rs: No such file or directory.
in /usr/share/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/sync/atomic.rs
(gdb) quit
please help
thanks
The text was updated successfully, but these errors were encountered: