rust/compiler
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
..
rustc rustc: Use unix_sigpipe instead of rustc_driver::set_sigpipe_handler 2022-10-02 17:49:36 +02:00
rustc_abi minor code cleanups 2022-12-12 19:49:53 +01:00
rustc_apfloat compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_arena compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_ast more clippy::complexity fixes 2022-12-15 00:09:10 +01:00
rustc_ast_lowering Rollup merge of #105464 - nbdd0121:hir, r=compiler-errors 2022-12-13 19:57:10 +01:00
rustc_ast_passes Allow impl ~const Trait opaque types 2022-12-15 11:26:15 +00:00
rustc_ast_pretty Auto merge of #105160 - nnethercote:rm-Lit-token_lit, r=petrochenkov 2022-12-12 05:16:50 +00:00
rustc_attr rustc_attr remove ref patterns 2022-12-06 14:45:58 +00:00
rustc_baked_icu_data Update crate documentation of rustc_baked_icu_data crate 2022-11-18 14:46:36 -08:00
rustc_borrowck Auto merge of #105657 - oli-obk:mk_projection_ty, r=lcnr 2022-12-15 04:21:25 +00:00
rustc_builtin_macros Rollup merge of #105620 - TaKO8Ki:remove-unnecessary-uses-of-clone, r=compiler-errors 2022-12-13 01:17:10 +01:00
rustc_codegen_cranelift Merge commit '2bb3996244cf1b89878da9e39841e9f6bf061602' into sync_cg_clif-2022-12-14 2022-12-14 19:30:46 +01:00
rustc_codegen_gcc Auto merge of #105252 - bjorn3:codegen_less_pair_values, r=nagisa 2022-12-12 10:38:31 +00:00
rustc_codegen_llvm Auto merge of #105421 - jacobbramley:jb/branch-prot-check, r=nagisa 2022-12-17 12:10:27 +00:00
rustc_codegen_ssa don't copy symbols from dylibs with -Zdylib-lto 2022-12-16 20:39:23 +00:00
rustc_const_eval simplify alignment_check_failed a bit 2022-12-15 16:48:30 +00:00
rustc_data_structures more clippy::complexity fixes 2022-12-15 00:09:10 +01:00
rustc_driver compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_error_codes docs: rewrite E0158 error-code docs for clarity 2022-12-16 08:36:40 +13:00
rustc_error_messages Auto merge of #105421 - jacobbramley:jb/branch-prot-check, r=nagisa 2022-12-17 12:10:27 +00:00
rustc_errors more clippy::complexity fixes 2022-12-15 00:09:10 +01:00
rustc_expand Auto merge of #105160 - nnethercote:rm-Lit-token_lit, r=petrochenkov 2022-12-12 05:16:50 +00:00
rustc_feature Auto merge of #102318 - Amanieu:default_alloc_error_handler, r=oli-obk 2022-12-16 21:08:45 +00:00
rustc_fs_util Remove useless borrows and derefs 2022-12-01 17:34:43 +00:00
rustc_graphviz Remove useless borrows and derefs 2022-12-01 17:34:43 +00:00
rustc_hir minor code cleanups 2022-12-12 19:49:53 +01:00
rustc_hir_analysis Rollup merge of #105711 - compiler-errors:rpitit-references-errors, r=eholk 2022-12-17 00:45:52 +01:00
rustc_hir_pretty more clippy::complexity fixes 2022-12-15 00:09:10 +01:00
rustc_hir_typeck Rollup merge of #105710 - compiler-errors:dyn-star-rigid-cast, r=eholk 2022-12-17 00:45:51 +01:00
rustc_incremental compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_index minor code cleanups 2022-12-12 19:49:53 +01:00
rustc_infer Auto merge of #105657 - oli-obk:mk_projection_ty, r=lcnr 2022-12-15 04:21:25 +00:00
rustc_interface compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_lexer minor code cleanups 2022-12-12 19:49:53 +01:00
rustc_lint Rollup merge of #105768 - fee1-dead-contrib:iat-style, r=eholk 2022-12-17 00:45:52 +01:00
rustc_lint_defs Make the test actually emit the future incompat lint 2022-12-15 16:54:00 +00:00
rustc_llvm llvm-wrapper: adapt for LLVM API changes 2022-12-11 09:14:50 +00:00
rustc_log Use IsTerminal in rustc_log 2022-10-16 15:10:40 +01:00
rustc_macros more clippy::complexity fixes 2022-12-15 00:09:10 +01:00
rustc_metadata Auto merge of #102318 - Amanieu:default_alloc_error_handler, r=oli-obk 2022-12-16 21:08:45 +00:00
rustc_middle Rollup merge of #105770 - oli-obk:deref_all_the_things, r=compiler-errors 2022-12-17 09:25:53 +01:00
rustc_mir_build Auto merge of #103880 - b-naber:field-ty-mir, r=lcnr 2022-12-16 12:47:49 +00:00
rustc_mir_dataflow Auto merge of #103880 - b-naber:field-ty-mir, r=lcnr 2022-12-16 12:47:49 +00:00
rustc_mir_transform Auto merge of #105356 - JakobDegen:more-custom-mir, r=oli-obk 2022-12-15 19:59:48 +00:00
rustc_monomorphize wrap output in BufWriter 2022-12-14 20:17:52 +00:00
rustc_parse Rollup merge of #105502 - chenyukang:yukang/fix-105366-impl, r=estebank 2022-12-14 10:31:06 +01:00
rustc_parse_format Assert size of rustc_parse_format::Piece<'_> 2022-12-08 22:50:39 +00:00
rustc_passes Rollup merge of #105267 - compiler-errors:issue-104613, r=oli-obk 2022-12-07 15:39:06 +01:00
rustc_plugin_impl Migrate all diagnostics 2022-10-23 10:09:44 +02:00
rustc_privacy Prevent the creation of TraitRef without dedicated methods 2022-12-14 15:36:39 +00:00
rustc_query_impl Auto merge of #104940 - cjgillot:query-feed-simple, r=oli-obk 2022-11-30 17:20:14 +00:00
rustc_query_system Auto merge of #105233 - mejrs:always_eager, r=estebank 2022-12-14 16:16:50 +00:00
rustc_resolve Rollup merge of #104864 - chenyukang:yukang/fix-104700-binding, r=estebank 2022-12-13 01:17:08 +01:00
rustc_save_analysis compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_serialize compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_session Auto merge of #105421 - jacobbramley:jb/branch-prot-check, r=nagisa 2022-12-17 12:10:27 +00:00
rustc_smir Only keep one version of ImplicitSelfKind. 2022-09-13 19:18:23 +02:00
rustc_span Shorten trimmed display of closures 2022-12-15 11:13:44 -08:00
rustc_symbol_mangling Ensure no one constructs AliasTys themselves 2022-12-14 15:36:39 +00:00
rustc_target more clippy::complexity fixes 2022-12-15 00:09:10 +01:00
rustc_trait_selection Auto merge of #105717 - compiler-errors:anonymize, r=jackh726 2022-12-16 06:45:08 +00:00
rustc_traits Ensure no one constructs AliasTys themselves 2022-12-14 15:36:39 +00:00
rustc_transmute Auto merge of #103831 - chenyukang:yukang/fix-103751-ice, r=nagisa 2022-11-05 13:48:30 +00:00
rustc_ty_utils Rollup merge of #105623 - compiler-errors:generator-type-size-fix, r=Nilstrieb 2022-12-15 12:46:00 +01:00
rustc_type_ir more clippy::complexity fixes 2022-12-15 00:09:10 +01:00