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

Add Illumos support #138

Merged
merged 3 commits into from
Jan 17, 2016
Merged

Add Illumos support #138

merged 3 commits into from
Jan 17, 2016

Conversation

nbaksalyar
Copy link
Contributor

Hello!

This is a first pull request required to add support for a family of operating systems based on Illumos (an OpenSolaris fork), such as Joyent's SmartOS, OmniOS, OpenIndiana, and others.

After this commit is merged, we can proceed to add support for Illumos to the main Rust repository.
The current version can be found here: https://github.com/nbaksalyar/rust/tree/solaris. It passes all tests (2339 passed; 0 failed; 3 ignored; 0 measured on the run-pass suite).

Please let me know if something is needed to be added or changed.

Thanks!

@alexcrichton
Copy link
Member

Oh holy cow, nice! This looks awesome :)

Could you organize the sunos.rs file like others in the repository so it looks like:

  • Type definitions
  • Structure definitions
  • Constants
  • Rust-defined functions (e.g. inlined C maros)
  • FFI function headers (e.g. the extern block)
  • Further delegation via cfg_if! to other modules (may not be present yet for this module)

@nbaksalyar
Copy link
Contributor Author

Thanks!

Does it look better now? :)

@@ -621,6 +620,7 @@ extern {
addrlen: *mut socklen_t) -> ::ssize_t;
pub fn mkfifo(path: *const c_char, mode: mode_t) -> ::c_int;

#[cfg(not(target_os = "sunos"))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this function definition move directly into bsd/mod.rs and notbsd/mod.rs? We tend to avoid #[cfg(not)] if possible in libc currently

@alexcrichton
Copy link
Member

Looks good to me, just one last nit and then I'll merge once CI passes

alexcrichton added a commit that referenced this pull request Jan 17, 2016
@alexcrichton alexcrichton merged commit 2575794 into rust-lang:master Jan 17, 2016
@alexcrichton
Copy link
Member

Thanks!

@nbaksalyar
Copy link
Contributor Author

Awesome, thank you! :)

bors added a commit to rust-lang/rust that referenced this pull request Jan 31, 2016
This pull request adds support for [Illumos](http://illumos.org/)-based operating systems: SmartOS, OpenIndiana, and others. For now it's x86-64 only, as I'm not sure if 32-bit installations are widespread. This PR is based on #28589 by @potatosalad, and also closes #21000, #25845, and #25846.

Required changes in libc are already merged: rust-lang/libc#138

Here's a snapshot required to build a stage0 compiler:
https://s3-eu-west-1.amazonaws.com/nbaksalyar/rustc-sunos-snapshot.tar.gz
It passes all checks from `make check`.

There are some changes I'm not quite sure about, e.g. macro usage in `src/libstd/num/f64.rs` and `DirEntry` structure in `src/libstd/sys/unix/fs.rs`, so any comments on how to rewrite it better would be greatly appreciated.

Also, LLVM configure script might need to be patched to build it successfully, or a pre-built libLLVM should be used. Some details can be found here: https://llvm.org/bugs/show_bug.cgi?id=25409

Thanks!

r? @brson
bors added a commit to rust-lang/rust that referenced this pull request Feb 3, 2016
This pull request adds support for [Illumos](http://illumos.org/)-based operating systems: SmartOS, OpenIndiana, and others. For now it's x86-64 only, as I'm not sure if 32-bit installations are widespread. This PR is based on #28589 by @potatosalad, and also closes #21000, #25845, and #25846.

Required changes in libc are already merged: rust-lang/libc#138

Here's a snapshot required to build a stage0 compiler:
https://s3-eu-west-1.amazonaws.com/nbaksalyar/rustc-sunos-snapshot.tar.gz
It passes all checks from `make check`.

There are some changes I'm not quite sure about, e.g. macro usage in `src/libstd/num/f64.rs` and `DirEntry` structure in `src/libstd/sys/unix/fs.rs`, so any comments on how to rewrite it better would be greatly appreciated.

Also, LLVM configure script might need to be patched to build it successfully, or a pre-built libLLVM should be used. Some details can be found here: https://llvm.org/bugs/show_bug.cgi?id=25409

Thanks!

r? @brson
critiqjo pushed a commit to critiqjo/rustdoc that referenced this pull request Dec 16, 2016
This pull request adds support for [Illumos](http://illumos.org/)-based operating systems: SmartOS, OpenIndiana, and others. For now it's x86-64 only, as I'm not sure if 32-bit installations are widespread. This PR is based on #28589 by @potatosalad, and also closes #21000, #25845, and #25846.

Required changes in libc are already merged: rust-lang/libc#138

Here's a snapshot required to build a stage0 compiler:
https://s3-eu-west-1.amazonaws.com/nbaksalyar/rustc-sunos-snapshot.tar.gz
It passes all checks from `make check`.

There are some changes I'm not quite sure about, e.g. macro usage in `src/libstd/num/f64.rs` and `DirEntry` structure in `src/libstd/sys/unix/fs.rs`, so any comments on how to rewrite it better would be greatly appreciated.

Also, LLVM configure script might need to be patched to build it successfully, or a pre-built libLLVM should be used. Some details can be found here: https://llvm.org/bugs/show_bug.cgi?id=25409

Thanks!

r? @brson
Susurrus pushed a commit to Susurrus/libc that referenced this pull request Mar 26, 2017
djrenren pushed a commit to djrenren/libtest that referenced this pull request Jan 22, 2019
This pull request adds support for [Illumos](http://illumos.org/)-based operating systems: SmartOS, OpenIndiana, and others. For now it's x86-64 only, as I'm not sure if 32-bit installations are widespread. This PR is based on #28589 by @potatosalad, and also closes #21000, #25845, and #25846.

Required changes in libc are already merged: rust-lang/libc#138

Here's a snapshot required to build a stage0 compiler:
https://s3-eu-west-1.amazonaws.com/nbaksalyar/rustc-sunos-snapshot.tar.gz
It passes all checks from `make check`.

There are some changes I'm not quite sure about, e.g. macro usage in `src/libstd/num/f64.rs` and `DirEntry` structure in `src/libstd/sys/unix/fs.rs`, so any comments on how to rewrite it better would be greatly appreciated.

Also, LLVM configure script might need to be patched to build it successfully, or a pre-built libLLVM should be used. Some details can be found here: https://llvm.org/bugs/show_bug.cgi?id=25409

Thanks!

r? @brson
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.

2 participants