Skip to content

Commit b3e9ff1

Browse files
committed
[wip]: 6667681: Use more binaries from clang toolchain in mac build | https://chromium-review.googlesource.com/c/chromium/src/+/6667681
1 parent af4fafe commit b3e9ff1

File tree

3 files changed

+178
-0
lines changed

3 files changed

+178
-0
lines changed

patches/chromium/.patches

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,4 @@ revert_views_remove_desktopwindowtreehostwin_window_enlargement.patch
136136
build_partial_revert_mac_fullscreen_top_chrome_mouse_events.patch
137137
revert_update_siso-chromium_image.patch
138138
fix_add_macos_memory_query_fallback_to_avoid_crash.patch
139+
revert_use_more_binaries_from_clang_toolchain_in_mac_build.patch
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Keeley Hammond <khammond@slack-corp.com>
3+
Date: Wed, 16 Jul 2025 17:20:17 -0700
4+
Subject: build: fall back to system binaries for apple toolchain
5+
6+
This functionality partially reverts this
7+
upstream change: 6667681: Use more binaries from clang toolchain
8+
in mac build | https://chromium-review.googlesource.com/c/chromium/src/+/6667681 Chrome modified the BUILD directory to include several binaries that don't currently exist in llvm-build in CI. This patch lets us fall back to the system tools when the bundled binaries are not found.
9+
10+
This patch can be removed when we cache the binaires in our own toolchain.
11+
12+
diff --git a/build/toolchain/apple/linker_driver.py b/build/toolchain/apple/linker_driver.py
13+
index e502500cedcbbd3b6f9940ff56762f3a5848b8ae..2cde44cc4d442a4382af3a0fcfdf038c909a0a16 100755
14+
--- a/build/toolchain/apple/linker_driver.py
15+
+++ b/build/toolchain/apple/linker_driver.py
16+
@@ -312,7 +312,11 @@ class LinkerDriver(object):
17+
install_name_tool_path: string, The path to the install_name_tool
18+
binary to run
19+
"""
20+
- self._install_name_tool_cmd = [install_name_tool_path]
21+
+ if os.path.exists(install_name_tool_path):
22+
+ self._install_name_tool_cmd = [install_name_tool_path]
23+
+ else:
24+
+ # Fallback to system install_name_tool if provided path doesn't exist
25+
+ self._install_name_tool_cmd = ['xcrun', 'install_name_tool']
26+
27+
def run_install_name_tool(self, args_string):
28+
"""Linker driver action for -Wcrl,installnametool,<args>. Invokes
29+
@@ -373,7 +377,11 @@ class LinkerDriver(object):
30+
Args:
31+
dsymutil_path: string, The path to the dsymutil binary to run
32+
"""
33+
- self._dsymutil_cmd = [dsymutil_path]
34+
+ if os.path.exists(dsymutil_path):
35+
+ self._dsymutil_cmd = [dsymutil_path]
36+
+ else:
37+
+ # Fallback to system dsymutil if provided path doesn't exist
38+
+ self._dsymutil_cmd = ['xcrun', 'dsymutil']
39+
40+
def run_save_unstripped(self, unstripped_path_prefix):
41+
"""Linker driver action for -Wcrl,unstripped,<unstripped_path_prefix>.
42+
@@ -419,7 +427,11 @@ class LinkerDriver(object):
43+
Args:
44+
strip_path: string, The path to the strip binary to run
45+
"""
46+
- self._strip_cmd = [strip_path]
47+
+ if os.path.exists(strip_path):
48+
+ self._strip_cmd = [strip_path]
49+
+ else:
50+
+ # Fallback to system strip if provided path doesn't exist
51+
+ self._strip_cmd = ['xcrun', 'strip']
52+
53+
def set_otool_path(self, otool_path):
54+
"""Linker driver pre-action for -Wcrl,otoolpath,<otool_path>.
55+
@@ -430,7 +442,11 @@ class LinkerDriver(object):
56+
otool_path: string. The path to the otool binary to run
57+
58+
"""
59+
- self._otool_cmd = [otool_path]
60+
+ if os.path.exists(otool_path):
61+
+ self._otool_cmd = [otool_path]
62+
+ else:
63+
+ # Fallback to system otool if provided path doesn't exist
64+
+ self._otool_cmd = ['xcrun', 'otool']
65+
66+
def set_nm_path(self, nm_path):
67+
"""Linker driver pre-action for -Wcrl,nmpath,<nm_path>.
68+
@@ -443,7 +459,11 @@ class LinkerDriver(object):
69+
Returns:
70+
No output - this step is run purely for its side-effect.
71+
"""
72+
- self._nm_cmd = [nm_path]
73+
+ if os.path.exists(nm_path):
74+
+ self._nm_cmd = [nm_path]
75+
+ else:
76+
+ # Fallback to system nm if provided path doesn't exist
77+
+ self._nm_cmd = ['xcrun', 'nm']
78+
79+
def output_toc(self, tocname):
80+
"""Linker driver action for -Wcrl,tocname,<path>.
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Keeley Hammond <khammond@slack-corp.com>
3+
Date: Wed, 16 Jul 2025 20:19:56 -0700
4+
Subject: Revert "Use more binaries from clang toolchain in mac build"
5+
6+
This reverts commit 17b850a9f8e913fb5e465d895f545b069def57d1.
7+
8+
diff --git a/DEPS b/DEPS
9+
index feb3c8b75290fdb4ef9274e136e1ce6eb2072846..b78802471c23017eae8ff64d33206794d59a996f 100644
10+
--- a/DEPS
11+
+++ b/DEPS
12+
@@ -906,13 +906,6 @@ deps = {
13+
'generation': 1752145989568677,
14+
'condition': 'host_os == "mac" and host_cpu == "x64" and checkout_clang_coverage_tools',
15+
},
16+
- {
17+
- 'object_name': 'Mac/llvmobjdump-llvmorg-21-init-16348-gbd809ffb-13.tar.xz',
18+
- 'sha256sum': 'fff3642ab8fbfffa4f5e8feda7b7f8ab7838099b2d0d1f5ce323a1d8aebf05ca',
19+
- 'size_bytes': 5490072,
20+
- 'generation': 1752145989091474,
21+
- 'condition': 'host_os == "mac" and host_cpu == "x64"',
22+
- },
23+
{
24+
'object_name': 'Mac_arm64/clang-llvmorg-21-init-16348-gbd809ffb-13.tar.xz',
25+
'sha256sum': '68460f5290547d101c4c9c2e4ea74b783159e553e90dad5b422f03f58d16d05c',
26+
@@ -941,13 +934,6 @@ deps = {
27+
'generation': 1752146011858185,
28+
'condition': 'host_os == "mac" and host_cpu == "arm64" and checkout_clang_coverage_tools',
29+
},
30+
- {
31+
- 'object_name': 'Mac_arm64/llvmobjdump-llvmorg-21-init-16348-gbd809ffb-13.tar.xz',
32+
- 'sha256sum': 'a8fddab5bd008eeac135e832fe327d15459bc7b1d2ca87a12fa4a9ba3c4be009',
33+
- 'size_bytes': 5317004,
34+
- 'generation': 1752146011233744,
35+
- 'condition': 'host_os == "mac" and host_cpu == "arm64"',
36+
- },
37+
{
38+
'object_name': 'Win/clang-llvmorg-21-init-16348-gbd809ffb-13.tar.xz',
39+
'sha256sum': '1021cc3231615a3556f691820014eb40dc93b4eb714bf4037dced002a454b763',
40+
diff --git a/build/toolchain/apple/toolchain.gni b/build/toolchain/apple/toolchain.gni
41+
index d3fdadf72eb0aa36ae9ae0d4324b61143bc55b66..d5210da1aa3bbda87ca540f67a1768dec70f3675 100644
42+
--- a/build/toolchain/apple/toolchain.gni
43+
+++ b/build/toolchain/apple/toolchain.gni
44+
@@ -115,9 +115,6 @@ template("single_apple_toolchain") {
45+
host_toolchain = host_toolchain
46+
}
47+
48+
- # bin_path is only used in some builds.
49+
- not_needed(invoker, [ "bin_path" ])
50+
-
51+
# When the invoker has explicitly overridden cc_wrapper in the
52+
# toolchain args, use those values, otherwise default to the global one.
53+
# This works because the only reasonable override that toolchains might
54+
@@ -213,7 +210,7 @@ template("single_apple_toolchain") {
55+
linker_driver_args = "-Wcrl,driver,$ld"
56+
57+
# Specify an explicit path for the strip binary.
58+
- _strippath = "${prefix}llvm-strip"
59+
+ _strippath = invoker.bin_path + "strip"
60+
_installnametoolpath = "${prefix}llvm-install-name-tool"
61+
linker_driver_args += " -Wcrl,strippath,${_strippath} -Wcrl,installnametoolpath,${_installnametoolpath}"
62+
_enable_dsyms = enable_dsyms
63+
@@ -496,8 +493,13 @@ template("single_apple_toolchain") {
64+
# search path in /usr/bin are thin wrappers around xcrun, which requires a
65+
# full CommandLineTools or Xcode install, and still may not choose the
66+
# appropriate binary if there are multiple installs.
67+
- nm = "${prefix}llvm-nm"
68+
- otool = "${prefix}llvm-otool"
69+
+ if (host_os == "mac") {
70+
+ nm = invoker.bin_path + "nm"
71+
+ otool = invoker.bin_path + "otool"
72+
+ } else {
73+
+ nm = "${prefix}llvm-nm"
74+
+ otool = "${prefix}llvm-otool"
75+
+ }
76+
77+
link_command = "$linker_driver_env $linker_driver"
78+
link_command += " -Wcrl,otoolpath,$otool -Wcrl,nmpath,$nm"
79+
diff --git a/tools/clang/scripts/sync_deps.py b/tools/clang/scripts/sync_deps.py
80+
index 79871b89f773f9d88c74832ad0488a8f7f3e2405..7c18b8f2ade0889d82251337f62574ed8533dc43 100755
81+
--- a/tools/clang/scripts/sync_deps.py
82+
+++ b/tools/clang/scripts/sync_deps.py
83+
@@ -34,14 +34,12 @@ CLANG_PLATFORM_TO_PACKAGE_FILES = {
84+
'clang-tidy',
85+
'clangd',
86+
'llvm-code-coverage',
87+
- 'llvmobjdump',
88+
],
89+
'Mac_arm64': [
90+
'clang',
91+
'clang-tidy',
92+
'clangd',
93+
'llvm-code-coverage',
94+
- 'llvmobjdump',
95+
],
96+
'Win': [
97+
'clang',

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy