rust/compiler
Urgau 5ec56e5fbb
Rollup merge of #136659 - wesleywiser:dwarf_version_lto_merge_behavior, r=jieyouxu
Pick the max DWARF version when LTO'ing modules with different versions

Currently, when rustc compiles code with `-Clto` enabled that was built
with different choices for `-Zdwarf-version`, a warning will be
reported. It's very easy to observe this by compiling most anything (eg,
"hello world") and specifying `-Clto -Zdwarf-version=5` since the
standard library is distributed with `-Zdwarf-version=4`.

This behavior isn't actually useful for a few reasons:
- From observation, LLVM chooses to pick the highest DWARF version
  anyway after issuing the warning.
- Clang specifies that in this case, the max version should be picked
  without a warning and as a general principle, we want to support
  x-lang LTO with Clang which implies using the same module flag merge
  behaviors.
- Debuggers need to be able to handle a variety of versions within the
  same debugging session as you can easily have some parts of a binary
  (or some dynamic libraries within an application) all compiled with
  different DWARF versions.

This commit changes the module flag merge behavior to match Clang and
use the highest version of DWARF. It also adds a test to ensure this
behavior is respected in the case of two crates being LTO'd together and
adds a test to ensure no warning is printed.

Fixes #130041 which fails due to these warnings being printed

cc #103057
2025-02-09 00:37:28 +01:00
..
rustc
rustc_abi compiler: reorganize rustc_abi to be more internally uniform 2025-02-06 01:39:46 -08:00
rustc_arena Add inherent versions of MaybeUninit methods for slices 2025-01-11 23:57:00 -05:00
rustc_ast Auto merge of #136471 - safinaskar:parallel, r=SparrowLii 2025-02-06 10:50:05 +00:00
rustc_ast_ir
rustc_ast_lowering Auto merge of #136471 - safinaskar:parallel, r=SparrowLii 2025-02-06 10:50:05 +00:00
rustc_ast_passes Rename rustc_contract to contract 2025-02-03 13:55:15 -08:00
rustc_ast_pretty Auto merge of #136471 - safinaskar:parallel, r=SparrowLii 2025-02-06 10:50:05 +00:00
rustc_attr_data_structures rustc_allowed_through_unstable_modules: require deprecation message 2025-02-02 12:36:12 +01:00
rustc_attr_parsing rustc_allowed_through_unstable_modules: require deprecation message 2025-02-02 12:36:12 +01:00
rustc_baked_icu_data
rustc_borrowck Add opt_alias_variances and use it in outlives code 2025-02-06 15:16:27 +00:00
rustc_builtin_macros Auto merge of #136471 - safinaskar:parallel, r=SparrowLii 2025-02-06 10:50:05 +00:00
rustc_codegen_cranelift Merge commit '8332329f83' into sync_cg_clif-2025-02-07 2025-02-07 20:58:27 +00:00
rustc_codegen_gcc Remove Linkage::Appending 2025-02-07 16:02:19 +00:00
rustc_codegen_llvm Rollup merge of #136659 - wesleywiser:dwarf_version_lto_merge_behavior, r=jieyouxu 2025-02-09 00:37:28 +01:00
rustc_codegen_ssa Remove Linkage::Appending 2025-02-07 16:02:19 +00:00
rustc_const_eval Rollup merge of #136235 - oli-obk:transmuty-pat-tys, r=RalfJung 2025-02-06 13:09:58 +01:00
rustc_data_structures Rollup merge of #136580 - bjorn3:miri_fixes, r=lqd 2025-02-06 21:56:27 +01:00
rustc_driver
rustc_driver_impl Rollup merge of #136636 - bjorn3:error_cleanup, r=compiler-errors 2025-02-06 21:56:28 +01:00
rustc_error_codes Auto merge of #133154 - estebank:issue-133137, r=wesleywiser 2025-01-25 11:41:21 +00:00
rustc_error_messages tree-wide: parallel: Fully removed all Lrc, replaced with Arc 2025-02-03 13:25:57 +03:00
rustc_errors Rollup merge of #136636 - bjorn3:error_cleanup, r=compiler-errors 2025-02-06 21:56:28 +01:00
rustc_expand tree-wide: parallel: Fully removed all Lrc, replaced with Arc 2025-02-03 13:25:57 +03:00
rustc_feature Rollup merge of #134367 - WaffleLapkin:trait_upcasting_as_a_treat, r=compiler-errors 2025-02-07 18:26:25 +01:00
rustc_fluent_macro
rustc_fs_util
rustc_graphviz
rustc_hir Rollup merge of #136219 - yotamofek:pr/hir-cleanup, r=compiler-errors 2025-02-06 21:56:26 +01:00
rustc_hir_analysis Rollup merge of #136073 - compiler-errors:recursive-coro-always, r=oli-obk 2025-02-06 13:09:57 +01:00
rustc_hir_pretty Add rustc_hir_pretty::item_to_string function 2025-02-06 14:45:28 +01:00
rustc_hir_typeck Auto merge of #136728 - matthiaskrgr:rollup-x2qh9yt, r=matthiaskrgr 2025-02-08 12:57:59 +00:00
rustc_incremental Remove hook calling via TyCtxtAt. 2025-02-03 17:02:33 +11:00
rustc_index Run clippy --fix for unnecessary_map_or lint 2025-01-19 19:15:00 +00:00
rustc_index_macros
rustc_infer Add opt_alias_variances and use it in outlives code 2025-02-06 15:16:27 +00:00
rustc_interface Rollup merge of #136589 - GuillaumeGomez:enable-jump-to-def-compiler, r=oli-obk 2025-02-07 21:31:01 +01:00
rustc_lexer implement eat_until leveraging memchr in lexer 2025-02-05 07:03:53 -08:00
rustc_lint allow+update deref_into_dyn_supertrait 2025-02-06 23:44:24 +01:00
rustc_lint_defs Rollup merge of #135964 - ehuss:cenum_impl_drop_cast, r=Nadrieril 2025-02-05 19:09:33 +08:00
rustc_llvm Remove dead code from rustc_codegen_llvm and the LLVM wrapper 2025-02-06 16:53:52 -08:00
rustc_log
rustc_macros Rename ensure_forwards_result_if_red to return_result_from_ensure_ok 2025-02-01 12:42:41 +11:00
rustc_metadata Auto merge of #136471 - safinaskar:parallel, r=SparrowLii 2025-02-06 10:50:05 +00:00
rustc_middle occured -> occurred 2025-02-08 22:28:21 +00:00
rustc_mir_build Rollup merge of #136577 - dianne:simple-pat-migration-simplification, r=Nadrieril 2025-02-07 18:26:27 +01:00
rustc_mir_dataflow Contracts core intrinsics. 2025-02-03 12:53:57 -08:00
rustc_mir_transform Detect (non-raw) borrows of null ZST pointers in CheckNull 2025-02-08 21:38:16 +00:00
rustc_monomorphize Remove Linkage::Appending 2025-02-07 16:02:19 +00:00
rustc_next_trait_solver Rollup merge of #136664 - WaffleLapkin:un-map_or-true, r=compiler-errors 2025-02-07 18:26:29 +01:00
rustc_parse Rollup merge of #136191 - klensy:const_a, r=compiler-errors 2025-02-07 12:01:57 +01:00
rustc_parse_format use impl Into<String> 2025-01-29 09:48:08 +01:00
rustc_passes Rollup merge of #133925 - folkertdev:improve-repr-warnings, r=compiler-errors 2025-02-06 21:56:24 +01:00
rustc_pattern_analysis Get rid of mir::Const::from_ty_const 2025-01-20 04:26:44 +00:00
rustc_privacy Make comma separated lists of anything easier to make for errors 2025-01-31 20:36:44 +00:00
rustc_query_impl Remove hook calling via TyCtxtAt. 2025-02-03 17:02:33 +11:00
rustc_query_system Auto merge of #136471 - safinaskar:parallel, r=SparrowLii 2025-02-06 10:50:05 +00:00
rustc_resolve Auto merge of #136471 - safinaskar:parallel, r=SparrowLii 2025-02-06 10:50:05 +00:00
rustc_sanitizers check the types in ty::Value to value conversion 2025-01-30 18:13:16 +01:00
rustc_serialize
rustc_session Rollup merge of #136636 - bjorn3:error_cleanup, r=compiler-errors 2025-02-06 21:56:28 +01:00
rustc_smir Implement RustcInternal for RawPtrKind 2025-02-05 11:32:19 -05:00
rustc_span Auto merge of #136471 - safinaskar:parallel, r=SparrowLii 2025-02-06 10:50:05 +00:00
rustc_symbol_mangling Move try_to_raw_bytes from ty::Valtree to ty::Value 2025-02-03 18:33:27 +01:00
rustc_target i686-unknown-hurd-gnu: bump baseline CPU to Pentium 4 2025-02-07 18:49:22 +01:00
rustc_trait_selection stabilize feature(trait_upcasting) 2025-02-06 23:30:23 +01:00
rustc_traits Auto merge of #136011 - compiler-errors:query-norm-vaniquishes-us, r=jackh726 2025-01-29 02:12:12 +00:00
rustc_transmute introduce ty::Value 2025-01-30 17:47:44 +01:00
rustc_ty_utils Rollup merge of #136435 - Zalathar:thir-pat-stuff, r=Nadrieril 2025-02-06 13:10:00 +01:00
rustc_type_ir Auto merge of #136713 - matthiaskrgr:rollup-sy6py39, r=matthiaskrgr 2025-02-08 02:57:14 +00:00
rustc_type_ir_macros
stable_mir occured -> occurred 2025-02-08 22:28:21 +00:00