rust/compiler
bors 821b2a8e39 Auto merge of #106925 - imWildCat:imWildCat/remove-hardcoded-ios-macbi-target-version, r=wesleywiser
Remove hardcoded iOS version of clang target for Mac Catalyst

## Background

From `clang` 13.x, `-target x86_64-apple-ios13.0-macabi` fails while linking:

```
  = note: clang: error: invalid version number in '-target x86_64-apple-ios13.0-macabi'
```

<details>
<summary>Verbose output</summary>

```
error: linking with `cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="[removed]" VSLANG="1033" ZERO_AR_DATE="1" "cc" "-Wl,-exported_symbols_list,/var/folders/p8/qpmzbsdn07g5gxykwfxxw7y40000gn/T/rustci8tkvp/list" "-target" "x86_64-apple-ios13.0-macabi" "/var/folders/p8/qpmzbsdn07g5gxykwfxxw7y40000gn/T/rustci8tkvp/symbols.o" "/path/to/my/[project]/[user]/target/x86_64-apple-ios-macabi/release/deps/[user].[user].a2ccc648-cgu.0.rcgu.o" "-L" "/path/to/my/[project]/[user]/target/x86_64-apple-ios-macabi/release/deps" "-L" "/path/to/my/[project]/[user]/target/release/deps" "-L" "/path/to/my/[project]/[user]/target/x86_64-apple-ios-macabi/release/build/blake3-74e6ba91506ce712/out" "-L" "/path/to/my/[project]/[user]/target/x86_64-apple-ios-macabi/release/build/blake3-74e6ba91506ce712/out" "-L" "/Users/[user]/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/x86_64-apple-ios-macabi/lib" "/var/folders/p8/qpmzbsdn07g5gxykwfxxw7y40000gn/T/rustci8tkvp/libblake3-343c1616c8f62c66.rlib" "/path/to/my/[project]/[user]/target/x86_64-apple-ios-macabi/release/deps/libcompiler_builtins-15d4f20b641cf9ef.rlib" "-framework" "Security" "-framework" "CoreFoundation" "-framework" "Security" "-liconv" "-lSystem" "-lobjc" "-framework" "Security" "-framework" "Foundation" "-lc" "-lm" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk" "-Wl,-syslibroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk" "-L" "/Users/[user]/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/x86_64-apple-ios-macabi/lib" "-o" "/path/to/my/[project]/[user]/target/x86_64-apple-ios-macabi/release/deps/lib[user].dylib" "-Wl,-dead_strip" "-dynamiclib" "-Wl,-dylib" "-nodefaultlibs"
  = note: clang: error: invalid version number in '-target x86_64-apple-ios13.0-macabi'

warning: `[user]` (lib) generated 6 warnings
error: could not compile `[user]` due to previous error; 6 warnings emitted
```
</details>

### Minimal example

C code:

```c
#include <stdio.h>
void main() {
    int a = 1;
    int b = 2;
    int c = a + b;
    printf("%d", c);
}
```

`clang` command sample:

```
➜  202301 clang -target x86_64-apple-ios13.0-macabi main.c
clang: error: invalid version number in '-target x86_64-apple-ios13.0-macabi'
➜  202301 clang -target x86_64-apple-ios14.0-macabi main.c
main.c:2:1: warning: return type of 'main' is not 'int' [-Wmain-return-type]
void main() {
^
main.c:2:1: note: change return type to 'int'
void main() {
^~~~
int
1 warning generated.
➜  202301 clang -target x86_64-apple-ios15.0-macabi main.c
main.c:2:1: warning: return type of 'main' is not 'int' [-Wmain-return-type]
void main() {
^
main.c:2:1: note: change return type to 'int'
void main() {
^~~~
int
1 warning generated.
➜  202301 clang -target x86_64-apple-ios-macabi main.c
main.c:2:1: warning: return type of 'main' is not 'int' [-Wmain-return-type]
void main() {
^
main.c:2:1: note: change return type to 'int'
void main() {
^~~~
int
1 warning generated.

➜  202301 clang --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin22.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
```

This PR is a simplified version of #96392, inspired by https://github.com/rust-lang/cc-rs/pull/727
2023-02-02 05:26:09 +00:00
..
rustc
rustc_abi PointeeInfo is advisory only 2023-01-31 18:49:03 +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 Replace enum ==s with matches where it makes sense 2023-01-30 12:26:26 +00:00
rustc_ast_lowering Remove HirId -> LocalDefId map from HIR. 2023-01-28 09:55:26 +00:00
rustc_ast_passes Autoderive ExternBlockSuggestion 2023-01-19 13:52:15 +01:00
rustc_ast_pretty Use Edition methods a bit more 2023-01-31 10:09:22 +00:00
rustc_attr Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_baked_icu_data
rustc_borrowck Rollup merge of #107467 - WaffleLapkin:uneq, r=oli-obk 2023-01-31 23:38:52 +01:00
rustc_builtin_macros Allow more deriving on packed structs. 2023-01-30 12:00:42 +11:00
rustc_codegen_cranelift Auto merge of #106227 - bryangarza:ctfe-limit, r=oli-obk 2023-01-29 04:11:27 +00:00
rustc_codegen_gcc session: diagnostic migration lint on more fns 2023-01-30 17:11:35 +00:00
rustc_codegen_llvm Rollup merge of #107412 - tshepang:needless-check, r=wesleywiser 2023-01-31 23:38:51 +01:00
rustc_codegen_ssa Auto merge of #107257 - inquisitivecrystal:ffi-attr, r=davidtwco 2023-02-01 11:37:24 +00:00
rustc_const_eval Rollup merge of #107467 - WaffleLapkin:uneq, r=oli-obk 2023-01-31 23:38:52 +01:00
rustc_data_structures Auto merge of #107297 - Mark-Simulacrum:bump-bootstrap, r=pietroalbini 2023-01-31 19:24:29 +00:00
rustc_driver session: diagnostic migration lint on more fns 2023-01-30 17:11:35 +00:00
rustc_error_codes make unaligned_reference a hard error 2023-01-31 20:28:11 +01:00
rustc_error_messages Make "use latest edition" subdiagnostic translatable 2023-02-01 21:56:28 +01:00
rustc_errors Make "use latest edition" subdiagnostic translatable 2023-02-01 21:56:28 +01:00
rustc_expand Rollup merge of #107467 - WaffleLapkin:uneq, r=oli-obk 2023-01-31 23:38:52 +01:00
rustc_feature Auto merge of #107297 - Mark-Simulacrum:bump-bootstrap, r=pietroalbini 2023-01-31 19:24:29 +00:00
rustc_fs_util Remove useless borrows and derefs 2022-12-01 17:34:43 +00:00
rustc_graphviz Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_hir Rollup merge of #107125 - WaffleLapkin:expect_an_item_in_your_hir_by_the_next_morning, r=Nilstrieb 2023-01-30 17:50:08 +01:00
rustc_hir_analysis Rollup merge of #107486 - compiler-errors:bound-ty-keep-name, r=oli-obk 2023-01-31 23:38:52 +01:00
rustc_hir_pretty Use Mutability::{is_mut, is_not} 2023-01-30 12:26:26 +00:00
rustc_hir_typeck Make "use latest edition" subdiagnostic translatable 2023-02-01 21:56:28 +01:00
rustc_incremental incremental: migrate diagnostics 2023-01-30 17:11:35 +00:00
rustc_index Fix IndexVec::drain_enumerated 2023-01-19 15:25:33 +00:00
rustc_infer Rollup merge of #107486 - compiler-errors:bound-ty-keep-name, r=oli-obk 2023-01-31 23:38:52 +01:00
rustc_interface session: diagnostic migration lint on more fns 2023-01-30 17:11:35 +00:00
rustc_lexer Remove double spaces after dots in comments 2023-01-17 08:09:33 +00:00
rustc_lint Auto merge of #107536 - GuillaumeGomez:rollup-xv7dx2h, r=GuillaumeGomez 2023-02-01 01:15:02 +00:00
rustc_lint_defs make unaligned_reference a hard error 2023-01-31 20:28:11 +01:00
rustc_llvm Rollup merge of #106113 - krasimirgg:llvm-16-ext-tyid, r=nikic 2023-01-21 23:20:58 -05:00
rustc_log Add log-backtrace option to show backtraces along with logging 2023-01-12 00:17:48 +09:00
rustc_macros Forbid #[suggestion_*(...)] on Vecs 2023-02-01 21:49:45 +01:00
rustc_metadata Rollup merge of #107467 - WaffleLapkin:uneq, r=oli-obk 2023-01-31 23:38:52 +01:00
rustc_middle Rollup merge of #107486 - compiler-errors:bound-ty-keep-name, r=oli-obk 2023-01-31 23:38:52 +01:00
rustc_mir_build Use Mutability::{is_mut, is_not} 2023-01-30 12:26:26 +00:00
rustc_mir_dataflow Create stable metric to measure long computation in Const Eval 2023-01-23 23:56:22 +00:00
rustc_mir_transform Auto merge of #107536 - GuillaumeGomez:rollup-xv7dx2h, r=GuillaumeGomez 2023-02-01 01:15:02 +00:00
rustc_monomorphize Auto merge of #100754 - davidtwco:translation-incremental, r=compiler-errors 2023-01-31 10:20:58 +00:00
rustc_parse Make "use latest edition" subdiagnostic translatable 2023-02-01 21:56:28 +01:00
rustc_parse_format Replace format flags u32 by enums and bools. 2023-01-27 08:53:39 +01:00
rustc_passes Auto merge of #107257 - inquisitivecrystal:ffi-attr, r=davidtwco 2023-02-01 11:37:24 +00:00
rustc_plugin_impl
rustc_privacy Remove HirId -> LocalDefId map from HIR. 2023-01-28 09:55:26 +00:00
rustc_query_impl Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_query_system Remove double spaces after dots in comments 2023-01-17 08:09:33 +00:00
rustc_resolve Rollup merge of #107508 - WaffleLapkin:uneq'15, r=oli-obk 2023-01-31 23:38:53 +01:00
rustc_save_analysis Review changes 2023-01-31 07:54:01 +00:00
rustc_serialize compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_session Rollup merge of #107533 - pnkfelix:distinguish-generator-state-in-print-type-sizes, r=compiler-errors 2023-02-01 05:54:40 +01:00
rustc_smir
rustc_span Don't accept Edition by ref 2023-01-31 10:09:23 +00:00
rustc_symbol_mangling Introduce GeneratorWitnessMIR. 2023-01-27 18:58:44 +00:00
rustc_target Auto merge of #106925 - imWildCat:imWildCat/remove-hardcoded-ios-macbi-target-version, r=wesleywiser 2023-02-02 05:26:09 +00:00
rustc_trait_selection Rollup merge of #107486 - compiler-errors:bound-ty-keep-name, r=oli-obk 2023-01-31 23:38:52 +01:00
rustc_traits Track bound types like bound regions 2023-01-30 22:18:20 +00:00
rustc_transmute Also remove #![feature(control_flow_enum)] where possible 2023-01-18 10:22:21 -08:00
rustc_ty_utils Extend -Z print-type-sizes to distinguish generator upvars and locals from "normal" ADT fields. 2023-01-31 15:59:29 -05:00
rustc_type_ir Separate witness type computation from the generator transform. 2023-01-27 19:00:26 +00:00