Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Unified Diff: build/config/sanitizers/BUILD.gn

Issue 2187063003: [Mac/GN] Use a special .symbol_resolver to help load the ASan dynamic library. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Static symbol stubs Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/config/sanitizers/generate_asan_runtime_stubs.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/sanitizers/BUILD.gn
diff --git a/build/config/sanitizers/BUILD.gn b/build/config/sanitizers/BUILD.gn
index dff6eb3c96612b2e294ac63f0abca1fe961e6ebc..163f9477f0abafc854781f0a9b36b2601f1401a1 100644
--- a/build/config/sanitizers/BUILD.gn
+++ b/build/config/sanitizers/BUILD.gn
@@ -27,6 +27,9 @@ group("deps") {
deps = [
":options_sources",
]
+ if (is_mac) {
+ deps += [ ":asan_runtime_stubs" ]
+ }
}
if (use_afl) {
deps += [ "//third_party/afl" ]
@@ -76,12 +79,35 @@ group("deps_no_options") {
}
if (is_mac && using_sanitizer) {
- copy("copy_asan_runtime") {
+ action("copy_asan_runtime") {
+ script = "//build/config/sanitizers/copy_asan_runtime.py"
+ _lib_name = "libclang_rt.asan_osx_dynamic.dylib"
sources = [
- "$clang_base_path/lib/clang/$clang_version/lib/darwin/libclang_rt.asan_osx_dynamic.dylib",
+ "$clang_base_path/lib/clang/$clang_version/lib/darwin/$_lib_name",
]
outputs = [
- "$root_out_dir/{{source_file_part}}",
+ "$root_out_dir/$_lib_name",
+ ]
+ args = rebase_path(sources + outputs, root_build_dir)
+ }
+
+ action("generate_asan_runtime_stubs") {
+ script = "//build/config/sanitizers/generate_asan_runtime_stubs.py"
+ inputs = get_target_outputs(":copy_asan_runtime")
+ outputs = [
+ "$target_gen_dir/asan_runtime_stubs.cc",
+ ]
+ args = rebase_path(inputs + outputs, root_build_dir)
+ deps = [ ":copy_asan_runtime" ]
+ }
+
+ source_set("asan_runtime_stubs") {
+ sources = get_target_outputs(":generate_asan_runtime_stubs")
+ deps = [ ":generate_asan_runtime_stubs" ]
+ configs = []
+ cflags = [
+ "-std=c++11",
+ "-mmacosx-version-min=10.7",
]
}
}
@@ -171,6 +197,10 @@ config("default_sanitizer_ldflags") {
}
}
}
+
+ if (is_mac) {
+ ldflags += [ "-nodefaultlibs", "-lc++", "-lSystem", "-lc++abi" ]
+ }
}
config("common_sanitizer_flags") {
« no previous file with comments | « no previous file | build/config/sanitizers/generate_asan_runtime_stubs.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698