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

rustbuild: Build libstd with ThinLTO #45661

Closed
wants to merge 1 commit into from

Conversation

alexcrichton
Copy link
Member

This commit moves the standard library to get compiled with multiple codegen
units and ThinLTO like the compiler itself. This I would hope is the last major
step towards closing out #45320

This commit moves the standard library to get compiled with multiple codegen
units and ThinLTO like the compiler itself. This I would hope is the last major
step towards closing out rust-lang#45320
@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member Author

This is a resubmission of #45529 now that #45655 has landed to hopefully enable this landing

Carrying over this approval as...

@bors: r=Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Oct 31, 2017

📌 Commit 832c943 has been approved by Mark-Simulacrum

@kennytm kennytm added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Oct 31, 2017
@bors
Copy link
Contributor

bors commented Nov 3, 2017

⌛ Testing commit 832c943 with merge abcf001e8772c24449cdd1401e599b62a1fa086e...

@bors
Copy link
Contributor

bors commented Nov 3, 2017

💔 Test failed - status-travis

@kennytm
Copy link
Member

kennytm commented Nov 3, 2017

dist-x86_64-musl, some debuginfo error which cannot be read because we assumed the output is valid UTF-8, which is not 🤦‍. Might be caused by #45511, assuming legit.

[00:57:34] ---- [debuginfo-gdb] debuginfo/vec.rs stdout ----
[00:57:34] 	NOTE: compiletest thinks it is using GDB without native rust support
[00:57:34] NOTE: compiletest thinks it is using GDB version 7011001
[00:57:34] thread '[debuginfo-gdb] debuginfo/vec.rs' panicked at 'called `Result::unwrap()` on an `Err` value: FromUtf8Error { bytes: [47, 99, 104, 101, 99, 107, 111, 117, 116, 47, 111, 98, 106, 47, 98, 117, 105, 108, 100, 47, 120, 56, 54, 95, 54, 52, 45, 117, 110, 107, 110, 111, 119, 110, 45, 108, 105, 110, 117, 120, 45, 103, 110, 117, 47, 116, 101, 115, 116, 47, 100, 101, 98, 117, 103, 105, 110, 102, 111, 47, 118, 101, 99, 46, 100, 101, 98, 117, 103, 103, 101, 114, 46, 115, 99, 114, 105, 112, 116, 58, 55, 58, 32, 69, 114, 114, 111, 114, 32, 105, 110, 32, 115, 111, 117, 114, 99, 101, 100, 32, 99, 111, 109, 109, 97, 110, 100, 32, 102, 105, 108, 101, 58, 10, 248, 236, 46, 249, 67, 127, 10], error: Utf8Error { valid_up_to: 114, error_len: Some(1) } }', /checkout/src/libcore/result.rs:906:4
[00:57:34] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:57:34] 
[00:57:34] 
[00:57:34] failures:
[00:57:34]     [debuginfo-gdb] debuginfo/vec.rs
[00:57:34] 
[00:57:34] test result: �[31mFAILED�(B�[m. 104 passed; 1 failed; 3 ignored; 0 measured; 0 filtered out

Content of those bytes:

/checkout/obj/build/x86_64-unknown-linux-gnu/test/debuginfo/vec.debugger.script:7: Error in sourced command file:
\xf8\xec.\xf9C\x7f

@kennytm kennytm added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 3, 2017
@alexcrichton
Copy link
Member Author

The binary in question indeed does suffer from the same error message as #45511, so I think it's the same issue.

@alexcrichton
Copy link
Member Author

I'm going to just assume this won't make progres until #45511 is fixed so I'm going to close this and focus efforts on that.

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Nov 20, 2017
This commit updates LLVM to fix rust-lang#45511 (https://reviews.llvm.org/D39981) and
also reenables ThinLTO for libtest now that we shouldn't hit rust-lang#45768. This also
opportunistically enables ThinLTO for libstd which was previously blocked
(rust-lang#45661) on test failures related to debuginfo with a presumed cause of rust-lang#45511.

Closes rust-lang#45511
bors added a commit that referenced this pull request Nov 22, 2017
rustbuild: Update LLVM and enable ThinLTO

This commit updates LLVM to fix #45511 (https://reviews.llvm.org/D39981) and
also reenables ThinLTO for libtest now that we shouldn't hit #45768. This also
opportunistically enables ThinLTO for libstd which was previously blocked
(#45661) on test failures related to debuginfo with a presumed cause of #45511.

Closes #45511
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Nov 24, 2017
This commit updates LLVM to fix rust-lang#45511 (https://reviews.llvm.org/D39981) and
also reenables ThinLTO for libtest now that we shouldn't hit rust-lang#45768. This also
opportunistically enables ThinLTO for libstd which was previously blocked
(rust-lang#45661) on test failures related to debuginfo with a presumed cause of rust-lang#45511.

Closes rust-lang#45511
bors added a commit that referenced this pull request Nov 25, 2017
rustbuild: Update LLVM and enable ThinLTO

This commit updates LLVM to fix #45511 (https://reviews.llvm.org/D39981) and
also reenables ThinLTO for libtest now that we shouldn't hit #45768. This also
opportunistically enables ThinLTO for libstd which was previously blocked
(#45661) on test failures related to debuginfo with a presumed cause of #45511.

Closes #45511
@alexcrichton alexcrichton deleted the std-cgu branch November 25, 2017 14:33
ritiek added a commit to ritiek/rust that referenced this pull request Nov 26, 2017
MIR: adopt borrowck test

Fix trailing whitespace

span_bug! on unexpected action

Make RegionVid use newtype_index!

Closes rust-lang#45843

Check rvalue aggregates during check_stmt in tycheck, add initial, (not passing) test

Fix failing test

Remove attributes and test comments accidentally left behind, add in span_mirbugs

Normalize LvalueTy for ops and format code to satisfy tidy check

only normalize operand types when in an ADT constructor

avoid early return

handle the active field index in unions

normalize types in ADT constructor

Fixes rust-lang#45940

Fix borrowck compiler errors for upvars contain "spurious" dereferences

Fixes rust-lang#46003

added associated function Box::leak

Box::leak - improve documentation

Box::leak - fixed bug in documentation

Box::leak - relaxed constraints wrt. lifetimes

Box::leak - updated documentation

Box::leak - made an oops, fixed now =)

Box::leak: update unstable issue number (46179).

Add test for rust-lang#44953

Add missing Debug impls to std_unicode

Also adds #![deny(missing_debug_implementations)] so they don't get
missed again.

Amend RELEASES for 1.22.1

and fix the date for 1.22.0

Rename param in `[T]::swap_with_slice` from `src` to `other`.

The idea of ‘source’ and ‘destination’ aren’t very applicable for this
operation since both slices can both be considered sources and
destinations.

Clarify stdin behavior of `Command::output`.

Fixes rust-lang#44929.

Add hints for the case of confusing enum with its variants

Add failing testcases

Add module population and case of enum in place of expression

Use for_each_child_stable in find_module

Use multiline text for crate conflict diagnostics

Make float::from_bits transmute (and update the documentation to reflect this).

The current implementation/documentation was made to avoid sNaN because of
potential safety issues implied by old/bad LLVM documentation. These issues
aren't real, so we can just make the implementation transmute (as permitted
by the existing documentation of this method).

Also the documentation didn't actually match the behaviour: it said we may
change sNaNs, but in fact we canonicalized *all* NaNs.

Also an example in the documentation was wrong: it said we *always* change
sNaNs, when the documentation was explicitly written to indicate it was
implementation-defined.

This makes to_bits and from_bits perfectly roundtrip cross-platform, except
for one caveat: although the 2008 edition of IEEE-754 specifies how to
interpet the signaling bit, earlier editions didn't. This lead to some platforms
picking the opposite interpretation, so all signaling NaNs on x86/ARM are quiet
on MIPS, and vice-versa.

NaN-boxing is a fairly important optimization, while we don't even guarantee
that float operations properly preserve signalingness. As such, this seems like
the more natural strategy to take (as opposed to trying to mangle the signaling
bit on a per-platform basis).

This implementation is also, of course, faster.

Simplify an Iterator::fold to Iterator::any

This method of once-diagnostics doesn't allow nesting

UI tests extract the regular output from the 'rendered' field in json

Merge cfail and ui tests into ui tests

Add a MIR pass to lower 128-bit operators to lang item calls

Runs only with `-Z lower_128bit_ops` since it's not hooked into targets yet.

Include tuple projections in MIR tests

Add type checking for the lang item

As part of doing so, add more lang items instead of passing u128 to the i128 ones where it doesn't matter in twos-complement.

Handle shifts properly

* The overflow-checking shift items need to take a full 128-bit type, since they need to be able to detect idiocy like `1i128 << (1u128 << 127)`
* The unchecked ones just take u32, like the `*_sh?` methods in core
* Because shift-by-anything is allowed, cast into a new local for every shift

incr.comp.: Make sure we don't lose unused green results from the query cache.

rustbuild: Update LLVM and enable ThinLTO

This commit updates LLVM to fix rust-lang#45511 (https://reviews.llvm.org/D39981) and
also reenables ThinLTO for libtest now that we shouldn't hit rust-lang#45768. This also
opportunistically enables ThinLTO for libstd which was previously blocked
(rust-lang#45661) on test failures related to debuginfo with a presumed cause of rust-lang#45511.

Closes rust-lang#45511

std: Flag Windows TLS dtor symbol as #[used]

Turns out ThinLTO was internalizing this symbol and eliminating it. Worse yet if
you compiled with LTO turns out no TLS destructors would run on Windows! The
`#[used]` annotation should be a more bulletproof implementation (in the face of
LTO) of preserving this symbol all the way through in LLVM and ensuring it makes
it all the way to the linker which will take care of it.

Add enum InitializationRequiringAction

Fix tidy tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants