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

sparc64-linux support #38726

Merged
merged 9 commits into from
Jan 1, 2017
Merged

sparc64-linux support #38726

merged 9 commits into from
Jan 1, 2017

Conversation

japaric
Copy link
Member

@japaric japaric commented Dec 31, 2016

This is built on top of #38656 and depends on rust-lang/libc#483

Hello world works.

The libc-test test suite passes.

panic! doesn't fully work:

$ qemu-sparc64-static ./panic
thread 'main' panicked at 'explicit panic', panic.rs:1
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Illegal instruction (core dumped)

Backtraces don't work either, probably related to the previous point:

$ export RUST_BACKTRACE=1
$ qemu-sparc64-static ./panic
thread 'main' panicked at 'explicit panic', panic.rs:1
stack backtrace:
Illegal instruction (core dumped)

r? @alexcrichton

@jakllsch Does panicking / backtraces work on sparc64-netbsd?

cc @glaubitz

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@glaubitz
Copy link
Contributor

@japaric If you rather want to debug on a real machine than on qemu, let me know. If you like, please join us in #sparc on Freenode.

@jrtc27
Copy link

jrtc27 commented Dec 31, 2016

At a glance, the C ABI seems wrong; small structs should be passed in and returned in registers.

@jakllsch
Copy link
Contributor

@japaric Yes, backtrace of fn main() { println!("Goodbye World!"); panic!(); } produces an identical backtrace (with RUST_BACKTRACE=1) on NetBSD/amd64 and NetBSD/sparc64 (excepting differences in addresses within the .text segment) with #38656. Had to use -C linker=sparc64--netbsd-gcc (the same wrapper gcc-rs points the rustbuild at) in addition to --target sparc64-unknown-netbsd to get it to cross link.

@jakllsch
Copy link
Contributor

@jrtc27 It's very possible cabi_sparc64 is almost completely wrong, it's mostly a copy/paste of cabi_powerpc64 in #38656. However, it was enough to get a cross-compiled rustc to output its usage message on a NetBSD/sparc64 host. It did not succeed in actually compiling anything due to some unnaturally-aligned access faults, which I decided to postpone much investigation of while I got this upstreamed.

@alexcrichton
Copy link
Member

This seems good to me, thanks @japaric!

I'm perpetually worried about all this cabi business though. It seems no one really knows what they're doing around the cabi modules and I'm reading "hello world works" as "someone's going to waste hours of their life later fixing an abi-related bug"

@sanxiyn
Copy link
Member

sanxiyn commented Jan 1, 2017

@bors r+

@bors
Copy link
Contributor

bors commented Jan 1, 2017

📌 Commit b14785d has been approved by sanxiyn

@bors
Copy link
Contributor

bors commented Jan 1, 2017

⌛ Testing commit b14785d with merge a2930da...

@bors
Copy link
Contributor

bors commented Jan 1, 2017

💔 Test failed - status-travis

@sanxiyn
Copy link
Member

sanxiyn commented Jan 1, 2017

@bors retry

Network failure.

@bors
Copy link
Contributor

bors commented Jan 1, 2017

⌛ Testing commit b14785d with merge e1279a0...

bors added a commit that referenced this pull request Jan 1, 2017
sparc64-linux support

This is built on top of #38656 and depends on rust-lang/libc#483

Hello world works.

The libc-test test suite passes.

`panic!` doesn't fully work:

```
$ qemu-sparc64-static ./panic
thread 'main' panicked at 'explicit panic', panic.rs:1
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Illegal instruction (core dumped)
```

Backtraces don't work either, probably related to the previous point:

```
$ export RUST_BACKTRACE=1
$ qemu-sparc64-static ./panic
thread 'main' panicked at 'explicit panic', panic.rs:1
stack backtrace:
Illegal instruction (core dumped)
```

r? @alexcrichton

@jakllsch Does panicking / backtraces work on sparc64-netbsd?

cc @glaubitz
@bors
Copy link
Contributor

bors commented Jan 1, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: sanxiyn
Pushing e1279a0 to master...

@bors bors merged commit b14785d into rust-lang:master Jan 1, 2017
@japaric japaric deleted the sparc64 branch February 9, 2017 14:36
jsonn pushed a commit to jsonn/pkgsrc that referenced this pull request Mar 20, 2017