Skip to content

Commit 23db868

Browse files
danakjAravind Vasudevan
authored andcommitted
Pass -isysroot to the linker when running compiletests too
Without this, rustc will fail to perform linking. So we need to pass this to steps where we _use_ the built rustc, not just where we are building it. Bug: 1386212 Change-Id: I842ecc8734df1a5614e02da703bf447d41bbfe3c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4220014 Commit-Queue: danakj <[email protected]> Reviewed-by: Hans Wennborg <[email protected]> Cr-Commit-Position: refs/heads/main@{#1102337} NOKEYCHECK=True GitOrigin-RevId: e8e683582006c7816da596d581c984144d3d4190
1 parent a4d4ee7 commit 23db868

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

build_rust.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def FetchCargo(rust_git_hash):
162162
target = 'cargo-beta-x86_64-pc-windows-msvc'
163163
elif sys.platform == 'darwin':
164164
if platform.machine() == 'arm64':
165-
target = 'rust-std-beta-aarch64-apple-darwin'
165+
target = 'cargo-beta-aarch64-apple-darwin'
166166
else:
167167
target = 'cargo-beta-x86_64-apple-darwin'
168168
else:
@@ -237,6 +237,7 @@ def RunXPy(sub, args, llvm_bins_path, zlib_path, libxml2_dirs, build_mac_arm,
237237
'CFLAGS',
238238
'CXXFLAGS',
239239
'LDFLAGS',
240+
'RUSTFLAGS',
240241
'RUSTFLAGS_BOOTSTRAP',
241242
'RUSTFLAGS_NOT_BOOTSTRAP',
242243
'RUSTDOCFLAGS',
@@ -273,6 +274,10 @@ def RunXPy(sub, args, llvm_bins_path, zlib_path, libxml2_dirs, build_mac_arm,
273274
f' -Clink-arg=-isysroot -Clink-arg={sdk_path}')
274275
RUSTENV['RUSTFLAGS_NOT_BOOTSTRAP'] += (
275276
f' -Clink-arg=-isysroot -Clink-arg={sdk_path}')
277+
# This flag needs to be in RUSTFLAGS for running compiletests as well,
278+
# for building things _with_ rustc, not just for building rustc.
279+
RUSTENV['RUSTFLAGS'] += (
280+
f' -Clink-arg=-isysroot -Clink-arg={sdk_path}')
276281

277282
if zlib_path:
278283
RUSTENV['CFLAGS'] += f' -I{zlib_path}'

0 commit comments

Comments
 (0)