Skip to content

Commit

Permalink
Auto merge of #117364 - BlackHoleFox:farewell-bitcode-no-remorse, r=d…
Browse files Browse the repository at this point in the history
…avidtwco

Remove legacy bitcode defaults from all Apple specs

Xcode 14 [deprecated bitcode with warnings](https://developer.apple.com/documentation/xcode-release-notes/xcode-14-release-notes#Deprecations) and now [Xcode 15 has dropped it completely](https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Deprecations). `rustc` should follow what the platform tooling is doing as well since it just increases binary sizes for no gain at this point.

`cc` made a [similar change last month](rust-lang/cc-rs#812).

Two things show this should have minimal impact:
- Apple has stopped accepting apps built with versions of Xcode (<14) that generate bitcode
- The app store has been stripping bitcode off IPA releases for over 2 years now.

I didn't nuke all the bitcode changes added in #71970 since maybe another target in the future could need mandatory bitcode embedding.

Staticlibs built for iOS still link correctly with XCode 15 against a test app when using a compiler built from this branch.

cc `@thomcc` `@keith`
  • Loading branch information
bors committed Nov 19, 2023
2 parents d052f6f + b27c3b7 commit 7d0e1bc
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 94 deletions.
12 changes: 0 additions & 12 deletions compiler/rustc_target/src/spec/targets/aarch64_apple_ios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,7 @@ pub fn target() -> Target {
options: TargetOptions {
features: "+neon,+fp-armv8,+apple-a7".into(),
max_atomic_width: Some(128),
forces_embed_bitcode: true,
frame_pointer: FramePointer::NonLeaf,
// Taken from a clang build on Xcode 11.4.1.
// These arguments are not actually invoked - they just have
// to look right to pass App Store validation.
bitcode_llvm_cmdline: "-triple\0\
arm64-apple-ios11.0.0\0\
-emit-obj\0\
-disable-llvm-passes\0\
-target-abi\0\
darwinpcs\0\
-Os\0"
.into(),
..base
},
}
Expand Down
10 changes: 0 additions & 10 deletions compiler/rustc_target/src/spec/targets/aarch64_apple_ios_macabi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,7 @@ pub fn target() -> Target {
options: TargetOptions {
features: "+neon,+fp-armv8,+apple-a12".into(),
max_atomic_width: Some(128),
forces_embed_bitcode: true,
frame_pointer: FramePointer::NonLeaf,
// Taken from a clang build on Xcode 11.4.1.
// These arguments are not actually invoked - they just have
// to look right to pass App Store validation.
bitcode_llvm_cmdline: "-triple\0\
arm64-apple-ios-macabi\0\
-emit-obj\0\
-disable-llvm-passes\0\
-Os\0"
.into(),
..base
},
}
Expand Down
12 changes: 0 additions & 12 deletions compiler/rustc_target/src/spec/targets/aarch64_apple_ios_sim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,7 @@ pub fn target() -> Target {
options: TargetOptions {
features: "+neon,+fp-armv8,+apple-a7".into(),
max_atomic_width: Some(128),
forces_embed_bitcode: true,
frame_pointer: FramePointer::NonLeaf,
// Taken from a clang build on Xcode 11.4.1.
// These arguments are not actually invoked - they just have
// to look right to pass App Store validation.
bitcode_llvm_cmdline: "-triple\0\
arm64-apple-ios14.0-simulator\0\
-emit-obj\0\
-disable-llvm-passes\0\
-target-abi\0\
darwinpcs\0\
-Os\0"
.into(),
..base
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ pub fn target() -> Target {
options: TargetOptions {
features: "+neon,+fp-armv8,+apple-a7".into(),
max_atomic_width: Some(128),
forces_embed_bitcode: true,
frame_pointer: FramePointer::NonLeaf,
..opts("tvos", arch)
},
Expand Down
13 changes: 0 additions & 13 deletions compiler/rustc_target/src/spec/targets/aarch64_apple_tvos_sim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,7 @@ pub fn target() -> Target {
options: TargetOptions {
features: "+neon,+fp-armv8,+apple-a7".into(),
max_atomic_width: Some(128),
forces_embed_bitcode: true,
frame_pointer: FramePointer::NonLeaf,
// Taken from (and slightly modified) the aarch64-apple-ios-sim spec which says:
// Taken from a clang build on Xcode 11.4.1.
// These arguments are not actually invoked - they just have
// to look right to pass App Store validation.
bitcode_llvm_cmdline: "-triple\0\
arm64-apple-tvos15.0-simulator\0\
-emit-obj\0\
-disable-llvm-passes\0\
-target-abi\0\
darwinpcs\0\
-Os\0"
.into(),
..opts("tvos", arch)
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,7 @@ pub fn target() -> Target {
options: TargetOptions {
features: "+neon,+fp-armv8,+apple-a7".into(),
max_atomic_width: Some(128),
forces_embed_bitcode: true,
frame_pointer: FramePointer::NonLeaf,
// Taken from a clang build on Xcode 11.4.1.
// These arguments are not actually invoked - they just have
// to look right to pass App Store validation.
bitcode_llvm_cmdline: "-triple\0\
arm64-apple-watchos5.0-simulator\0\
-emit-obj\0\
-disable-llvm-passes\0\
-target-abi\0\
darwinpcs\0\
-Os\0"
.into(),
..opts("watchos", arch)
},
}
Expand Down
11 changes: 0 additions & 11 deletions compiler/rustc_target/src/spec/targets/arm64_32_apple_watchos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,8 @@ pub fn target() -> Target {
options: TargetOptions {
features: "+v8a,+neon,+fp-armv8,+apple-a7".into(),
max_atomic_width: Some(128),
forces_embed_bitcode: true,
dynamic_linking: false,
position_independent_executables: true,
// These arguments are not actually invoked - they just have
// to look right to pass App Store validation.
bitcode_llvm_cmdline: "-triple\0\
arm64_32-apple-watchos5.0.0\0\
-emit-obj\0\
-disable-llvm-passes\0\
-target-abi\0\
darwinpcs\0\
-Os\0"
.into(),
..base
},
}
Expand Down
11 changes: 0 additions & 11 deletions compiler/rustc_target/src/spec/targets/armv7k_apple_watchos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,8 @@ pub fn target() -> Target {
options: TargetOptions {
features: "+v7,+vfp4,+neon".into(),
max_atomic_width: Some(64),
forces_embed_bitcode: true,
dynamic_linking: false,
position_independent_executables: true,
// These arguments are not actually invoked - they just have
// to look right to pass App Store validation.
bitcode_llvm_cmdline: "-triple\0\
armv7k-apple-watchos3.0.0\0\
-emit-obj\0\
-disable-llvm-passes\0\
-target-abi\0\
darwinpcs\0\
-Os\0"
.into(),
..opts("watchos", arch)
},
}
Expand Down
12 changes: 0 additions & 12 deletions compiler/rustc_target/src/spec/targets/x86_64_apple_watchos_sim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,6 @@ pub fn target() -> Target {
options: TargetOptions {
max_atomic_width: Some(128),
stack_probes: StackProbeType::X86,
forces_embed_bitcode: true,
// Taken from a clang build on Xcode 11.4.1.
// These arguments are not actually invoked - they just have
// to look right to pass App Store validation.
bitcode_llvm_cmdline: "-triple\0\
x86_64-apple-watchos5.0-simulator\0\
-emit-obj\0\
-disable-llvm-passes\0\
-target-abi\0\
darwinpcs\0\
-Os\0"
.into(),
..opts("watchos", arch)
},
}
Expand Down

0 comments on commit 7d0e1bc

Please sign in to comment.