rust/compiler
Matthias Krüger b7b4d7742e
Rollup merge of #91470 - wesleywiser:code_coverage_link_error, r=tmandry
code-cov: generate dead functions with private/default linkage

As discovered in #85461, the MSVC linker treats weak symbols slightly
differently than unix-y linkers do. This causes link.exe to fail with
LNK1227 "conflicting weak extern definition" where as other targets are
able to link successfully.

This changes the dead functions from being generated as weak/hidden to
private/default which, as the LLVM reference says:

> Global values with “private” linkage are only directly accessible by
objects in the current module. In particular, linking code into a module
with a private global value may cause the private to be renamed as
necessary to avoid collisions. Because the symbol is private to the
module, all references can be updated. This doesn’t show up in any
symbol table in the object file.

This fixes the conflicting weak symbols but doesn't address the reason
*why* we have conflicting symbols for these dead functions. The test
cases added in this commit contain a minimal repro of the fundamental
issue which is that the logic used to decide what dead code functions
should be codegen'd in the current CGU doesn't take into account that
functions can be duplicated across multiple CGUs (for instance, in the
case of `#[inline(always)]` functions).

Fixing that is likely to be a more complex change (see
https://github.com/rust-lang/rust/issues/85461#issuecomment-985005805).

Fixes #85461
2021-12-10 22:40:32 +01:00
..
rustc
rustc_apfloat
rustc_arena
rustc_ast
rustc_ast_lowering
rustc_ast_passes
rustc_ast_pretty Pretty print break and continue without redundant space 2021-12-08 14:35:20 -08:00
rustc_attr
rustc_borrowck
rustc_builtin_macros Implement concat_bytes! 2021-12-06 21:05:13 -05:00
rustc_codegen_cranelift
rustc_codegen_gcc Rollup merge of #90796 - Amanieu:remove_reg_thumb, r=joshtriplett 2021-12-09 05:08:32 +01:00
rustc_codegen_llvm Rollup merge of #91470 - wesleywiser:code_coverage_link_error, r=tmandry 2021-12-10 22:40:32 +01:00
rustc_codegen_ssa Rollup merge of #90796 - Amanieu:remove_reg_thumb, r=joshtriplett 2021-12-09 05:08:32 +01:00
rustc_const_eval Rollup merge of #91551 - b-naber:const-eval-normalization-ice, r=oli-obk 2021-12-08 16:08:07 +01:00
rustc_data_structures Annotate comments onto the LT algorithm 2021-12-06 20:30:15 -05:00
rustc_driver
rustc_error_codes
rustc_errors
rustc_expand Future compatibility warning on cfg_attr on crate_type and crate_name 2021-12-07 11:47:21 -05:00
rustc_feature
rustc_fs_util
rustc_graphviz
rustc_hir
rustc_hir_pretty Pretty print break and continue without redundant space 2021-12-08 14:35:20 -08:00
rustc_incremental Document all public items in rustc_incremental 2021-12-07 10:10:52 -06:00
rustc_index
rustc_infer Rollup merge of #90709 - estebank:erase-known-type-params, r=nagisa 2021-12-08 16:08:06 +01:00
rustc_interface Rollup merge of #91476 - m-ou-se:ferris-identifier, r=estebank 2021-12-09 05:02:20 +01:00
rustc_lexer
rustc_lint
rustc_lint_defs Future compatibility warning on cfg_attr on crate_type and crate_name 2021-12-07 11:47:21 -05:00
rustc_llvm Auto merge of #91284 - t6:freebsd-riscv64, r=Amanieu 2021-12-06 03:51:05 +00:00
rustc_macros
rustc_metadata
rustc_middle Rollup merge of #91551 - b-naber:const-eval-normalization-ice, r=oli-obk 2021-12-08 16:08:07 +01:00
rustc_mir_build
rustc_mir_dataflow
rustc_mir_transform Use Vec extend instead of repeated pushes in several places 2021-12-08 22:57:33 +01:00
rustc_monomorphize
rustc_parse Rollup merge of #91634 - terrarier2111:fix-recover-from-variant-ice, r=nagisa 2021-12-09 05:08:33 +01:00
rustc_parse_format
rustc_passes
rustc_plugin_impl
rustc_privacy
rustc_query_impl
rustc_query_system
rustc_resolve
rustc_save_analysis
rustc_serialize avoid string validation in rustc_serialize, check a marker byte instead 2021-12-06 18:43:01 +01:00
rustc_session
rustc_span Auto merge of #91692 - matthiaskrgr:rollup-u7dvh0n, r=matthiaskrgr 2021-12-09 07:08:32 +00:00
rustc_symbol_mangling
rustc_target Remove the reg_thumb register class for asm! on ARM 2021-12-07 23:54:09 +00:00
rustc_trait_selection Use Vec extend instead of repeated pushes in several places 2021-12-08 22:57:33 +01:00
rustc_traits
rustc_ty_utils
rustc_type_ir
rustc_typeck Rollup merge of #91042 - Kobzol:vec-extend-cleanup, r=nagisa 2021-12-09 05:08:33 +01:00