Commit 83b50a34 authored by Ali Juma's avatar Ali Juma Committed by Commit Bot

[ios-fuzzing] Use bundled version of libclang_rt.asan_osx_dynamic.dylib

The WebKit build directory contains a copy of
libclang_rt.asan_osx_dynamic.dylib inside
WebKitTestRunnerApp.app. This file is also needed at the top
level when fuzzing, since trying to dynamically load a
version of this library from other locations leads to crashes.

This CL makes copy_webkit_for_clusterfuzz.py copy this
library to the top level, and makes run-clusterfuzz.sh set
DYLD_LIBRARY_PATH to this top level directory.

Bug: 1064181
Change-Id: I7de42891c39c12ae422beb6e8031745ff36640b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2202682Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Ali Juma <ajuma@chromium.org>
Cr-Commit-Position: refs/heads/master@{#768984}
parent 331839c3
...@@ -158,6 +158,8 @@ if (_build_custom_webkit) { ...@@ -158,6 +158,8 @@ if (_build_custom_webkit) {
] ]
outputs = [ "$root_out_dir/WebKitMacOS" ] outputs = [ "$root_out_dir/WebKitMacOS" ]
_clang_asan_lib = rebase_path(sources[0], root_build_dir) + "/WebKitTestRunnerApp.app/Contents/Frameworks/libclang_rt.asan_osx_dynamic.dylib"
args = [ args = [
"--output", "--output",
rebase_path(outputs[0], root_build_dir), rebase_path(outputs[0], root_build_dir),
...@@ -165,6 +167,8 @@ if (_build_custom_webkit) { ...@@ -165,6 +167,8 @@ if (_build_custom_webkit) {
rebase_path(sources[0], root_build_dir), rebase_path(sources[0], root_build_dir),
"--clusterfuzz_script", "--clusterfuzz_script",
rebase_path(sources[1], root_build_dir), rebase_path(sources[1], root_build_dir),
"--clang_asan_library",
"$_clang_asan_lib",
] ]
public_deps = [ ":compile_webkit_mac_minibrowser" ] public_deps = [ ":compile_webkit_mac_minibrowser" ]
......
...@@ -13,11 +13,13 @@ def main(): ...@@ -13,11 +13,13 @@ def main():
description = 'Packages WebKit build for Clusterfuzz.' description = 'Packages WebKit build for Clusterfuzz.'
parser = argparse.ArgumentParser(description=description) parser = argparse.ArgumentParser(description=description)
parser.add_argument('--output', parser.add_argument('--output',
help='Name of the outout file.') help='Name of the output file.')
parser.add_argument('--webkit_build', parser.add_argument('--webkit_build',
help='WebKit build directory to copy.') help='WebKit build directory to copy.')
parser.add_argument('--clusterfuzz_script', parser.add_argument('--clusterfuzz_script',
help='Clusterfuzz script to copy.') help='Clusterfuzz script to copy.')
parser.add_argument('--clang_asan_library',
help='Clang ASan library to copy.')
opts = parser.parse_args() opts = parser.parse_args()
...@@ -29,6 +31,10 @@ def main(): ...@@ -29,6 +31,10 @@ def main():
opts.clusterfuzz_script, opts.clusterfuzz_script,
os.path.join(opts.output, os.path.join(opts.output,
os.path.basename(opts.clusterfuzz_script))) os.path.basename(opts.clusterfuzz_script)))
shutil.copyfile(
opts.clang_asan_library,
os.path.join(opts.output,
os.path.basename(opts.clang_asan_library)))
zip_command = ['zip', '--symlinks', '-r', os.extsep.join([opts.output, 'zip']), opts.output] zip_command = ['zip', '--symlinks', '-r', os.extsep.join([opts.output, 'zip']), opts.output]
proc = subprocess.Popen(zip_command) proc = subprocess.Popen(zip_command)
......
...@@ -6,5 +6,4 @@ ...@@ -6,5 +6,4 @@
# This script is used to launch WebKitTestRunner on ClusterFuzz bots. # This script is used to launch WebKitTestRunner on ClusterFuzz bots.
BASEDIR=$(dirname "$0") BASEDIR=$(dirname "$0")
LIBDIR=$(xcode-select --print-path)/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.1/lib/darwin DYLD_FRAMEWORK_PATH=$BASEDIR DYLD_LIBRARY_PATH=$BASEDIR ./WebKitTestRunner $@
DYLD_FRAMEWORK_PATH=$BASEDIR DYLD_LIBRARY_PATH=$LIBDIR ./WebKitTestRunner $@
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment