rust/compiler
Matthias Krüger 42c7b8a7de
Rollup merge of #111384 - bmisiak:issue-106021-fix, r=petrochenkov
Fix linking Mac Catalyst by including LC_BUILD_VERSION in object files

Hello. My first rustc PR!

Issue #106021 prevents Rust code from being linked into Mac Catalyst applications. Apple's LD has started requiring object files to contain version information about the platform they were built for, such as:
* the "deployment target" (minimum supported OS version),
* the SDK version
* the type of the platform (macOS/iOS/catalyst/tvOS/watchOS all have a different number).

This is currently only enforced when building for Mac Catalyst.

Rust uses the `object` crate which added support for including this information starting with `0.31.0`. ~~I upgraded it along with `thorin-dwp` so that everything depends on 0.31.
Apparently 0.31 [pulls in](https://github.com/gimli-rs/object/issues/463) `ruzstd` due to a [new ELF standard](https://maskray.me/blog/2022-09-09-zstd-compressed-debug-sections) because its `compression` feature is enabled by thorin. If you find this objectionable, let me know what the best way to avoid pulling in those dependencies might be.~~

**(`object` upgraded in https://github.com/rust-lang/rust/pull/111413)**

I then added two commits:
* The first one adds very basic, hard-coded support for calling `set_macho_build_version` for `-macabi` (Catalyst) targets, where it claims deployment target of Catalyst 14.0 and SDK of 16.2.
* The second weaves the versioning through `rust_target::spec::TargetOptions`, so that we can stick to specifying all target-related info in one place.

Kudos to ``@ara4n`` for writing [this gist](https://gist.github.com/ara4n/320a53ea768aba51afad4c9ed2168536).
2023-05-26 08:24:07 +02:00
..
rustc
rustc_abi Avoid &format("...") calls in error message code. 2023-05-16 17:59:56 +10:00
rustc_apfloat
rustc_arena Deny the unsafe_op_in_unsafe_fn lint in 2023-04-28 21:00:54 -07:00
rustc_ast Auto merge of #86844 - bjorn3:global_alloc_improvements, r=pnkfelix 2023-05-25 16:59:57 +00:00
rustc_ast_lowering Auto merge of #111858 - clubby789:fluent-alphabetical, r=jyn514,compiler-errors 2023-05-26 03:31:04 +00:00
rustc_ast_passes Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_ast_pretty Migrate offset_of from a macro to builtin # syntax 2023-05-05 21:44:13 +02:00
rustc_attr Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_baked_icu_data Regen baked data 2023-05-02 10:45:16 -07:00
rustc_borrowck Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_builtin_macros Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_codegen_cranelift Rollup merge of #111950 - cjgillot:expn-noinline, r=oli-obk 2023-05-25 13:58:02 -07:00
rustc_codegen_gcc Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_codegen_llvm Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_codegen_ssa Rollup merge of #111384 - bmisiak:issue-106021-fix, r=petrochenkov 2023-05-26 08:24:07 +02:00
rustc_const_eval Auto merge of #111858 - clubby789:fluent-alphabetical, r=jyn514,compiler-errors 2023-05-26 03:31:04 +00:00
rustc_data_structures Rollup merge of #111875 - WaffleLapkin:defer_on_drop, r=Nilstrieb 2023-05-25 08:01:08 +02:00
rustc_driver
rustc_driver_impl Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_error_codes Rollup merge of #111215 - BoxyUwU:resolve_anon_consts_differently, r=cjgillot 2023-05-09 20:49:32 +02:00
rustc_error_messages correct literals for dyn thread safe 2023-05-06 09:34:53 +08:00
rustc_errors Auto merge of #111858 - clubby789:fluent-alphabetical, r=jyn514,compiler-errors 2023-05-26 03:31:04 +00:00
rustc_expand Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_feature Use is_some_and/is_ok_and in less obvious spots 2023-05-24 14:33:43 +00:00
rustc_fluent_macro
rustc_fs_util
rustc_graphviz enable rust_2018_idioms for doctests 2023-05-07 00:12:29 +03:00
rustc_hir Use Option::is_some_and and Result::is_ok_and in the compiler 2023-05-24 14:20:41 +00:00
rustc_hir_analysis Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_hir_pretty Rip it out 2023-05-01 16:15:13 +08:00
rustc_hir_typeck Auto merge of #111858 - clubby789:fluent-alphabetical, r=jyn514,compiler-errors 2023-05-26 03:31:04 +00:00
rustc_incremental Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_index Auto merge of #111925 - Manishearth:rollup-z6z6l2v, r=Manishearth 2023-05-25 00:33:43 +00:00
rustc_infer Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_interface Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_lexer Don't try to eat non-existent decimal digits. 2023-05-15 18:33:12 +10:00
rustc_lint Auto merge of #111858 - clubby789:fluent-alphabetical, r=jyn514,compiler-errors 2023-05-26 03:31:04 +00:00
rustc_lint_defs Auto merge of #106621 - ozkanonur:enable-elided-lifetimes-for-doctests, r=Mark-Simulacrum 2023-05-08 04:50:28 +00:00
rustc_llvm Auto merge of #111364 - cuviper:unhack-thinlto, r=nikic 2023-05-18 01:35:41 +00:00
rustc_log
rustc_macros Merge query property modules into one 2023-05-18 09:45:12 +02:00
rustc_metadata Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_middle Auto merge of #111858 - clubby789:fluent-alphabetical, r=jyn514,compiler-errors 2023-05-26 03:31:04 +00:00
rustc_mir_build Auto merge of #111858 - clubby789:fluent-alphabetical, r=jyn514,compiler-errors 2023-05-26 03:31:04 +00:00
rustc_mir_dataflow Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_mir_transform Auto merge of #111858 - clubby789:fluent-alphabetical, r=jyn514,compiler-errors 2023-05-26 03:31:04 +00:00
rustc_monomorphize Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_parse Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_parse_format
rustc_passes Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_plugin_impl
rustc_privacy Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_query_impl Add comment 2023-05-21 11:25:07 +02:00
rustc_query_system Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_resolve Auto merge of #111858 - clubby789:fluent-alphabetical, r=jyn514,compiler-errors 2023-05-26 03:31:04 +00:00
rustc_serialize Fix the FileEncoder buffer size. 2023-05-15 08:59:11 +10:00
rustc_session Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_smir Encode types in SMIR 2023-05-08 14:23:19 +00:00
rustc_span Remove ExpnKind::Inlined. 2023-05-25 16:43:14 +00:00
rustc_symbol_mangling Use Option::is_some_and and Result::is_ok_and in the compiler 2023-05-24 14:20:41 +00:00
rustc_target Rollup merge of #111384 - bmisiak:issue-106021-fix, r=petrochenkov 2023-05-26 08:24:07 +02:00
rustc_trait_selection Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_traits Prepopulate opaques in canonical input 2023-05-25 03:21:22 +00:00
rustc_transmute Remove unused TypeFoldable/TypeVisitable impls. 2023-04-26 15:19:50 +10:00
rustc_ty_utils Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_type_ir Implement references VarDebugInfo. 2023-05-13 10:12:14 +00:00