Skip to content

Commit

Permalink
[macOS][iOS] Eliminate strip_bitcode action (flutter#36627)
Browse files Browse the repository at this point in the history
Eliminates the `strip_bitcode` GN rule defined in
//flutter/sky/tools/mac.gni and the related script at
//flutter/sky/tools/strip_bitcode.py.

As of Xcode 14, bitcode is deprecated, no longer enabled by default, and
generates a warning message if a project enables it. Bitcode support
will be removed entirely from a future version of Xcode.

The `strip_bitcode` rule had two purposes:
1. Copy the binary specified by its input parameter to the path
   specified by its output parameter.
2. Strip bitcode segments as it does so.

While we no longer require the second of these functions, we still use
the first to create a `gen_snapshot` binary suffixed with the target
architecture. This replaces `strip_bitcode` with the built-in gn `copy`
rule instead.

Issue: flutter/flutter#107884
Issue: flutter/flutter#112896
Issue: flutter/flutter#101138
Issue: flutter/flutter#103386
  • Loading branch information
cbracken authored Oct 5, 2022
1 parent 062edc4 commit 377bd08
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 92 deletions.
13 changes: 6 additions & 7 deletions lib/snapshot/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import("//build/compiled_action.gni")
import("//build/fuchsia/sdk.gni")
import("//flutter/common/config.gni")
import("//flutter/lib/ui/dart_ui.gni")
import("//flutter/sky/tools/macos.gni")
import("//third_party/dart/utils/compile_platform.gni")

# Generates the Dart/Flutter core platform files and tools.
Expand Down Expand Up @@ -252,7 +251,7 @@ bin_to_linkable("platform_strong_dill_linkable") {
# This target is used for builds targeting iOS/Android OS.
if (host_os == "mac" && target_os != "mac" &&
(target_cpu == "arm" || target_cpu == "arm64")) {
strip_bitcode("create_arm_gen_snapshot") {
copy("create_arm_gen_snapshot") {
# The toolchain-specific output directory. For cross-compiles, this is a
# clang-x64 or clang-arm64 subdirectory of the top-level build directory.
host_output_dir = get_label_info(
Expand All @@ -265,8 +264,8 @@ if (host_os == "mac" && target_os != "mac" &&
target_cpu_suffix = "armv7"
}

input = "${host_output_dir}/gen_snapshot"
output = "${host_output_dir}/gen_snapshot_${target_cpu_suffix}"
sources = [ "${host_output_dir}/gen_snapshot" ]
outputs = [ "${host_output_dir}/gen_snapshot_${target_cpu_suffix}" ]
deps = [ "//third_party/dart/runtime/bin:gen_snapshot($host_toolchain)" ]
visibility = [ ":*" ]
}
Expand All @@ -280,15 +279,15 @@ if (host_os == "mac" && target_os != "mac" &&
#
# This target is used for builds targeting macOS.
if (host_os == "mac" && target_os == "mac") {
strip_bitcode("create_macos_gen_snapshots") {
copy("create_macos_gen_snapshots") {
# The toolchain-specific output directory. For cross-compiles, this is a
# clang-x64 or clang-arm64 subdirectory of the top-level build directory.
host_output_dir = get_label_info(
"//third_party/dart/runtime/bin:gen_snapshot($host_toolchain)",
"root_out_dir")

input = "${host_output_dir}/gen_snapshot"
output = "${root_out_dir}/gen_snapshot_${target_cpu}"
sources = [ "${host_output_dir}/gen_snapshot" ]
outputs = [ "${root_out_dir}/gen_snapshot_${target_cpu}" ]
deps = [ "//third_party/dart/runtime/bin:gen_snapshot($host_toolchain)" ]
metadata = {
snapshot_entitlement_file_path = [ "gen_snapshot_{$target_cpu}" ]
Expand Down
41 changes: 0 additions & 41 deletions sky/tools/macos.gni

This file was deleted.

44 changes: 0 additions & 44 deletions sky/tools/strip_bitcode.py

This file was deleted.

0 comments on commit 377bd08

Please sign in to comment.