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

Remove support for the deprecated PNaCl technology #42420

Closed
est31 opened this issue Jun 4, 2017 · 4 comments
Closed

Remove support for the deprecated PNaCl technology #42420

est31 opened this issue Jun 4, 2017 · 4 comments
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@est31
Copy link
Member

est31 commented Jun 4, 2017

Rust had nacl/PNaCl support since a while (#28355, #29289), but as Google has recently announced the deprecation of their pnacl technology, support for it should be removed from the compiler sooner or later.

@est31 est31 changed the title Remove support for the deprecated "nacl" technology Remove support for the deprecated nacl technology Jun 4, 2017
@est31 est31 changed the title Remove support for the deprecated nacl technology Remove support for the deprecated PNaCl technology Jun 4, 2017
@steveklabnik steveklabnik added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jun 5, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-cleanup Category: PRs that clean code up or issues documenting cleanup. label Jul 27, 2017
@tlively
Copy link
Contributor

tlively commented Oct 5, 2017

@est31 My understanding is that PNaCl is deprecated but NaCl is not. Does this issue suggest removing support for NaCl in addition to PNaCl? If not, how does keeping NaCl support affect #44006?

@est31
Copy link
Member Author

est31 commented Oct 5, 2017

Does this issue suggest removing support for NaCl in addition to PNaCl?

The two terms are a bit confusing. From what I understand is that NaCl is a sandboxing technology while PNaCl is a technology that is both a sandbox around code, and a portable binary format, just like wasm. You are right, the Google blog post I've linked only refers to PNaCl.

Now rustc has a target called le32-unknown-nacl. That's the one I'm proposing to remove. The target name itself only refers to NaCl, however its actually compiling to the PNaCl binary format (otherwise you'd need x86, ARM, MIPS variants for NaCl). I'm not the only one confused here!

Now I couldn't find any support in rustc for NaCl itself. I don't know whether a compiler needs special support for NaCl at all, but I suppose there is no need for special support.

I'll file a PR to remove PNaCl support and CC you.

@tlively
Copy link
Contributor

tlively commented Oct 5, 2017

Sounds good. Probably best to cc @eholk as well. Hopefully he will be able to shine some light on the PNaCl vs NaCl situation.

bors added a commit that referenced this issue Oct 9, 2017
Remove support for the PNaCl target (le32-unknown-nacl)

This removes support for the `le32-unknown-nacl` target which is currently supported by rustc on tier 3. Despite the "nacl" in the name, the target doesn't output native code (x86, ARM, MIPS), instead it outputs binaries in the PNaCl format.

There are two reasons for the removal:

* Google [has announced](https://blog.chromium.org/2017/05/goodbye-pnacl-hello-webassembly.html) deprecation of the PNaCl format. The suggestion is to migrate to wasm. Happens we already have a wasm backend!
* Our PNaCl LLVM backend is provided by the fastcomp patch set that the LLVM fork used by rustc contains in addition to vanilla LLVM (`src/llvm/lib/Target/JSBackend/NaCl`). Upstream LLVM doesn't have PNaCl support. Removing PNaCl support will enable us to move away from fastcomp (#44006) and have a lighter set of patches on top of upstream LLVM inside our LLVM fork. This will help distribution packagers of Rust.

Fixes #42420
@eholk
Copy link
Contributor

eholk commented Oct 9, 2017

That's correct that the PNaCl deprecation announcement is specific to PNaCl.

As far as PNaCl vs NaCl, NaCl is a sandboxing technology that uses a combination of OS sandboxing techniques and assembly validation. NaCl uses the underlying CPU's native instruction set, meaning you have to provide x64, ARM, etc. if you want to support different platforms.

PNaCl is a portable format on top of NaCl. It is based on LLVM bitcode. Before running the executable, the PNaCl translator takes the bitcode and translates it into a NaCl executable that then runs under the NaCl sandbox.

I don't know the Rust PNaCl target directly, but I gather that le32-unknown-nacl might be better called le32-unknown-pnacl.

I think NaCl has gotten some use outside the browser, so I could imagine a case for still supporting NaCl in Rust. It's probably only worth doing if there are current users of it though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants