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 #483

Merged
merged 3 commits into from
Jan 1, 2017
Merged

sparc64-linux support #483

merged 3 commits into from
Jan 1, 2017

Conversation

japaric
Copy link
Member

@japaric japaric commented Dec 31, 2016

This needs to be "cleaned" up to use modules instead of a bunch of cfgs ...

Sadly, sparc64 constants are very different from other architectures so cleaning this will result in a bunch of duplication, I think.

While working on this, I was wondering why the constants are not written like this:

// linux/mod.rs
const COMMON: ::c_int = 3;

cfg_if! {
    if #[cfg(target_arch = "sparc64")] {
        const FOO: ::c_int = 1;
    } else if #[cfg(any(target_arch = "mips64", target_arch = "x86_64"))] {
        const FOO: ::c_int = 2;
    } else {
        // unsupported/unknown architecture
    }
}

I think this might result in less duplicated code. @alexcrichton Has something like that ^ been attempted before?

@rust-highfive
Copy link

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member

For values that need to be changed for #[cfg]'d, can we just push those down the module hierarchy? It's fine to have a ton of duplication, that's what libc is for!

@alexcrichton
Copy link
Member

Looks good to me! Travis has a few failures though?

@japaric japaric changed the title [WIP] sparc64-linux support sparc64-linux support Jan 1, 2017
@japaric
Copy link
Member Author

japaric commented Jan 1, 2017

should be ready to go this time

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Jan 1, 2017

📌 Commit 67615b4 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Jan 1, 2017

⌛ Testing commit 67615b4 with merge 3e89579...

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

This needs to be "cleaned" up to use modules instead of a bunch of `cfg`s ...

Sadly, sparc64 constants are very different from other architectures so cleaning this will result in a bunch of duplication, I think.

While working on this, I was wondering why the constants are not written like this:

``` rust
// linux/mod.rs
const COMMON: ::c_int = 3;

cfg_if! {
    if #[cfg(target_arch = "sparc64")] {
        const FOO: ::c_int = 1;
    } else if #[cfg(any(target_arch = "mips64", target_arch = "x86_64"))] {
        const FOO: ::c_int = 2;
    } else {
        // unsupported/unknown architecture
    }
}
```

I think this might result in less duplicated code. @alexcrichton Has something like that ^ been attempted before?
@bors
Copy link
Contributor

bors commented Jan 1, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 3e89579 to master...

@bors bors merged commit 67615b4 into rust-lang:master Jan 1, 2017
bors added a commit to rust-lang/rust 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
Susurrus pushed a commit to Susurrus/libc that referenced this pull request Mar 26, 2017
Add POSIX AIO support

POSIX AIO is a standard for asynchronous file I/O.  Read, write, and
fsync operations can all take place in the background, with completion
notification delivered by a signal, by a new thread, by kqueue, or not
at all.

The SigEvent class, used for AIO notifications among other things, is
also added.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants