diff --git a/shell/platform/darwin/common/BUILD.gn b/shell/platform/darwin/common/BUILD.gn index 7d844b75b81de..0d29be6c703eb 100644 --- a/shell/platform/darwin/common/BUILD.gn +++ b/shell/platform/darwin/common/BUILD.gn @@ -13,13 +13,38 @@ source_set("common") { cflags_objcc = flutter_cflags_objcc sources = [ - "availability_version_check.cc", "buffer_conversions.h", "buffer_conversions.mm", "command_line.h", "command_line.mm", ] + deps = [ + ":availability_version_check", + "//flutter/fml", + ] + + public_configs = [ "//flutter:config" ] +} + +# Provides an implementation for _availability_version_check. +# +# This is required due to an upstream compiler builtin (runtime) change +# that marked this function as weakly-linked via __attribute__((weak import)) +# As such, no linking failure occurs when the function is unavailable at +# link time. Since the symbol is no longer linked in, App Store review blocks +# publishing due to relying on a private symbol. Instead we link in our own +# implementation, which provides the exact implementation used in clang prior +# to the upstream change. +# +# See: Upstream clang change: https://reviews.llvm.org/D150397 +# See: https://github.com/flutter/flutter/issues/133777 +source_set("availability_version_check") { + cflags_objc = flutter_cflags_objc + cflags_objcc = flutter_cflags_objcc + + sources = [ "availability_version_check.cc" ] + deps = [ "//flutter/fml" ] public_configs = [ "//flutter:config" ] diff --git a/shell/platform/darwin/macos/BUILD.gn b/shell/platform/darwin/macos/BUILD.gn index 4bef2c68b1942..d36e9b1486099 100644 --- a/shell/platform/darwin/macos/BUILD.gn +++ b/shell/platform/darwin/macos/BUILD.gn @@ -121,6 +121,7 @@ source_set("flutter_framework_source") { "//flutter/shell/platform/common:common_cpp_enums", "//flutter/shell/platform/common:common_cpp_input", "//flutter/shell/platform/common:common_cpp_switches", + "//flutter/shell/platform/darwin/common:availability_version_check", "//flutter/shell/platform/darwin/common:framework_common", "//flutter/shell/platform/darwin/graphics:graphics", "//flutter/shell/platform/embedder:embedder_as_internal_library",