Index: build/config/ios/rules.gni |
diff --git a/build/config/ios/rules.gni b/build/config/ios/rules.gni |
index 8d1c16283e052af488e5e086b800b59f72c51502..c45ffe690b0ee2a483164f1d26a3efce51190fa5 100644 |
--- a/build/config/ios/rules.gni |
+++ b/build/config/ios/rules.gni |
@@ -2,9 +2,11 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
+import("//build/config/clang/clang.gni") |
import("//build/config/ios/ios_sdk.gni") |
import("//build/config/mac/base_rules.gni") |
import("//build/config/mac/symbols.gni") |
+import("//build/config/sanitizers/sanitizers.gni") |
# Invokes lipo on multiple arch-specific binaries to create a fat binary. |
# |
@@ -145,6 +147,9 @@ template("lipo_binary") { |
# extra_system_frameworks |
# (optional) list of system framework to copy to the bundle. |
# |
+# extra_system_libraries |
+# (optional) list of system libraries to copy to the bundle. |
+# |
# enable_code_signing |
# (optional) boolean, control whether code signing is enabled or not, |
# default to ios_enable_code_signing if not defined. |
@@ -234,6 +239,13 @@ template("create_signed_bundle") { |
} |
} |
+ if (defined(invoker.extra_system_libraries)) { |
+ foreach(_library, invoker.extra_system_libraries) { |
+ code_signing_outputs += |
+ [ "$bundle_root_dir/" + get_path_info(_library, "file") ] |
+ } |
+ } |
+ |
code_signing_args = [ |
"code-sign-bundle", |
"-t=" + ios_sdk_name, |
@@ -253,6 +265,14 @@ template("create_signed_bundle") { |
code_signing_args += [ "-F=" + _framework ] |
} |
} |
+ if (defined(invoker.extra_system_libraries)) { |
+ # All libraries in extra_system_libraries are expected to be |
+ # system libraries and the path to be already system absolute |
+ # so do not use rebase_path here. |
+ foreach(_library, invoker.extra_system_libraries) { |
+ code_signing_args += [ "-L=" + _library ] |
+ } |
+ } |
} |
} |
@@ -605,6 +625,16 @@ template("ios_app_bundle") { |
if (!defined(bundle_extension)) { |
bundle_extension = ".app" |
} |
+ |
+ if (using_sanitizer) { |
+ if (!defined(extra_system_libraries)) { |
+ extra_system_libraries = [] |
+ } |
+ extra_system_libraries += |
+ [ rebase_path("$clang_base_path/lib/clang/$clang_version/lib/" + |
+ "darwin/libclang_rt.asan_iossim_dynamic.dylib", |
justincohen
2016/09/26 15:14:02
does this change if we are building with Xcode cla
sdefresne
2016/09/26 15:20:43
Yes, it will probably change, though we currently
justincohen
2016/09/26 16:09:00
I think at least a comment explaining this won't w
|
+ root_build_dir) ] |
+ } |
} |
} |
} |
@@ -652,6 +682,17 @@ template("ios_appex_bundle") { |
bundle_extension = ".appex" |
product_type = "com.apple.product-type.app-extension" |
+ # The application extensions use the same runtime library as their main |
+ # application, so filter the bundle deps from the application extension |
+ # bundle. |
+ if (using_sanitizer) { |
+ if (!defined(bundle_deps_filter)) { |
+ bundle_deps_filter = [] |
+ } |
+ bundle_deps_filter += |
+ [ "//build/config/sanitizers:asan_runtime_bundle_data" ] |
+ } |
+ |
# Add linker flags required for an application extension (determined by |
# inspecting the link command-line when using Xcode 9.0+). |
if (!defined(ldflags)) { |