Bug 1426176 - Add symbols file for Clang ASan runtime on Windows. r=ted

MozReview-Commit-ID: 4P3mwZNP8cY

--HG--
extra : rebase_source : a06221ad62a6c763224378d93aeea7d2477f5226
This commit is contained in:
Christian Holler 2018-07-26 11:16:50 +02:00
parent 4def48d158
commit 04589bf67b
2 changed files with 17 additions and 0 deletions

View File

@ -134,6 +134,21 @@ def install_import_library(build_dir, clang_dir):
os.path.join(clang_dir, "lib"))
def install_asan_symbols(build_dir, clang_dir):
lib_path_pattern = os.path.join("lib", "clang", "*.*.*", "lib", "windows")
src_path = glob.glob(os.path.join(build_dir, lib_path_pattern,
"clang_rt.asan_dynamic-x86_64.pdb"))
dst_path = glob.glob(os.path.join(clang_dir, lib_path_pattern))
if len(src_path) != 1:
raise Exception("Source path pattern did not resolve uniquely")
if len(src_path) != 1:
raise Exception("Destination path pattern did not resolve uniquely")
shutil.copy2(src_path[0], dst_path[0])
def svn_co(source_dir, url, directory, revision):
run_in(source_dir, ["svn", "co", "-q", "-r", revision, url, directory])
@ -226,6 +241,7 @@ def build_one_stage(cc, cxx, asm, ld, ar, ranlib, libtool,
# installed, so we copy it by ourselves.
if is_windows():
install_import_library(build_dir, inst_dir)
install_asan_symbols(build_dir, inst_dir)
# Return the absolute path of a build tool. We first look to see if the

View File

@ -50,6 +50,7 @@ OBJDIR_FILES += ['!/dist/bin/.gdbinit_python']
# Install the clang-cl runtime library for ASAN next to the binaries we produce.
if CONFIG['MOZ_ASAN'] and CONFIG['CC_TYPE'] == 'clang-cl':
FINAL_TARGET_FILES += ['%' + CONFIG['MOZ_CLANG_RT_ASAN_LIB_PATH']]
FINAL_TARGET_FILES += ['%' + CONFIG['MOZ_CLANG_RT_ASAN_LIB_PATH'].replace(".dll", ".pdb")]
if CONFIG['LLVM_SYMBOLIZER']:
FINAL_TARGET_FILES += ['/' + CONFIG['LLVM_SYMBOLIZER']]