Skip to content

Commit

Permalink
Merge pull request #166 from teeminus/is_official_build
Browse files Browse the repository at this point in the history
  • Loading branch information
teeminus committed Jul 27, 2022
2 parents 193049e + fce2e2a commit b50faea
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 1 deletion.
3 changes: 3 additions & 0 deletions flags.windows.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ ffmpeg_branding="Chrome"
is_clang=true
is_component_build=false
is_debug=false
is_official_build=true
proprietary_codecs=true
target_cpu="x64"
use_gnome_keyring=false
use_sysroot=false
dcheck_always_on=false
blink_symbol_level=0
v8_symbol_level=0
symbol_level=0
skip_archive_compression=false
1 change: 1 addition & 0 deletions patches/series
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ ungoogled-chromium/windows/windows-disable-download-warning-prompt.patch
ungoogled-chromium/windows/windows-fix-rc-terminating-error.patch
ungoogled-chromium/windows/windows-fix-building-without-safebrowsing.patch
ungoogled-chromium/windows/windows-fix-unknown-no-opaque-pointers-clang-parameter.patch
ungoogled-chromium/windows/windows-fix-generate-resource-allowed-list.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# This patch is only required when the is_official_build=true is enabled in flags.windows.gn

--- a/tools/resources/generate_resource_allowlist.py
+++ b/tools/resources/generate_resource_allowlist.py
@@ -61,7 +61,7 @@ def GetResourceAllowlistPDB(path):
pdbutil = subprocess.Popen(
[os.path.join(llvm_bindir, 'llvm-pdbutil'), 'dump', '-publics', path],
stdout=subprocess.PIPE)
- names = ''
+ names = set()
for line in pdbutil.stdout:
line = line.decode('utf8')
# Read a line of the form
@@ -75,31 +75,35 @@ def GetResourceAllowlistPDB(path):
# Example: __profd_??$AllowlistedResource@$0BGPH@@ui@@YAXXZ
# C++ mangled names are supposed to begin with `?`, so check for that.
if 'AllowlistedResource' in sym_name and sym_name.startswith('?'):
- names += sym_name + '\n'
+ names.add(sym_name)
exit_code = pdbutil.wait()
if exit_code != 0:
raise Exception('llvm-pdbutil exited with exit code %d' % exit_code)

- undname = subprocess.Popen([os.path.join(llvm_bindir, 'llvm-undname')],
- stdin=subprocess.PIPE,
- stdout=subprocess.PIPE)
- stdout, _ = undname.communicate(names.encode('utf8'))
resource_ids = set()
- for line in stdout.split(b'\n'):
- line = line.decode('utf8')
- # Read a line of the form
- # "void __cdecl ui::AllowlistedResource<5484>(void)".
- prefix = ' ui::AllowlistedResource<'
- pos = line.find(prefix)
- if pos == -1:
- continue
- try:
- resource_ids.add(int(line[pos + len(prefix):line.rfind('>')]))
- except ValueError:
- continue
- exit_code = undname.wait()
- if exit_code != 0:
- raise Exception('llvm-undname exited with exit code %d' % exit_code)
+ for name in names:
+ undname = subprocess.Popen(['undname', name],
+ stdout=subprocess.PIPE)
+ found = False
+ for line in undname.stdout:
+ line = line.decode('utf8')
+ # Read a line of the form
+ # "void __cdecl ui::AllowlistedResource<5484>(void)".
+ prefix = ' ui::AllowlistedResource<'
+ pos = line.find(prefix)
+ if pos == -1:
+ continue
+ try:
+ resource_ids.add(int(line[pos + len(prefix):line.rfind('>')]))
+ except ValueError:
+ continue
+ found = True
+ break
+ exit_code = undname.wait()
+ if exit_code != 0:
+ raise Exception('llvm-undname exited with exit code %d' % exit_code)
+ if not found:
+ raise Exception('Unexpected undname output')
return resource_ids


2 changes: 1 addition & 1 deletion revision.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1
2

0 comments on commit b50faea

Please sign in to comment.