rust/compiler
Wesley Wiser bbc40e7822 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 withing 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
updates the test added in the previous commit to ensure no warning is
printed.
2025-02-08 16:33:36 +00:00
..
rustc
rustc_abi Auto merge of #135047 - Flakebi:amdgpu-kernel-cc, r=workingjubilee 2025-01-17 04:36:09 +00:00
rustc_arena Add inherent versions of MaybeUninit methods for slices 2025-01-11 23:57:00 -05:00
rustc_ast Express contracts as part of function header and lower it to the contract lang items 2025-02-03 12:54:00 -08:00
rustc_ast_ir
rustc_ast_lowering Rollup merge of #128045 - pnkfelix:rustc-contracts, r=oli-obk 2025-02-05 05:03:01 +01:00
rustc_ast_passes Rename rustc_contract to contract 2025-02-03 13:55:15 -08:00
rustc_ast_pretty Express contracts as part of function header and lower it to the contract lang items 2025-02-03 12:54:00 -08: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 Rollup merge of #128045 - pnkfelix:rustc-contracts, r=oli-obk 2025-02-05 05:03:01 +01:00
rustc_builtin_macros Rename rustc_contract to contract 2025-02-03 13:55:15 -08:00
rustc_codegen_cranelift Rollup merge of #136537 - tgross35:update-builtins, r=tgross35 2025-02-05 19:09:37 +08:00
rustc_codegen_gcc cg_gcc: Directly use rustc_abi instead of reexports 2025-02-04 22:31:56 -08:00
rustc_codegen_llvm Pick the max DWARF version when LTO'ing modules with different versions 2025-02-08 16:33:36 +00:00
rustc_codegen_ssa Rollup merge of #128045 - pnkfelix:rustc-contracts, r=oli-obk 2025-02-05 05:03:01 +01:00
rustc_const_eval Rollup merge of #128045 - pnkfelix:rustc-contracts, r=oli-obk 2025-02-05 05:03:01 +01:00
rustc_data_structures Auto merge of #136094 - davidv1992:upgrade-elsa, r=oli-obk 2025-02-05 10:15:02 +00:00
rustc_driver
rustc_driver_impl Use a different hir type for patterns in pattern types than we use in match patterns 2025-02-03 08:18:30 +00:00
rustc_error_codes Auto merge of #133154 - estebank:issue-133137, r=wesleywiser 2025-01-25 11:41:21 +00:00
rustc_error_messages
rustc_errors Rollup merge of #136445 - bjorn3:diag_ctxt_cleanup, r=oli-obk 2025-02-02 23:06:57 +01:00
rustc_expand Auto merge of #134478 - compiler-errors:attr-span, r=oli-obk 2025-01-22 14:46:41 +00:00
rustc_feature Rollup merge of #128045 - pnkfelix:rustc-contracts, r=oli-obk 2025-02-05 05:03:01 +01:00
rustc_fluent_macro
rustc_fs_util
rustc_graphviz
rustc_hir Rollup merge of #128045 - pnkfelix:rustc-contracts, r=oli-obk 2025-02-05 05:03:01 +01:00
rustc_hir_analysis Rollup merge of #128045 - pnkfelix:rustc-contracts, r=oli-obk 2025-02-05 05:03:01 +01:00
rustc_hir_pretty Use a different hir type for patterns in pattern types than we use in match patterns 2025-02-03 08:18:30 +00:00
rustc_hir_typeck Rollup merge of #136304 - oli-obk:push-ymxoklvzrpvx, r=Nadrieril 2025-02-05 19:09:34 +08: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 Move unify_key module. 2025-02-02 17:38:19 +11:00
rustc_interface Auto merge of #133138 - azhogin:azhogin/target-modifiers, r=davidtwco,saethlin 2025-02-03 07:16:57 +00:00
rustc_lexer
rustc_lint Rollup merge of #135964 - ehuss:cenum_impl_drop_cast, r=Nadrieril 2025-02-05 19:09:33 +08: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 Use LLVMDIBuilderCreateDebugLocation 2025-02-01 14:14:40 +11:00
rustc_log Avoid naming variables str 2025-01-07 14:30:02 +02:00
rustc_macros Rename ensure_forwards_result_if_red to return_result_from_ensure_ok 2025-02-01 12:42:41 +11:00
rustc_metadata Rollup merge of #136464 - nnethercote:rm-TyCtxtAt-for-hooks, r=oli-obk 2025-02-03 19:13:29 +08:00
rustc_middle Rollup merge of #128045 - pnkfelix:rustc-contracts, r=oli-obk 2025-02-05 05:03:01 +01:00
rustc_mir_build Auto merge of #136302 - oli-obk:push-vvqmwzunxsrk, r=compiler-errors 2025-02-05 15:10:28 +00:00
rustc_mir_dataflow Contracts core intrinsics. 2025-02-03 12:53:57 -08:00
rustc_mir_transform Contracts core intrinsics. 2025-02-03 12:53:57 -08:00
rustc_monomorphize Auto merge of #136481 - jieyouxu:rollup-w0lnnqb, r=jieyouxu 2025-02-03 16:42:25 +00:00
rustc_next_trait_solver introduce ty::Value 2025-01-30 17:47:44 +01:00
rustc_parse Rename rustc_contract to contract 2025-02-03 13:55:15 -08:00
rustc_parse_format use impl Into<String> 2025-01-29 09:48:08 +01:00
rustc_passes Use a different hir type for patterns in pattern types than we use in match patterns 2025-02-03 08:18:30 +00: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 Rollup merge of #136465 - nnethercote:rustc_middle-MORE, r=jieyouxu 2025-02-04 05:38:03 -05:00
rustc_resolve Express contracts as part of function header and lower it to the contract lang items 2025-02-03 12:54:00 -08:00
rustc_sanitizers check the types in ty::Value to value conversion 2025-01-30 18:13:16 +01:00
rustc_serialize
rustc_session Separate contract feature gates for the internal machinery 2025-02-03 13:55:15 -08:00
rustc_smir Contracts core intrinsics. 2025-02-03 12:53:57 -08:00
rustc_span Rollup merge of #128045 - pnkfelix:rustc-contracts, r=oli-obk 2025-02-05 05:03:01 +01: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 Rollup merge of #136154 - taiki-e:ppc-secure-plt, r=nikic 2025-02-05 19:09:34 +08:00
rustc_trait_selection Rollup merge of #136520 - compiler-errors:redundant-layout-assert, r=lcnr 2025-02-04 18:49:41 +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 #136279 - Zalathar:ensure-ok, r=oli-obk 2025-02-02 12:31:55 +01:00
rustc_type_ir TypeVisitable doesn't require Clone. 2025-02-03 10:12:40 +11:00
rustc_type_ir_macros
stable_mir Contracts core intrinsics. 2025-02-03 12:53:57 -08:00