rust/compiler
bors d137783642 Auto merge of #102900 - abrachet:master, r=bjorn3
Don't internalize __llvm_profile_counter_bias

Currently, LLVM profiling runtime counter relocation cannot be used by rust during LTO because symbols are being internalized before all symbol information is known.

This mode makes LLVM emit a __llvm_profile_counter_bias symbol which is referenced by the profiling initialization, which itself is pulled in by the rust driver here [1].

It is enabled with -Cllvm-args=-runtime-counter-relocation for platforms which are opt-in to this mode like Linux. On these platforms there will be no link error, rather just surprising behavior for a user which request runtime counter relocation. The profiling runtime will not see that symbol go on as if it were never there. On Fuchsia, the profiling runtime must have this symbol which will cause a hard link error.

As an aside, I don't have enough context as to why rust's LTO model is how it is. AFAICT, the internalize pass is only safe to run at link time when all symbol information is actually known, this being an example as to why. I think special casing this symbol as a known one that LLVM can emit which should not have it's visbility de-escalated should be fine given how seldom this pattern of defining an undefined symbol to get initilization code pulled in is. From a quick grep, __llvm_profile_runtime is the only symbol that rustc does this for.

[1] 0265a3e93b/compiler/rustc_codegen_ssa/src/back/linker.rs (L598)
2022-12-11 14:42:45 +00:00
..
rustc rustc: Use unix_sigpipe instead of rustc_driver::set_sigpipe_handler 2022-10-02 17:49:36 +02:00
rustc_abi compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +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 compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_ast_lowering compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_ast_passes Auto merge of #104861 - nnethercote:attr-cleanups, r=petrochenkov 2022-12-01 07:13:45 +00:00
rustc_ast_pretty Remove outdated syntax from trait alias pretty printing 2022-12-06 13:45:11 +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 Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
rustc_builtin_macros Rollup merge of #105537 - kadiwa4:remove_some_imports, r=fee1-dead 2022-12-11 09:51:57 +01:00
rustc_codegen_cranelift Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
rustc_codegen_gcc Rollup merge of #105109 - rcvalle:rust-kcfi, r=bjorn3 2022-12-10 09:24:43 +01:00
rustc_codegen_llvm Auto merge of #102900 - abrachet:master, r=bjorn3 2022-12-11 14:42:45 +00:00
rustc_codegen_ssa Rollup merge of #105537 - kadiwa4:remove_some_imports, r=fee1-dead 2022-12-11 09:51:57 +01:00
rustc_const_eval Rollup merge of #105537 - kadiwa4:remove_some_imports, r=fee1-dead 2022-12-11 09:51:57 +01:00
rustc_data_structures compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_driver compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_error_codes compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_error_messages Migrate parts of rustc_expand to session diagnostics 2022-12-10 11:02:41 +01:00
rustc_errors Rollup merge of #105537 - kadiwa4:remove_some_imports, r=fee1-dead 2022-12-11 09:51:57 +01:00
rustc_expand Rollup merge of #105537 - kadiwa4:remove_some_imports, r=fee1-dead 2022-12-11 09:51:57 +01:00
rustc_feature Rollup merge of #105109 - rcvalle:rust-kcfi, r=bjorn3 2022-12-10 09:24:43 +01: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 compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_hir_analysis Rollup merge of #105537 - kadiwa4:remove_some_imports, r=fee1-dead 2022-12-11 09:51:57 +01:00
rustc_hir_pretty Remove outdated syntax from trait alias pretty printing 2022-12-06 13:45:11 +00:00
rustc_hir_typeck Rollup merge of #105542 - compiler-errors:confirm-nits, r=jackh726 2022-12-11 00:30:21 +01:00
rustc_incremental compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_index compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_infer Rollup merge of #105443 - compiler-errors:move-more, r=oli-obk 2022-12-09 07:25:46 +01:00
rustc_interface compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_lexer compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_lint Rollup merge of #105537 - kadiwa4:remove_some_imports, r=fee1-dead 2022-12-11 09:51:57 +01:00
rustc_lint_defs Make deref_into_dyn_supertrait lint the impl and not the usage 2022-11-23 15:40:27 +00:00
rustc_llvm Rollup merge of #105109 - rcvalle:rust-kcfi, r=bjorn3 2022-12-10 09:24:43 +01:00
rustc_log Use IsTerminal in rustc_log 2022-10-16 15:10:40 +01:00
rustc_macros Auto merge of #105220 - oli-obk:feeding, r=cjgillot 2022-12-06 03:47:41 +00:00
rustc_metadata compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_middle Rollup merge of #105537 - kadiwa4:remove_some_imports, r=fee1-dead 2022-12-11 09:51:57 +01:00
rustc_mir_build Rollup merge of #105537 - kadiwa4:remove_some_imports, r=fee1-dead 2022-12-11 09:51:57 +01:00
rustc_mir_dataflow Rollup merge of #105537 - kadiwa4:remove_some_imports, r=fee1-dead 2022-12-11 09:51:57 +01:00
rustc_mir_transform Rollup merge of #105537 - kadiwa4:remove_some_imports, r=fee1-dead 2022-12-11 09:51:57 +01:00
rustc_monomorphize compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_parse compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +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 drive-by: move field_index to typeck results 2022-12-04 17:59:21 +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 compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_resolve Fold Definitions into the untracked data 2022-12-09 14:59:39 +00: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 compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_smir Only keep one version of ImplicitSelfKind. 2022-09-13 19:18:23 +02:00
rustc_span compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_symbol_mangling Rollup merge of #105109 - rcvalle:rust-kcfi, r=bjorn3 2022-12-10 09:24:43 +01:00
rustc_target compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_trait_selection Introduce with_forced_trimmed_paths 2022-12-10 14:35:40 -08:00
rustc_traits Move some suggestions from error_reporting to error_reporting::suggest 2022-12-08 05:58:30 +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 #105082 - Swatinem:async-abi, r=compiler-errors 2022-12-10 09:24:43 +01:00
rustc_type_ir compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00