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

Rollup of 9 pull requests #67414

Closed

Conversation

Mark-Simulacrum
Copy link
Member

Successful merges:

Failed merges:

r? @ghost

VirrageS and others added 21 commits December 6, 2019 16:59
This code was added to avoid UB in LLVM 6 and earlier, but we no longer support those LLVM versions.
Since https://reviews.llvm.org/D47807 (released in LLVM 7), uitofp does exactly what we need.

Closes rust-lang#51872
The WebAssembly targets of rustc have weird issues around name mangling
and import the same name from different modules. This all largely stems
from the fact that we're using literal symbol names in LLVM IR to
represent what a function is called when it's imported, and we're not
using the wasm-specific `wasm-import-name` attribute. This in turn leads
to two issues:

* If, in the same codegen unit, the same FFI symbol is referenced twice
  then rustc, when translating to LLVM IR, will only reference one
  symbol from the first wasm module referenced.

* There's also a bug in LLD [1] where even if two codegen units
  reference different modules, having the same symbol names means that
  LLD coalesces the symbols and only refers to one wasm module.

Put another way, all our imported wasm symbols from the environment are
keyed off their LLVM IR symbol name, which has lots of collisions today.
This commit fixes the issue by implementing two changes:

1. All wasm symbols with `#[link(wasm_import_module = "...")]` are
   mangled by default in LLVM IR. This means they're all given unique names.

2. Symbols then use the `wasm-import-name` attribute to ensure that the
   WebAssembly file uses the correct import name.

When put together this should ensure we don't trip over the LLD bug [1]
and we also codegen IR correctly always referencing the right symbols
with the right import module/name pairs.

Closes rust-lang#50021
Closes rust-lang#56309
Closes rust-lang#63562

[1]: https://bugs.llvm.org/show_bug.cgi?id=44316
The same effect can be achieved by `-Cllvm-args=-disable-preinline`.
make htons const fn

This may partially help rust-lang#67315.
…atthewjasper

Remove now-redundant range check on u128 -> f32 casts

This code was added to avoid UB in LLVM 6 and earlier, but we no longer support those LLVM versions.
Since https://reviews.llvm.org/D47807 (released in LLVM 7), uitofp does exactly what we need.

Closes rust-lang#51872
Fix pointing at arg when cause is outside of call

Follow up after: rust-lang#66933

Closes: rust-lang#66923

r? @estebank
…=eddyb

Fix handling of wasm import modules and names

The WebAssembly targets of rustc have weird issues around name mangling
and import the same name from different modules. This all largely stems
from the fact that we're using literal symbol names in LLVM IR to
represent what a function is called when it's imported, and we're not
using the wasm-specific `wasm-import-name` attribute. This in turn leads
to two issues:

* If, in the same codegen unit, the same FFI symbol is referenced twice
  then rustc, when translating to LLVM IR, will only reference one
  symbol from the first wasm module referenced.

* There's also a bug in LLD [1] where even if two codegen units
  reference different modules, having the same symbol names means that
  LLD coalesces the symbols and only refers to one wasm module.

Put another way, all our imported wasm symbols from the environment are
keyed off their LLVM IR symbol name, which has lots of collisions today.
This commit fixes the issue by implementing two changes:

1. All wasm symbols with `#[link(wasm_import_module = "...")]` are
   mangled by default in LLVM IR. This means they're all given unique names.

2. Symbols then use the `wasm-import-name` attribute to ensure that the
   WebAssembly file uses the correct import name.

When put together this should ensure we don't trip over the LLD bug [1]
and we also codegen IR correctly always referencing the right symbols
with the right import module/name pairs.

Closes rust-lang#50021
Closes rust-lang#56309
Closes rust-lang#63562

[1]: https://bugs.llvm.org/show_bug.cgi?id=44316
…stants, r=michaelwoerister

Remove some unnecessary `ATTR_*` constants.

r? @michaelwoerister
…master

Remove `SO_NOSIGPIPE` dummy variable on platforms that don't use it.
…, r=varkor

Enable opting out of specific default LLVM arguments.

`rustc` by default adds a few arguments to LLVM (like `-mergefunc-use-aliases` for example). With this PR `rustc` will only emit these arguments if the same argument has not already been specified by the user via `-Cllvm-args`. This enables opting out of these defaults.

The PR also removes a PGO specific `-Z` flag the effect of which can also be easily achieved by `-Cllvm-args`.

Fixes rust-lang#64310.
…docs, r=Dylan-DPC

Remove outdated references to @t from comments

Closes rust-lang#67341.

This removes all references to `@T` from the comment in libsyntax/ptr.rs.
@Mark-Simulacrum
Copy link
Member Author

@bors r+ p=100

@bors
Copy link
Contributor

bors commented Dec 19, 2019

📌 Commit 744cd06 has been approved by Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Dec 19, 2019

🌲 The tree is currently closed for pull requests below priority 100, this pull request will be tested once the tree is reopened

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Dec 19, 2019
@bors
Copy link
Contributor

bors commented Dec 19, 2019

⌛ Testing commit 744cd06 with merge 246bf36...

bors added a commit that referenced this pull request Dec 19, 2019
Rollup of 9 pull requests

Successful merges:

 - #67321 (make htons const fn)
 - #67328 (Remove now-redundant range check on u128 -> f32 casts)
 - #67333 ([mir-opt] Fix `Inline` pass to handle inlining into `box` expressions)
 - #67354 (Fix pointing at arg when cause is outside of call)
 - #67363 (Fix handling of wasm import modules and names)
 - #67382 (Remove some unnecessary `ATTR_*` constants.)
 - #67389 (Remove `SO_NOSIGPIPE` dummy variable on platforms that don't use it.)
 - #67393 (Enable opting out of specific default LLVM arguments.)
 - #67394 (Remove outdated references to @t from comments)

Failed merges:

r? @ghost
@rust-highfive
Copy link
Collaborator

Your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-12-19T04:54:14.2844448Z do so (now or later) by using -b with the checkout command again. Example:
2019-12-19T04:54:14.2844688Z 
2019-12-19T04:54:14.2844894Z   git checkout -b <new-branch-name>
2019-12-19T04:54:14.2845251Z 
2019-12-19T04:54:14.2845456Z HEAD is now at 246bf368c Auto merge of #67414 - Mark-Simulacrum:rollup-gxjwn6c, r=Mark-Simulacrum
2019-12-19T04:54:14.3248765Z ##[section]Starting: Setup environment
2019-12-19T04:54:14.3356992Z ==============================================================================
2019-12-19T04:54:14.3357102Z Task         : Bash
2019-12-19T04:54:14.3357178Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-12-19T04:55:57.0550465Z Chocolatey installed 0/1 packages. 1 packages failed.
2019-12-19T04:55:57.0550876Z  See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2019-12-19T04:55:57.0554644Z 
2019-12-19T04:55:57.0559534Z Failures
2019-12-19T04:55:57.0565881Z  - msys2 (exited 1) - msys2 not installed. An error occurred during installation:
2019-12-19T04:55:57.0566410Z  The remote server returned an error: (503) Server Unavailable. Service Unavailable
2019-12-19T04:55:57.5719830Z 
2019-12-19T04:55:57.5845665Z ##[error]Bash exited with code '1'.
2019-12-19T04:55:57.5969311Z ##[section]Starting: Checkout
2019-12-19T04:55:57.6076942Z ==============================================================================
2019-12-19T04:55:57.6077031Z Task         : Get sources
2019-12-19T04:55:57.6077130Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@bors
Copy link
Contributor

bors commented Dec 19, 2019

💔 Test failed - checks-azure

@bors bors removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Dec 19, 2019
@bors bors added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 19, 2019
@JohnTitor JohnTitor added the rollup A PR which is a rollup label Dec 19, 2019
@Centril Centril closed this Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.