rust/src
bors 65c53c3bb6 Auto merge of #105800 - lqd:dylib-thinlto, r=bjorn3
Don't copy symbols from dylibs with `-Zdylib-lto`

When `rustc_driver` started being built with `-Zdylib-lto -Clto=thin`, some libstd symbols were copied by the LTO process into the dylib. That causes duplicate local symbols that are not present otherwise.

Depending on the situation (lib loading order apparently), the duplicated symbols could cause issues: `rustc_driver` overrode the panic hook, but it didn't apply to rustc main's hook (the default from libstd). This is the cause of #105637, in some situations the panic hook installed by `rustc_driver` isn't executed, and only libstd's backtrace is shown (and a double panic). The query stack, as well as the various notes to open a GH about the ICE, don't appear.

It's not clear exactly what is needed to trigger the issue, but I have simulated a reproducer [here](https://github.com/lqd/issue-105637) with cargo involved, the incorrect panic hook is executed on my machine. It is hard to reproduce in a unit test: `cargo run` + `rustup` involves LD_LIBRARY_PATH, which is not the case for `compiletest`. cargo also adds unconditional flags that are then overridden in [`bootstrap` when building rustc with `rust.lto = thin`](9c07efe84f/src/bootstrap/compile.rs (L702-L714)) as done on CI).

All this to say the compilation and execution environment in `bootstrap` leading to the bug building `rustc_driver` is different from our UI tests, and I believe one of the reasons it's hard to make an exact reproducer test. Thankfully there's _still_ a difference in the behavior though: although in the unit test the correct panic hook seems to be executed compared to my repro and the current nightly, only the fix removes the double panic here.

The `7e8277aefa12f1469fb1df01418ff5846a7854a9` `try` build:
- fixes the reproducer repo linked above
- restores the ICE messages from https://github.com/rust-lang/rust/issues/105321 back to the state in its OP compared to the description in https://github.com/rust-lang/rust/issues/105637
- restores the ICE message and the query stack from https://github.com/rust-lang/rust/issues/105777 compared to nightly

While I believe this technically fixes the P-critical issue https://github.com/rust-lang/rust/issues/105637, I would not want to close it yet as we may want to backport to beta/stable (if a point release happens, it would fix the ICEs reported on 1.66.0, which is built with ThinLTO on linux). Once this PR lands, I'll also open another PR to re-enable ThinLTO on x64 darwin's dist builder.
2022-12-17 14:51:10 +00:00
..
bootstrap Rollup merge of #105624 - compiler-errors:cache-unsound, r=jyn514 2022-12-14 17:17:58 +01:00
ci Test documentation of hidden items in std 2022-12-16 20:21:43 +00:00
doc Auto merge of #105421 - jacobbramley:jb/branch-prot-check, r=nagisa 2022-12-17 12:10:27 +00:00
etc Fix natvis VecDeque formatter 2022-11-27 18:09:56 +01:00
librustdoc Rollup merge of #105780 - GuillaumeGomez:read-more-links, r=notriddle 2022-12-17 00:45:53 +01:00
llvm-project@3dfd4d93fa Update LLVM submodule 2022-12-07 08:40:49 +01:00
rustdoc-json-types Rollup merge of #103065 - aDotInTheVoid:rdj-arg-pattern, r=GuillaumeGomez 2022-11-30 19:53:17 +01:00
test Auto merge of #105800 - lqd:dylib-thinlto, r=bjorn3 2022-12-17 14:51:10 +00:00
tools Rollup merge of #105743 - nnethercote:SimplifiedType-cleanups, r=lcnr 2022-12-15 22:03:01 +01:00
README.md
stage0.json Bump to latest beta 2022-11-06 17:11:02 -05:00
version bump version to 1.68 2022-12-09 17:49:45 +01:00

This directory contains the source code of the rust project, including:

  • The test suite
  • The bootstrapping build system
  • Various submodules for tools, like cargo, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.