summaryrefslogtreecommitdiff
path: root/chromium/build/toolchain
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-07-31 15:50:41 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-08-30 12:35:23 +0000
commit7b2ffa587235a47d4094787d72f38102089f402a (patch)
tree30e82af9cbab08a7fa028bb18f4f2987a3f74dfa /chromium/build/toolchain
parentd94af01c90575348c4e81a418257f254b6f8d225 (diff)
downloadqtwebengine-chromium-7b2ffa587235a47d4094787d72f38102089f402a.tar.gz
BASELINE: Update Chromium to 76.0.3809.94
Change-Id: I321c3f5f929c105aec0f98c5091ef6108822e647 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/build/toolchain')
-rwxr-xr-xchromium/build/toolchain/clang_code_coverage_wrapper.py4
-rwxr-xr-xchromium/build/toolchain/gcc_solink_wrapper.py28
-rw-r--r--chromium/build/toolchain/gcc_toolchain.gni2
-rw-r--r--chromium/build/toolchain/mac/filter_libtool.py4
-rw-r--r--chromium/build/toolchain/mac/get_tool_mtime.py4
-rw-r--r--chromium/build/toolchain/win/midl.gni19
-rw-r--r--chromium/build/toolchain/win/midl.py19
7 files changed, 65 insertions, 15 deletions
diff --git a/chromium/build/toolchain/clang_code_coverage_wrapper.py b/chromium/build/toolchain/clang_code_coverage_wrapper.py
index 96978056901..679a3b53bca 100755
--- a/chromium/build/toolchain/clang_code_coverage_wrapper.py
+++ b/chromium/build/toolchain/clang_code_coverage_wrapper.py
@@ -39,6 +39,8 @@ Example usage:
--files-to-instrument=coverage_instrumentation_input.txt
"""
+from __future__ import print_function
+
import argparse
import os
import subprocess
@@ -124,7 +126,7 @@ def main():
# obj/base/base/file_path.o
index_dash_c = compile_command.index('-c')
except ValueError:
- print '-c argument is not found in the compile command.'
+ print('-c argument is not found in the compile command.')
raise
if index_dash_c + 1 >= len(compile_command):
diff --git a/chromium/build/toolchain/gcc_solink_wrapper.py b/chromium/build/toolchain/gcc_solink_wrapper.py
index cb1c02d24eb..540b1eda30c 100755
--- a/chromium/build/toolchain/gcc_solink_wrapper.py
+++ b/chromium/build/toolchain/gcc_solink_wrapper.py
@@ -94,6 +94,14 @@ def main():
fast_env = dict(os.environ)
fast_env['LC_ALL'] = 'C'
+ # Extract the --link-only argument, which goes for a ride through ldflags into
+ # the command, but is meant to be intercepted by this wrapper script (not
+ # passed to the linker). https://crbug.com/954311 tracks finding a better way
+ # to plumb this argument.
+ link_only = '--link-only' in args.command
+ if link_only:
+ args.command.remove('--link-only')
+
# First, run the actual link.
command = wrapper_utils.CommandToRun(args.command)
result = wrapper_utils.RunLinkWithOptionalMapFile(command, env=fast_env,
@@ -102,6 +110,26 @@ def main():
if result != 0:
return result
+ # If only linking, we are likely generating a partitioned .so that will be
+ # split apart later. In that case:
+ #
+ # - The TOC file optimization isn't useful, because the partition libraries
+ # must always be re-extracted if the combined library changes (and nothing
+ # should be depending on the combined library's dynamic symbol table).
+ # - Stripping isn't necessary, because the combined library is not used in
+ # production or published.
+ #
+ # Both of these operations could still be done, they're needless work, and
+ # tools would need to be updated to handle and/or not complain about
+ # partitioned libraries. Instead, to keep Ninja happy, simply create dummy
+ # files for the TOC and stripped lib.
+ if link_only:
+ with open(args.output, 'w'):
+ pass
+ with open(args.tocfile, 'w'):
+ pass
+ return 0
+
# Next, generate the contents of the TOC file.
result, toc = CollectTOC(args)
if result != 0:
diff --git a/chromium/build/toolchain/gcc_toolchain.gni b/chromium/build/toolchain/gcc_toolchain.gni
index 80e2a362a59..bfb59b5e646 100644
--- a/chromium/build/toolchain/gcc_toolchain.gni
+++ b/chromium/build/toolchain/gcc_toolchain.gni
@@ -403,7 +403,7 @@ template("gcc_toolchain") {
# .TOC file, overwrite it, otherwise, don't change it.
tocfile = sofile + ".TOC"
- link_command = "$ld -shared {{ldflags}}${extra_ldflags} -o \"$unstripped_sofile\" -Wl,-soname=\"$soname\" @\"$rspfile\""
+ link_command = "$ld -shared -Wl,-soname=\"$soname\" {{ldflags}}${extra_ldflags} -o \"$unstripped_sofile\" @\"$rspfile\""
# Generate a map file to be used for binary size analysis.
# Map file adds ~10% to the link time on a z620.
diff --git a/chromium/build/toolchain/mac/filter_libtool.py b/chromium/build/toolchain/mac/filter_libtool.py
index 3b161518404..b458f067062 100644
--- a/chromium/build/toolchain/mac/filter_libtool.py
+++ b/chromium/build/toolchain/mac/filter_libtool.py
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+from __future__ import print_function
+
import os
import re
import subprocess
@@ -39,7 +41,7 @@ def Main(cmd_list):
_, err = libtoolout.communicate()
for line in err.splitlines():
if not IsBlacklistedLine(line):
- print >>sys.stderr, line
+ print(line, file=sys.stderr)
# Unconditionally touch the output .a file on the command line if present
# and the command succeeded. A bit hacky.
if not libtoolout.returncode:
diff --git a/chromium/build/toolchain/mac/get_tool_mtime.py b/chromium/build/toolchain/mac/get_tool_mtime.py
index 4106344b821..ff0254c635e 100644
--- a/chromium/build/toolchain/mac/get_tool_mtime.py
+++ b/chromium/build/toolchain/mac/get_tool_mtime.py
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+from __future__ import print_function
+
import os
import sys
@@ -14,4 +16,4 @@ import sys
if __name__ == '__main__':
for f in sys.argv[1:]:
variable = os.path.splitext(os.path.basename(f))[0]
- print '%s = %d' % (variable, os.path.getmtime(f))
+ print('%s = %d' % (variable, os.path.getmtime(f)))
diff --git a/chromium/build/toolchain/win/midl.gni b/chromium/build/toolchain/win/midl.gni
index b46f4cd538c..1fccf15f575 100644
--- a/chromium/build/toolchain/win/midl.gni
+++ b/chromium/build/toolchain/win/midl.gni
@@ -12,7 +12,7 @@ import("//build/config/win/visual_studio_version.gni")
# Parameters
#
# sources
-# List of .idl file to process.
+# List of .idl file to process.
#
# header_file (optional)
# File name of generated header file. Defaults to the basename of the
@@ -24,6 +24,9 @@ import("//build/config/win/visual_studio_version.gni")
# dynamic_guid (optional)
# If the GUID is not constant across builds, the current GUID.
#
+# writes_tlb (optional)
+# Whether a .tlb file should be added to outputs. Defaults to false.
+#
# deps (optional)
# visibility (optional)
@@ -51,6 +54,12 @@ template("midl") {
header_file = "{{source_name_part}}.h"
}
+ if (defined(invoker.writes_tlb)) {
+ writes_tlb = invoker.writes_tlb
+ } else {
+ writes_tlb = false
+ }
+
dlldata_file = "{{source_name_part}}.dlldata.c"
interface_identifier_file = "{{source_name_part}}_i.c"
proxy_file = "{{source_name_part}}_p.c"
@@ -62,8 +71,6 @@ template("midl") {
sources = invoker.sources
- # Note that .tlb is not included in the outputs as it is not always
- # generated depending on the content of the input idl file.
outputs = [
"$out_dir/$header_file",
"$out_dir/$dlldata_file",
@@ -71,6 +78,12 @@ template("midl") {
"$out_dir/$proxy_file",
]
+ # The .tlb is only added to outputs if the invoker so desires, as it is not
+ # always generated depending on the content of the input idl file.
+ if (writes_tlb) {
+ outputs += [ "$out_dir/$type_library_file" ]
+ }
+
if (current_cpu == "x86") {
win_tool_arch = "environment.x86"
idl_target_platform = "win32"
diff --git a/chromium/build/toolchain/win/midl.py b/chromium/build/toolchain/win/midl.py
index 09fec0b8cf2..618252a22ca 100644
--- a/chromium/build/toolchain/win/midl.py
+++ b/chromium/build/toolchain/win/midl.py
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+from __future__ import print_function
+
import array
import difflib
import distutils.dir_util
@@ -205,7 +207,7 @@ def main(arch, outdir, dynamic_guid, tlb, h, dlldata, iid, proxy, idl, *flags):
for x in lines if x.startswith(prefixes))
for line in lines:
if not line.startswith(prefixes) and line not in processing:
- print line
+ print(line)
if popen.returncode != 0:
return popen.returncode
@@ -215,18 +217,19 @@ def main(arch, outdir, dynamic_guid, tlb, h, dlldata, iid, proxy, idl, *flags):
# Now compare the output in tmp_dir to the copied-over outputs.
diff = filecmp.dircmp(tmp_dir, outdir)
if diff.diff_files:
- print 'midl.exe output different from files in %s, see %s' \
- % (outdir, tmp_dir)
+ print('midl.exe output different from files in %s, see %s' % (outdir,
+ tmp_dir))
for f in diff.diff_files:
if f.endswith('.tlb'): continue
fromfile = os.path.join(outdir, f)
tofile = os.path.join(tmp_dir, f)
- print ''.join(difflib.unified_diff(open(fromfile, 'U').readlines(),
- open(tofile, 'U').readlines(),
- fromfile, tofile))
+ print(''.join(
+ difflib.unified_diff(
+ open(fromfile, 'U').readlines(),
+ open(tofile, 'U').readlines(), fromfile, tofile)))
delete_tmp_dir = False
- print 'To rebaseline:'
- print ' copy /y %s\* %s' % (tmp_dir, source)
+ print('To rebaseline:')
+ print(' copy /y %s\* %s' % (tmp_dir, source))
sys.exit(1)
return 0
finally: