rustc and cargo both crash with "Illegal instruction" on this version of rust-bin. Rolling back to 1.76.0 results in a working install. Reproducible: Always Steps to Reproduce: 1. emerge -1 =dev-lang/rust-bin-1.77.1 2. rustc --version Actual Results: "Illegal instruction" and exits Expected Results: rustc runs normally # lscpu Architecture: sparc64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Big Endian CPU(s): 1 On-line CPU(s) list: 0 Model name: TI UltraSparc IIi (Sabre) Thread(s) per core: 1 Core(s) per socket: 1 Socket(s): 1 Flags: sun4u Caches (sum of all): L1d: 16 KiB (1 instance) L1i: 16 KiB (1 instance) L2: 2 MiB (1 instance)
arthur, did you build it with default *FLAGS? I made that error before (not doing that).
Created attachment 894356 [details] emerge --info
(In reply to Sam James from comment #1) > arthur, did you build it with default *FLAGS? I made that error before (not > doing that). I don't know, sorry. I've just ran this command in "arthurzam-sparc64-stable" container on catbus: > USE="dist system-bootstrap" emerge --autounmask=y --autounmask-continue=y -v1 ~dev-lang/rust-1.77.1 ~virtual/rust-1.77.1
Can you please check with gdb what instruction it is crashing on? That will at least let us figure out what target level it was incorrectly built for. It works fine on my T4, for example: # rustc --version rustc 1.77.1 (7cf61ebde 2024-03-27) (gentoo) # eselect rust list Available Rust versions: [1] rust-bin-1.77.1 *
This is what I think you're asking for, but I don't know a ton about Sparc assembly: (gdb) r --version Starting program: /usr/bin/rustc --version [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Program received signal SIGILL, Illegal instruction. 0xfffff80107f4f6fc in __sparc_get_pc_thunk.l7 () from /usr/lib/rust/lib/libstd-1cf51602b88a03e8.so (gdb) disassemble ... 0xfffff80107f4f6e8 <+168>: sub %g1, %o0, %g1 0xfffff80107f4f6ec <+172>: srax %g1, 3, %g2 0xfffff80107f4f6f0 <+176>: srlx %g1, 0x3f, %o1 0xfffff80107f4f6f4 <+180>: add %o1, %g2, %o1 0xfffff80107f4f6f8 <+184>: srax %o1, 1, %o1 => 0xfffff80107f4f6fc <+188>: cxbe %o1, 0, 0xfffff80107f4f71c <__sparc_get_pc_thunk.l7+220> 0xfffff80107f4f700 <+192>: sethi %hi(0x6400), %g1 0xfffff80107f4f704 <+196>: xor %g1, 0x2b0, %g1 0xfffff80107f4f708 <+200>: ldx [ %l7 + %g1 ], %l7 0xfffff80107f4f70c <+204>: cxbe %l7, 0, 0xfffff80107f4f71c <__sparc_get_pc_thunk.l7+220>
(In reply to Arthur Zamarin from comment #3) > (In reply to Sam James from comment #1) > > arthur, did you build it with default *FLAGS? I made that error before (not > > doing that). > > I don't know, sorry. I've just ran this command in > "arthurzam-sparc64-stable" container on catbus: > > > USE="dist system-bootstrap" emerge --autounmask=y --autounmask-continue=y -v1 ~dev-lang/rust-1.77.1 ~virtual/rust-1.77.1 That container has: COMMON_FLAGS="-O2 -mcpu=niagara4 -pipe" So it needs to be rebuilt without that.
(In reply to Sam James from comment #6) > (In reply to Arthur Zamarin from comment #3) > > (In reply to Sam James from comment #1) > > > arthur, did you build it with default *FLAGS? I made that error before (not > > > doing that). > > > > I don't know, sorry. I've just ran this command in > > "arthurzam-sparc64-stable" container on catbus: > > > > > USE="dist system-bootstrap" emerge --autounmask=y --autounmask-continue=y -v1 ~dev-lang/rust-1.77.1 ~virtual/rust-1.77.1 > > That container has: COMMON_FLAGS="-O2 -mcpu=niagara4 -pipe" > > So it needs to be rebuilt without that. I do believe you need to make sure that it does have at least -mcpu=ultrasparc which is what our stage3s use because otherwise it defaults to v7 or something stupid.
I'll build fixed tarball for 1.78.0 for sparc, not sure what is best for 1.77.1 - maybe remove the sparc tarball, or should I rebuild it?
(In reply to Arthur Zamarin from comment #8) > I'll build fixed tarball for 1.78.0 for sparc, not sure what is best for > 1.77.1 - maybe remove the sparc tarball, or should I rebuild it? You can drop it and de-keyword once 1.78.0 tarball is up, no sweat.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1128c70592a612f9dc66d32665289efbe799a699 commit 1128c70592a612f9dc66d32665289efbe799a699 Author: Arthur Zamarin <arthurzam@gentoo.org> AuthorDate: 2024-06-01 18:48:40 +0000 Commit: Arthur Zamarin <arthurzam@gentoo.org> CommitDate: 2024-06-01 18:50:12 +0000 dev-lang/rust-bin: add tarball for sparc & mips Bug: https://bugs.gentoo.org/932734 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org> dev-lang/rust-bin/Manifest | 5 +++++ dev-lang/rust-bin/rust-bin-1.78.0.ebuild | 22 +++++++++++----------- 2 files changed, 16 insertions(+), 11 deletions(-)
(In reply to Arthur Zamarin from comment #8) > I'll build fixed tarball for 1.78.0 for sparc, not sure what is best for > 1.77.1 - maybe remove the sparc tarball, or should I rebuild it? I'd say please rebuild it as it's easier if we have a clean path without jumps.