Uh oh!
There was an error while loading. Please reload this page.
Add Illumos support - #31078
Conversation
rust-highfive
commented
Jan 21, 2016
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (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. |
There was a problem hiding this comment.
This sorts of "default libraries" are typically linked where they're needed rather than by the compiler unconditionally. Do you know what symbols these are pulling in? I suspect they're only needed by the standard library so could the linkage directives go there instead?
There was a problem hiding this comment.
Yes, these are mostly for socket functions and e.g. fork.
Could you please point out to the correct place to move it in libstd?
There was a problem hiding this comment.
Sure thing, they'll probably reside in rtdeps.rs.
Out of curiosity, is sunos posix? Or would a "true port" of libstd contain an entirely different implementation of std::sys basically (e.g. how Windows is entirely separate from Unix)
There was a problem hiding this comment.
Oh, completely missed it, thank you!
is sunos posix?
Yes, absolutely. I believe historically it's derived from the Unix SVR4 codebase, and mostly compatible with BSD-like OSes. And, as I understand it, at least Illumos (the open source Solaris fork) strives to be maximally compatible with other *nixes, and it includes e.g. GCC toolkit by default instead of some proprietary compilers. Actually, I'm not even sure that this port would work on the original Sun/Oracle Solaris - there are much more diversions from standards.
There was a problem hiding this comment.
Ah ok cool, sounds good to me!
alexcrichton
commented
Jan 21, 2016
Quite exciting, thanks @nbaksalyar! |
nbaksalyar
commented
Jan 21, 2016
Thanks for the review, Alex! :) |
brson
commented
Jan 22, 2016
lgtm r? @alexcrichton |
There was a problem hiding this comment.
Ah sorry I was just indicating that the macro could probably be removed in favor of generic functions and/or otherwise non-meta-programming pieces. Could the duplication between the functions here be reduced?
There was a problem hiding this comment.
Oh, sorry, got it - I think it should be possible to just pass a reference to a corresponding intrinsic function. Will give it a try in a moment.
EDIT: Actually, it turns out I totally missed your comment on this regard - sorry, will fix it. Thanks! :)
There was a problem hiding this comment.
It hasn't worked with a generic signature fn foo<F: Fn(f64) -> f64>(val: f64, f: F) -> f64, because the intrinsic functions are unsafe & extern - they don't implement the Fn trait. However, it worked this way: fn foo(self, log_fn: unsafe extern "rust-intrinsic" fn(f64) -> f64) -> f64 - i.e., with a completely defined type in a function reference.
Would this work as a solution, or should I find a better way?
There was a problem hiding this comment.
Ah you may want to all it like:
foo(val, |f| unsafe{ intrinsics::doit(f)})(or something like that). I think there are other bugs for taking intrinsics by-value unfortunately
bors
commented
Jan 27, 2016
☔ The latest upstream changes (presumably #31120) made this pull request unmergeable. Please resolve the merge conflicts. |
alexcrichton
commented
Jan 27, 2016
Ok cool, I think this is getting pretty close to being good-to-go. I've got a few final questions about this:
|
potatosalad
commented
Jan 27, 2016
@alexcrichton I might be able to add a little explanation to your questions:
The So, it's essentially specifying that it can run on a "Solaris 11" compatible system. The same binary built for a current illumos system in many cases will run just fine on an Oracle Solaris 11 system without an issue.
I don't know about anywhere that it's an official standard, but based on Google search results alone (which I'm sure can always be trusted as a metric 😉):
The difference in terms of "solaris" and "sunos" might be more useful in the future, but are really no different than "darwin" and "macos" or "mingw32" and "windows". The benefit is that if there is ever a future target triple for something like However, beyond that I don't know if there is any explicit reason to use "sunos" over "solaris" for the |
nbaksalyar
commented
Jan 27, 2016
@potatosalad has already answered them all, but I would add my 2c:
Other than Google results, that's the standard build target for GCC on Illumos (only with addition of version 2.11). E.g. compiler tools are called like
@potatosalad is correct, it's more like "darwin". Solaris and Illumos self-identify with Technically, I think But any would work here, so let me know if you want me to change it to some better name. Hopefully that explains it a bit. |
alexcrichton
commented
Jan 28, 2016
Thanks for the info! That's certainly quite enlightenting. Would it be possible to not pass down 2.11 to LLVM then? I don't think we do this for other platforms, and then LLVM would pick the "default level" I guess in theory. Or is solaris different where the OS version has major changes in ABI for things like thread locals each revision? Also after some discussion with @brson, we think that the |
nbaksalyar
commented
Jan 28, 2016
Sure! I will make required changes and resolve the merge conflict then. |
bors
commented
Jan 31, 2016
☔ The latest upstream changes (presumably #31298) made this pull request unmergeable. Please resolve the merge conflicts. |
nbaksalyar
commented
Jan 31, 2016
I've rebased the commits - should be ready to go! |
There was a problem hiding this comment.
I think you can remove the #[cfg] and the one below by just adding use prelude::v1::* to the top of this file (these are both in the prelude), and then you don't need the #[cfg] as well I believe.
alexcrichton
commented
Jan 31, 2016
Looks good to me, thanks @nbaksalyar! I had just one tiny nit but it's not very relevant, so I'm gonna send this to bors: |
bors
commented
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
commented
Jan 31, 2016
💔 Test failed - auto-mac-ios-opt |
nbaksalyar
commented
Feb 3, 2016
The issue should be fixed by now. Sorry it took so long - it turned out that I was building the bootstrap compiler from an incorrect base (the issue is described in #31142). So actually to run I've yet to make the new stage0 work correctly (it fails with SIGILL for now, for some reason). I guess the reason is that the codebase with the latest commits, on which I based my work, has diverged substantially. I'll try to find & fix the reason, but actually it might be better to wait for a snapshot update before rebuilding the bootstrapping compiler and adding it to the list of snapshots. Other than that, it should work correctly, as the only major change from my previous snapshot is renaming "sunos" to "solaris" (and that's why it wouldn't work). |
alexcrichton
commented
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
bors
commented
Feb 3, 2016
bors
commented
Feb 4, 2016
nbaksalyar
commented
Feb 4, 2016
Awesome! @alexcrichton, @potatosalad, and everyone - thanks for your help! :) |
dhuseby
commented
Feb 9, 2016
@nbaksalyar have you successfully bootstrapped rustc on illumos yet? |
nbaksalyar
commented
Feb 10, 2016
@dhuseby |
dhuseby
commented
Mar 21, 2016
@nbaksalyar any update on the WIP branch? |
nbaksalyar
commented
Mar 21, 2016
@dhuseby |
alexcrichton
commented
Mar 21, 2016
@nbaksalyar oh I should also mention that we've recently got cross-compiled nightlies from Linux to FreeBSD/NetBSD up and running, so we have nightly builds of rustc and the standard library for FreeBSD and NetBSD. If there's a cross compiler from Linux to Illumos then I'd be game to set one up as well for Illumos! |
cneira
commented
Jan 12, 2018
@alexcrichton |
jperkin
commented
Jan 12, 2018
FWIW we've been shipping rust/cargo packages in SmartOS for a while now, currently 1.22.1 but 1.23 should be ready soon. Our binaries should work on any illumos platform built after 20141030. |
not since 2.11, but a big chunk of userspace is still 32-bit (GNU CC always builds a 32-bit multilib-enabled compiler, for instance) @nbaksalyar: do you still have the target spec JSON files originally used to bootstrap this port? Looking into an |
This pull request adds support for Illumos-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.rsandDirEntrystructure insrc/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