-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Port Rust to PNaCl. #26148
Port Rust to PNaCl. #26148
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
Whoa amazing! |
Nice work @DiamondLovesYou! Could you actually lump all the support into this PR instead of sharding it across a few PRs? This should likely all land as a unit instead of piecemeal to make sure it's all kept track of |
@@ -825,6 +846,11 @@ mod arch { | |||
pub const ARCH: &'static str = "powerpc"; | |||
} | |||
|
|||
#[cfg(target_arch = "le32")] | |||
mod arch { | |||
pub const ARCH: &'static str = "le23"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/le23/le32/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, thanks.
…plification passes.
…from the toolchain.
We might reconsider what the requirements are for cross-compile toolchains before adding |
#[link(name = "ppapi_stub", kind = "static")] | ||
#[link(name = "cli_main", kind = "static")] | ||
#[link(name = "tar", kind = "static")] | ||
#[link(name = "nacl_spawn", kind = "static")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is all of this stuff part of the compiler driver? Are these necessary for running any NaCl code? Should rustc link them by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are necessary if you'd like to spawn and manage child processes. Which rustc
does; rustdoc
may not currently, but there's no harm in adding the libs in case rustdoc
starts spawning processes at some future date. They also capture stdout/stderr for piping etc, setup env vars (like what a you'd expect on a regular platform), and provide program argument access (in the same way as one would expect for a normal platform).
They should not be default. It would introduce a false dep on all those libs for pure PPAPI plugins (like those using rust-ppapi
) which should only depend on the C PPAPI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, rust-ppapi
(or any pure Rust wrapper over PPAPI) can't be used at all with ppapi_cpp
; both define the main PPAPI functions: PPP_InitializeModule
, PPP_ShutdownModule
, and PPP_GetInterface
.
@DiamondLovesYou I tried to go through and add suggestions about how to abstract away pnacl-specific parts, but I didn't get through the whole patch. |
In the past, Android's cross used it as well. It was removed around a year ago (was mildly annoying for me when it happened too). Either way, |
I need to do a rebase so I can pick up the changes for LLVM 3.7. |
In order to save the comments on the various commits of this PR from the deletions of a rebase, I've created a new PR: #26505. |
From the bleachers, I find the idea of this very exciting. Being able to build portable native Chrome apps using Rust would be pretty awesome. 👍 |
@ctaggart Thanks! Once this lands in #[link(name = "LLVM-3.7.0svn")]
#[link(name = "pthread")]
#[link(name = "rt")]
#[link(name = "dl")]
#[link(name = "m")]
#[cfg_attr(not(target_env = "msvc"), link(name = "c++"))]
extern {} Configure with |
Closing in favor of #26505 |
Modify Rust for targeting PNaCl/JS. PNaCl's newlib isn't completely vanilla (pthreads, for example), so I've for the most part kept to
#[cfg]
ing ontarget_os
.This PR also adds some code for hosting Rust on PNaCl.