Commit f86de666 authored by Mirko Bonadei's avatar Mirko Bonadei Committed by Commit Bot

Add support for x64 release component build asan builds.

When is_asan=true is used, the set of exported symbols differs from a
normal release build.

This CL adds a .def file only for x64 builds since it looks like
Chromium doesn't have an x86 bot with this configuration.

Bug: 1102581
Change-Id: I01fe5cc22aa6719e765d790b624f335b0dcc23a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2287292
Commit-Queue: Mirko Bonadei <mbonadei@chromium.org>
Reviewed-by: default avatarHans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#786238}
parent c8231d33
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
# without these options will be part of the same program. # without these options will be part of the same program.
import("//build/config/c++/c++.gni") import("//build/config/c++/c++.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build/toolchain/toolchain.gni") import("//build/toolchain/toolchain.gni")
import("//build_overrides/build.gni") import("//build_overrides/build.gni")
import("//testing/test.gni") import("//testing/test.gni")
...@@ -29,7 +30,11 @@ component("absl") { ...@@ -29,7 +30,11 @@ component("absl") {
if (is_debug) { if (is_debug) {
sources = [ "symbols_x64_dbg.def" ] sources = [ "symbols_x64_dbg.def" ]
} else { } else {
sources = [ "symbols_x64_rel.def" ] if (is_asan) {
sources = [ "symbols_x64_rel_asan.def" ]
} else {
sources = [ "symbols_x64_rel.def" ]
}
} }
} }
if (target_cpu == "x86") { if (target_cpu == "x86") {
......
...@@ -30,8 +30,11 @@ def _DebugOrRelease(is_debug): ...@@ -30,8 +30,11 @@ def _DebugOrRelease(is_debug):
return 'dbg' if is_debug else 'rel' return 'dbg' if is_debug else 'rel'
def _GenerateDefFile(cpu, is_debug): def _GenerateDefFile(cpu, is_debug, extra_gn_args=[], suffix=None):
"""Generates a .def file for the absl component build on the specified CPU.""" """Generates a .def file for the absl component build on the specified CPU."""
if extra_gn_args:
assert suffix != None, 'suffix is needed when extra_gn_args is used'
flavor = _DebugOrRelease(is_debug) flavor = _DebugOrRelease(is_debug)
gn_args = [ gn_args = [
'ffmpeg_branding = "Chrome"', 'ffmpeg_branding = "Chrome"',
...@@ -42,6 +45,7 @@ def _GenerateDefFile(cpu, is_debug): ...@@ -42,6 +45,7 @@ def _GenerateDefFile(cpu, is_debug):
'target_cpu = "{}"'.format(cpu), 'target_cpu = "{}"'.format(cpu),
'target_os = "win"', 'target_os = "win"',
] ]
gn_args.extend(extra_gn_args)
with tempfile.TemporaryDirectory() as out_dir: with tempfile.TemporaryDirectory() as out_dir:
logging.info('[%s - %s] Creating tmp out dir in %s', cpu, flavor, out_dir) logging.info('[%s - %s] Creating tmp out dir in %s', cpu, flavor, out_dir)
...@@ -71,8 +75,13 @@ def _GenerateDefFile(cpu, is_debug): ...@@ -71,8 +75,13 @@ def _GenerateDefFile(cpu, is_debug):
logging.info('[%s - %s] Found %d absl symbols.', cpu, flavor, len(absl_symbols)) logging.info('[%s - %s] Found %d absl symbols.', cpu, flavor, len(absl_symbols))
def_file = os.path.join('third_party', 'abseil-cpp', if extra_gn_args:
'symbols_{}_{}.def'.format(cpu, flavor)) def_file = os.path.join('third_party', 'abseil-cpp',
'symbols_{}_{}_{}.def'.format(cpu, flavor, suffix))
else:
def_file = os.path.join('third_party', 'abseil-cpp',
'symbols_{}_{}.def'.format(cpu, flavor))
with open(def_file, 'w') as f: with open(def_file, 'w') as f:
f.write('EXPORTS\n') f.write('EXPORTS\n')
for s in sorted(absl_symbols): for s in sorted(absl_symbols):
...@@ -95,5 +104,6 @@ if __name__ == '__main__': ...@@ -95,5 +104,6 @@ if __name__ == '__main__':
_GenerateDefFile('x86', False) _GenerateDefFile('x86', False)
_GenerateDefFile('x64', True) _GenerateDefFile('x64', True)
_GenerateDefFile('x64', False) _GenerateDefFile('x64', False)
_GenerateDefFile('x64', False, ['is_asan = true'], 'asan')
_GenerateDefFile('arm64', True) _GenerateDefFile('arm64', True)
_GenerateDefFile('arm64', False) _GenerateDefFile('arm64', False)
This diff is collapsed.
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