about summary refs log tree commit diff
path: root/compiler/rustc_target/src/spec/apple_base.rs
AgeCommit message (Collapse)AuthorLines
2023-11-08target: move base specs to spec/baseDavid Wood-356/+0
Signed-off-by: David Wood <david@davidtw.co>
2023-09-23Raise minimum supported tvOS version to 10.0BlackHoleFox-1/+1
2023-09-23Raise minimum supported iOS version to 10.0BlackHoleFox-14/+13
Drop the armv7-apple-ios target too because its no longer supported with the hardware iOS 10 requires.
2023-09-23Raise minimum supported macOS to 10.12BlackHoleFox-21/+10
2023-08-22Add comment about unused sdk versionsKeith Smiley-0/+2
2023-08-21Use target.abi instead of string matching llvm_targetKeith Smiley-26/+10
2023-08-21Always add LC_BUILD_VERSION for metadata object filesKeith Smiley-3/+54
As of Xcode 15 Apple's linker has become a bit more strict about the warnings it produces. One of those new warnings requires all valid Mach-O object files in an archive to have a LC_BUILD_VERSION load command: ``` ld: warning: no platform load command found in 'ARCHIVE[arm64][2106](lib.rmeta)', assuming: iOS-simulator ``` This was already being done for Mac Catalyst so this change expands this logic to include it for all Apple platforms. I filed this behavior change as FB12546320 and was told it was the new intentional behavior.
2023-06-21Reorder `tvos_*` functions in apple_base.rs to avoid breaking sorted orderThom Chiovoloni-10/+12
2023-06-21Fix the tvOS targets to use the right LLVM target and respect the deployment ↵Thom Chiovoloni-1/+15
target environment variables
2023-05-05Add deployment-target --print flag for Apple targetsBlackHoleFox-11/+31
2023-03-05Add support for the x86_64h-apple-darwin targetThom Chiovoloni-5/+16
2023-01-05Fix `uninlined_format_args` for some compiler cratesnils-5/+5
Convert all the crates that have had their diagnostic migration completed (except save_analysis because that will be deleted soon and apfloat because of the licensing problem).
2022-12-15more clippy::complexity fixesMatthias Krüger-1/+1
2022-12-09Fix typo in apple_base.rsIkko Ashimine-1/+1
erronous -> erroneous
2022-12-02Fix passing MACOSX_DEPLOYMENT_TARGET to the linkerBlackHoleFox-23/+31
2022-11-05Cleanup Apple target specificationsBlackHoleFox-12/+27
2022-11-05Merge apple_base and apple_sdk_base into one moduleBlackHoleFox-12/+86
2022-10-06rustc_target: Refactor internal linker flavorsVadim Petrochenkov-12/+10
In accordance with the design from https://github.com/rust-lang/rust/pull/96827#issuecomment-1208441595
2022-08-27rustc_target: Use `Cow` and link args helpers in `apple_base`Vadim Petrochenkov-22/+19
2022-08-18session: stabilize split debuginfo on linuxDavid Wood-1/+7
Stabilize the `-Csplit-debuginfo` flag... - ...on Linux for all values of the flag. Split DWARF has been implemented for a few months, hasn't had any bug reports and has had some promising benchmarking for incremental debug build performance. - ..on other platforms for the default value. It doesn't make any sense that `-Csplit-debuginfo=packed` is unstable on Windows MSVC when that's the default behaviour, but keep the other values unstable. Signed-off-by: David Wood <david.wood@huawei.com>
2022-08-09Add support for link-flavor rust-lld for macOSMary-5/+48
Also refactor iOS, watchOS and tvOS common code.
2022-08-03Add support for link-flavor rust-lld for iOS, tvOS and watchOSmary-0/+19
This adds support for rust-lld for Apple *OS targets. This was tested against targets "aarch64-apple-ios" and "aarch64-apple-ios-sim". For targets "armv7-apple-ios" and "armv7s-apple-ios", it doesn't link because of "symbols.o" not being generated with the correct CPU subtype (changes in the "object" crate needs to be done to support it).
2022-07-11rustc_target: Flip the default for `TargetOptions::executables` to trueVadim Petrochenkov-1/+0
Also change `executables` to true for linux-kernel and windows-uwp-gnu targets
2022-07-08Implement support for DWARF version 5.Patrick Walton-1/+1
DWARF version 5 brings a number of improvements over version 4. Quoting from the announcement [1]: > Version 5 incorporates improvements in many areas: better data compression, > separation of debugging data from executable files, improved description of > macros and source files, faster searching for symbols, improved debugging > optimized code, as well as numerous improvements in functionality and > performance. On platforms where DWARF version 5 is supported (Linux, primarily), this commit adds support for it behind a new `-Z dwarf-version=5` flag. [1]: https://dwarfstd.org/Public_Review.php
2022-06-13Add Apple WatchOS compile targetsVladimir Michael Eatwell-0/+9
2022-04-03Cleanup after some refactoring in rustc_targetLoïc BRANSTETT-3/+1
2022-04-03Replace every Vec in Target(Options) with it's Cow equivalentLoïc BRANSTETT-2/+4
2022-04-03Replace every `String` in Target(Options) with `Cow<'static, str>`Loïc BRANSTETT-11/+11
2021-12-17Rename `has_elf_tls` to `has_thread_local`Chris Denton-2/+2
2021-12-13Revert "Set MACOSX_DEPLOYMENT_TARGET env var to default for linking if not set."Hans Kratz-12/+0
This reverts commit b376f5621b801460b911a75048a70698021bbc69, which is the main part of #90499, because it turns out that this causes a good amount of breakage in crates relying on the old behavior. Fixes #91372.
2021-11-25Set MACOSX_DEPLOYMENT_TARGET env var to default for linking if not set.Hans Kratz-0/+12
2021-11-25Set the default deployment target for Macos ARM64 to 11.0.Hans Kratz-6/+13
11.0 (Big Sur) is the first version which supports ARM64 so we use that as default.
2021-08-29Auto merge of #88250 - rusticstuff:macos-lld, r=nagisabors-1/+2
Make `-Z gcc-ld=lld` work for Apple targets `-Z gcc-ld=lld` was introduced in #85961. It does not work on Macos because lld needs be either named `ld64` or passed `-flavor darwin` as the first two arguments in order to select the Mach-O flavor. Rust invokes cc (=clang) on Macos for linking which calls `ld` as linker binary and not `ld64`, so just creating an `ld64` binary and modifying the search path with `-B` does not work. In order to solve this patch does: * Set the `lld_flavor` for all Apple-derived targets to `LldFlavor::Ld64`. As far as I can see this actually works towards fixing `-Xlinker=rust-lld` as all those targets use the Mach-O object format. * Copy/hardlink rust-lld to the gcc-ld subdirectory as ld64 next to ld. * If `-Z gcc-ld=lld` is used and the target lld flavor is Ld64 add `-fuse-ld=/path/to/ld64` to the linker invocation. Fixes #86945.
2021-08-24allow specifying an ios version for the llvm targetPatrick Amrein-0/+6
2021-08-23Mach-O (Macos/ios/...) LLD flavor is always LD64.Hans Kratz-1/+2
2021-08-16Generate an iOS LLVM target with a specific versionkit-0/+5
Without the specific version, the mach-o header will be missing the minimum supported operating system version. This is mandatory for running Rust binaries on iOS devices.
2021-06-30Add support for leaf fn frame pointer eliminationSimonas Kazlauskas-2/+2
This PR adds ability for the target specifications to specify frame pointer emission type that's not just “always” or “whatever cg decides”. In particular there's a new mode that allows omission of the frame pointer for leaf functions (those that don't call any other functions). We then set this new mode for Aarch64-based Apple targets. Fixes #86196
2021-06-02Turn off frame pointer elimination on all Apple platforms.Jeff Muizelaar-0/+1
This ends up disabling frame pointer elimination on aarch64_apple_darwin which matches what clang does by default along with the aarch64_apple_ios and x86_64_apple_darwin targets. Further, the Apple docs "Writing ARM64 Code for Apple Platforms" has a section called "Respect the Purpose of Specific CPU Registers" which specifically calls out the frame pointer register (x29): The frame pointer register (x29) must always address a valid frame record. Some functions — such as leaf functions or tail calls — may opt not to create an entry in this list As a result, stack traces are always meaningful, even without debug information. Other platforms are updated to not override the default.
2021-05-20Swap TargetOptions::linker_is_gnu default from false to true and update ↵Luqman Aden-0/+1
targets as appropriate.
2021-04-11Allow setting `target_family` to multiple valuesSimonas Kazlauskas-1/+1
This enables us to set more generic labels shared between targets. For example `target_family="wasm"` across all targets that are conceptually "wasm". See https://github.com/rust-lang/reference/pull/1006
2021-04-05rustc_target: Rely on defaults more in target specsVadim Petrochenkov-3/+1
2021-02-20iOS simulator: pick the target based on the environment variableJan-Erik Rediger-5/+16
LLVM picks the right things to put into the compiled object file based on the target deployment version. We need to communicate it through the target triple. Only with that LLVM will use the right commands in the file to make it look and behave like code compiled for the arm64 iOS simulator target.
2021-01-28rustc: Stabilize `-Zrun-dsymutil` as `-Csplit-debuginfo`Alex Crichton-1/+5
This commit adds a new stable codegen option to rustc, `-Csplit-debuginfo`. The old `-Zrun-dsymutil` flag is deleted and now subsumed by this stable flag. Additionally `-Zsplit-dwarf` is also subsumed by this flag but still requires `-Zunstable-options` to actually activate. The `-Csplit-debuginfo` flag takes one of three values: * `off` - This indicates that split-debuginfo from the final artifact is not desired. This is not supported on Windows and is the default on Unix platforms except macOS. On macOS this means that `dsymutil` is not executed. * `packed` - This means that debuginfo is desired in one location separate from the main executable. This is the default on Windows (`*.pdb`) and macOS (`*.dSYM`). On other Unix platforms this subsumes `-Zsplit-dwarf=single` and produces a `*.dwp` file. * `unpacked` - This means that debuginfo will be roughly equivalent to object files, meaning that it's throughout the build directory rather than in one location (often the fastest for local development). This is not the default on any platform and is not supported on Windows. Each target can indicate its own default preference for how debuginfo is handled. Almost all platforms default to `off` except for Windows and macOS which default to `packed` for historical reasons. Some equivalencies for previous unstable flags with the new flags are: * `-Zrun-dsymutil=yes` -> `-Csplit-debuginfo=packed` * `-Zrun-dsymutil=no` -> `-Csplit-debuginfo=unpacked` * `-Zsplit-dwarf=single` -> `-Csplit-debuginfo=packed` * `-Zsplit-dwarf=split` -> `-Csplit-debuginfo=unpacked` Note that `-Csplit-debuginfo` still requires `-Zunstable-options` for non-macOS platforms since split-dwarf support was *just* implemented in rustc. There's some more rationale listed on #79361, but the main gist of the motivation for this commit is that `dsymutil` can take quite a long time to execute in debug builds and provides little benefit. This means that incremental compile times appear that much worse on macOS because the compiler is constantly running `dsymutil` over every single binary it produces during `cargo build` (even build scripts!). Ideally rustc would switch to not running `dsymutil` by default, but that's a problem left to get tackled another day. Closes #79361
2020-12-07Dogfood 'str_split_once() with `compiler/`Eric Arellano-4/+1
2020-11-08rustc_target: Rename some target options to avoid tautologyVadim Petrochenkov-3/+3
`target.target_endian` -> `target.endian` `target.target_c_int_width` -> `target.c_int_width` `target.target_os` -> `target.os` `target.target_env` -> `target.env` `target.target_vendor` -> `target.vendor` `target.target_family` -> `target.os_family` `target.target_mcount` -> `target.mcount`
2020-11-07rustc_target: Move `target_vendor` from `Target` to `TargetOptions`Vadim Petrochenkov-0/+1
2020-11-07rustc_target: Move `target_os` from `Target` to `TargetOptions`Vadim Petrochenkov-1/+2
2020-10-13Add a target option for selecting a DWARF versionAustin Shafer-0/+1
Certain platforms need to limit the DWARF version emitted (oxs, *bsd). This change adds a dwarf_version entry to the options that allows a platform to specify the dwarf version to use. By default this option is none and the default DWARF version is selected. Also adds an option for printing Option<u32> json keys
2020-08-30mv compiler to compiler/mark-0/+82