rust/compiler/rustc_codegen_ssa/src
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
..
back Rollup merge of #111384 - bmisiak:issue-106021-fix, r=petrochenkov 2023-05-26 08:24:07 +02:00
coverageinfo Isolate coverage FFI type layouts from their underlying LLVM C++ types 2023-05-09 18:08:32 +10:00
debuginfo Restrict From<S> for {D,Subd}iagnosticMessage. 2023-05-03 08:44:39 +10:00
mir Remove ExpnKind::Inlined. 2023-05-25 16:43:14 +00:00
traits Rollup merge of #110145 - WaffleLapkin:share_slice_of_bytes, r=Nilstrieb 2023-05-17 11:13:55 +05:30
base.rs Move DebuggerVisualizerFile types from rustc_span to rustc_middle 2023-05-16 21:03:28 +02:00
codegen_attrs.rs Move expansion of query macros in rustc_middle to rustc_middle::query 2023-05-15 08:49:13 +02:00
common.rs DELETE - fn span_invalid_monomorphization_error and localize intrinsics macros 2022-12-27 20:59:22 -05:00
errors.rs Fix static string lints 2023-04-25 18:59:55 +01:00
glue.rs Use size_of_val instead of manual calculation 2023-03-17 19:55:49 -07:00
lib.rs Auto merge of #111641 - michaelwoerister:debugger-visualizer-fixes, r=cjgillot 2023-05-19 11:30:44 +00:00
meth.rs Add cross-language LLVM CFI support to the Rust compiler 2023-05-03 22:41:29 +00:00
mono_item.rs Store a LocalDefId in hir::AnonConst. 2022-11-13 14:06:11 +00:00
target_features.rs Rollup merge of #110884 - korran:unaligned-scalar-mem, r=wesleywiser 2023-05-18 10:52:33 +05:30