0019.patch (91939B)
1 From: Michael Froman <mfroman@mozilla.com> 2 Date: Tue, 8 Jul 2025 12:33:21 -0500 3 Subject: Bug 1775143 - pt14 - (mirror) 58f47eacaf10 r=ng 4 5 Search third_party/libwebrtc/build for current_cpu, removing 6 third_party/libwebrtc/build/config/BUILDCONFIG.gn 7 and 8 third_party/libwebrtc/build/config/v8_target_cpu.gni from the list. 9 10 ack -lw current_cpu third_party/libwebrtc/build | grep -v "BUILDCONFIG\.gn" | grep -v "v8_target_cpu\.gni" 11 12 That gave me this: 13 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/android/abi.gni 14 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/android/BUILD.gn 15 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/android/config.gni 16 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/android/rules.gni 17 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/arm.gni 18 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/BUILD.gn 19 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/chromecast/BUILD.gn 20 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/chromeos/BUILD.gn 21 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/clang/BUILD.gn 22 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/compiler/BUILD.gn 23 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/compiler/compiler.gni 24 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/compiler/pgo/BUILD.gn 25 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/fuchsia/gn_configs.gni 26 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/ios/BUILD.gn 27 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/ios/rules.gni 28 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/linux/BUILD.gn 29 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/linux/pkg_config.gni 30 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/loongarch64.gni 31 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/mac/BUILD.gn 32 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/mips.gni 33 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/nacl/BUILD.gn 34 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/nacl/config.gni 35 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/nacl/host_toolchain.gni 36 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/nacl/rules.gni 37 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/riscv.gni 38 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/rust.gni 39 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/sanitizers/BUILD.gn 40 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/sanitizers/sanitizers.gni 41 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/sysroot.gni 42 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/config/win/BUILD.gn 43 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/linux/extract_symbols.gni 44 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/rust/std/gnrt_config.toml 45 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/rust/std/rules/BUILD.gn 46 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/toolchain/aix/BUILD.gn 47 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/toolchain/android/BUILD.gn 48 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/toolchain/cros/BUILD.gn 49 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/toolchain/fuchsia/BUILD.gn 50 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/toolchain/gcc_toolchain.gni 51 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/toolchain/ios/BUILD.gn 52 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/toolchain/linux/BUILD.gn 53 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/toolchain/linux/unbundle/BUILD.gn 54 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/toolchain/mac/BUILD.gn 55 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/toolchain/nacl/BUILD.gn 56 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/toolchain/wasm/BUILD.gn 57 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/toolchain/win/BUILD.gn 58 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/toolchain/win/midl.gni 59 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/toolchain/win/toolchain.gni 60 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/toolchain/zos/BUILD.gn 61 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/win/BUILD.gn 62 sed -i 's/current_cpu/target_cpu/g' third_party/libwebrtc/build/win/message_compiler.gni 63 64 (skip-generation) 65 66 Depends on D149827 67 68 Differential Revision: https://phabricator.services.mozilla.com/D149828 69 Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/ec13234e5a641a026e946425ddea2d0de86435cd 70 --- 71 config/BUILD.gn | 2 +- 72 config/android/BUILD.gn | 8 ++-- 73 config/android/abi.gni | 22 ++++----- 74 config/android/config.gni | 16 +++---- 75 config/android/rules.gni | 8 ++-- 76 config/arm.gni | 6 +-- 77 config/chromecast/BUILD.gn | 4 +- 78 config/chromeos/BUILD.gn | 8 ++-- 79 config/clang/BUILD.gn | 36 +++++++------- 80 config/compiler/BUILD.gn | 76 ++++++++++++++--------------- 81 config/compiler/compiler.gni | 22 ++++----- 82 config/compiler/pgo/BUILD.gn | 4 +- 83 config/fuchsia/gn_configs.gni | 2 +- 84 config/ios/BUILD.gn | 10 ++-- 85 config/ios/rules.gni | 2 +- 86 config/linux/BUILD.gn | 4 +- 87 config/linux/pkg_config.gni | 2 +- 88 config/loongarch64.gni | 2 +- 89 config/mac/BUILD.gn | 10 ++-- 90 config/mips.gni | 10 ++-- 91 config/nacl/BUILD.gn | 8 ++-- 92 config/nacl/config.gni | 14 +++--- 93 config/nacl/host_toolchain.gni | 6 +-- 94 config/nacl/rules.gni | 16 +++---- 95 config/riscv.gni | 4 +- 96 config/rust.gni | 52 ++++++++++---------- 97 config/sanitizers/BUILD.gn | 10 ++-- 98 config/sanitizers/sanitizers.gni | 4 +- 99 config/sysroot.gni | 22 ++++----- 100 config/win/BUILD.gn | 18 +++---- 101 linux/extract_symbols.gni | 2 +- 102 rust/std/gnrt_config.toml | 2 +- 103 rust/std/rules/BUILD.gn | 2 +- 104 toolchain/aix/BUILD.gn | 2 +- 105 toolchain/android/BUILD.gn | 18 +++---- 106 toolchain/cros/BUILD.gn | 16 +++---- 107 toolchain/fuchsia/BUILD.gn | 4 +- 108 toolchain/gcc_toolchain.gni | 8 ++-- 109 toolchain/ios/BUILD.gn | 22 ++++----- 110 toolchain/linux/BUILD.gn | 80 +++++++++++++++---------------- 111 toolchain/linux/unbundle/BUILD.gn | 4 +- 112 toolchain/mac/BUILD.gn | 32 ++++++------- 113 toolchain/nacl/BUILD.gn | 10 ++-- 114 toolchain/wasm/BUILD.gn | 2 +- 115 toolchain/win/BUILD.gn | 2 +- 116 toolchain/win/midl.gni | 6 +-- 117 toolchain/win/toolchain.gni | 44 ++++++++--------- 118 toolchain/zos/BUILD.gn | 2 +- 119 win/BUILD.gn | 4 +- 120 win/message_compiler.gni | 2 +- 121 50 files changed, 336 insertions(+), 336 deletions(-) 122 123 diff --git a/config/BUILD.gn b/config/BUILD.gn 124 index 36c03e0dd..7cf351624 100644 125 --- a/config/BUILD.gn 126 +++ b/config/BUILD.gn 127 @@ -124,7 +124,7 @@ config("debug") { 128 # builds, and we have to tell it to turn it off. 129 defines += [ "_HAS_ITERATOR_DEBUGGING=0" ] 130 } 131 - } else if ((is_linux || is_chromeos) && current_cpu == "x64" && 132 + } else if ((is_linux || is_chromeos) && target_cpu == "x64" && 133 enable_iterator_debugging) { 134 # Enable libstdc++ debugging facilities to help catch problems early, see 135 # http://crbug.com/65151 . 136 diff --git a/config/android/BUILD.gn b/config/android/BUILD.gn 137 index 2b2c64ba8..b74b92516 100644 138 --- a/config/android/BUILD.gn 139 +++ b/config/android/BUILD.gn 140 @@ -36,7 +36,7 @@ config("compiler") { 141 "ANDROID_NDK_VERSION_ROLL=${android_ndk_version}_1", 142 ] 143 144 - if (android_64bit_current_cpu) { 145 + if (android_64bit_target_cpu) { 146 _max_page_size = 16384 147 } else { 148 _max_page_size = 4096 149 @@ -54,7 +54,7 @@ config("compiler") { 150 "-Wl,-z,max-page-size=$_max_page_size", 151 ] 152 153 - if (current_cpu == "arm64") { 154 + if (target_cpu == "arm64") { 155 if (arm_control_flow_integrity == "standard") { 156 cflags += [ "-mbranch-protection=standard" ] 157 rustflags = [ "-Zbranch-protection=pac-ret,bti" ] 158 @@ -67,7 +67,7 @@ config("compiler") { 159 # Disable TLSDESC for riscv64 until the Android NDK supports it. While 160 # Chromium's clang turns it on by default for Android RISC-V devices, NDK r27 161 # currently has it disabled. This can likely be removed in NDK r28. 162 - if (current_cpu == "riscv64") { 163 + if (target_cpu == "riscv64") { 164 cflags += [ "-mtls-dialect=trad" ] 165 } 166 167 @@ -122,7 +122,7 @@ config("lld_branch_target_hardening") { 168 # Config opts a shared library into BTI linker hardening. This 169 # is an opt-in config (rather than default-enabled) to avoid 170 # interfering with the V8 CFI bots (crbug.com/1334614). 171 - if (current_cpu == "arm64") { 172 + if (target_cpu == "arm64") { 173 if (arm_control_flow_integrity == "standard") { 174 # Linking objects without GNU_PROPERTY_AARCH64_FEATURE_1_BTI 175 # in their .gnu.note section implicitly results in the final 176 diff --git a/config/android/abi.gni b/config/android/abi.gni 177 index c300f1d6f..567c75b42 100644 178 --- a/config/android/abi.gni 179 +++ b/config/android/abi.gni 180 @@ -36,11 +36,11 @@ declare_args() { 181 assert(!devtools_instrumentation_dumping || use_order_profiling, 182 "devtools_instrumentation_dumping requires use_order_profiling") 183 184 -if (current_cpu == "x86") { 185 +if (target_cpu == "x86") { 186 android_app_abi = "x86" 187 android_abi_target = "i686-linux-android" 188 sanitizer_arch = "i686" 189 -} else if (current_cpu == "arm") { 190 +} else if (target_cpu == "arm") { 191 import("//chromium/build/config/arm.gni") 192 if (arm_version < 7) { 193 android_app_abi = "armeabi" 194 @@ -49,30 +49,30 @@ if (current_cpu == "x86") { 195 } 196 android_abi_target = "arm-linux-androideabi" 197 sanitizer_arch = "arm" 198 -} else if (current_cpu == "mipsel") { 199 +} else if (target_cpu == "mipsel") { 200 android_app_abi = "mips" 201 android_abi_target = "mipsel-linux-android" 202 -} else if (current_cpu == "x64") { 203 +} else if (target_cpu == "x64") { 204 android_app_abi = "x86_64" 205 android_abi_target = "x86_64-linux-android" 206 sanitizer_arch = "x86_64" 207 -} else if (current_cpu == "arm64") { 208 +} else if (target_cpu == "arm64") { 209 android_app_abi = "arm64-v8a" 210 android_abi_target = "aarch64-linux-android" 211 sanitizer_arch = "aarch64" 212 -} else if (current_cpu == "mips64el") { 213 +} else if (target_cpu == "mips64el") { 214 android_app_abi = "mips64" 215 216 # Place holder for mips64 support, not tested. 217 android_abi_target = "mips64el-linux-android" 218 -} else if (current_cpu == "riscv64") { 219 +} else if (target_cpu == "riscv64") { 220 android_app_abi = "riscv64" 221 222 # Place holder for riscv64 support, not tested. 223 android_abi_target = "riscv64-linux-android" 224 sanitizer_arch = "riscv64" 225 } else { 226 - assert(false, "Unknown Android ABI: " + current_cpu) 227 + assert(false, "Unknown Android ABI: " + target_cpu) 228 } 229 230 if (target_cpu == "arm64" || target_cpu == "x64" || target_cpu == "mips64el" || 231 @@ -85,9 +85,9 @@ if (target_cpu == "arm64" || target_cpu == "x64" || target_cpu == "mips64el" || 232 assert(false, "Unknown target CPU: $target_cpu") 233 } 234 235 -android_64bit_current_cpu = 236 - current_cpu == "arm64" || current_cpu == "x64" || 237 - current_cpu == "mips64el" || current_cpu == "riscv64" 238 +android_64bit_target_cpu = 239 + target_cpu == "arm64" || target_cpu == "x64" || 240 + target_cpu == "mips64el" || target_cpu == "riscv64" 241 242 # Do not define android_secondary_abi_cpu or android_app_secondary_abi for 243 # target_cpu's that are 32-bit-only or 64-bit-only, as they are not used. The 244 diff --git a/config/android/config.gni b/config/android/config.gni 245 index 92251bb69..8a6259464 100644 246 --- a/config/android/config.gni 247 +++ b/config/android/config.gni 248 @@ -196,7 +196,7 @@ if (is_android) { 249 # Android did not support 64 bit before API 21. 250 android64_ndk_api_level = 21 251 } 252 - if (current_cpu == "riscv64" && default_min_sdk_version < 35) { 253 + if (target_cpu == "riscv64" && default_min_sdk_version < 35) { 254 # Android did not support RISC-V64 before API 35. 255 android64_ndk_api_level = 35 256 } 257 @@ -369,19 +369,19 @@ if (is_android) { 258 # Location of libgcc. This is only needed for the current GN toolchain, so we 259 # only need to define the current one, rather than one for every platform 260 # like the toolchain roots. 261 - if (current_cpu == "x86") { 262 + if (target_cpu == "x86") { 263 android_prebuilt_arch = "android-x86" 264 - } else if (current_cpu == "arm") { 265 + } else if (target_cpu == "arm") { 266 android_prebuilt_arch = "android-arm" 267 - } else if (current_cpu == "mipsel") { 268 + } else if (target_cpu == "mipsel") { 269 android_prebuilt_arch = "android-mips" 270 - } else if (current_cpu == "x64") { 271 + } else if (target_cpu == "x64") { 272 android_prebuilt_arch = "android-x86_64" 273 - } else if (current_cpu == "arm64") { 274 + } else if (target_cpu == "arm64") { 275 android_prebuilt_arch = "android-arm64" 276 - } else if (current_cpu == "mips64el") { 277 + } else if (target_cpu == "mips64el") { 278 android_prebuilt_arch = "android-mips64" 279 - } else if (current_cpu == "riscv64") { 280 + } else if (target_cpu == "riscv64") { 281 # Place holder for riscv64 support, not tested. 282 android_prebuilt_arch = "android-riscv64" 283 } else { 284 diff --git a/config/android/rules.gni b/config/android/rules.gni 285 index 8fc2e6feb..ceea17924 100644 286 --- a/config/android/rules.gni 287 +++ b/config/android/rules.gni 288 @@ -428,13 +428,13 @@ if (!is_robolectric && enable_java_templates) { 289 # variables must not be set. 290 template("write_native_libraries_java") { 291 _native_libraries_file = "$target_gen_dir/$target_name.srcjar" 292 - if (current_cpu == "arm" || current_cpu == "arm64") { 293 + if (target_cpu == "arm" || target_cpu == "arm64") { 294 _cpu_family = "CPU_FAMILY_ARM" 295 - } else if (current_cpu == "x86" || current_cpu == "x64") { 296 + } else if (target_cpu == "x86" || target_cpu == "x64") { 297 _cpu_family = "CPU_FAMILY_X86" 298 - } else if (current_cpu == "mipsel" || current_cpu == "mips64el") { 299 + } else if (target_cpu == "mipsel" || target_cpu == "mips64el") { 300 _cpu_family = "CPU_FAMILY_MIPS" 301 - } else if (current_cpu == "riscv64") { 302 + } else if (target_cpu == "riscv64") { 303 _cpu_family = "CPU_FAMILY_RISCV" 304 } else { 305 assert(false, "Unsupported CPU family") 306 diff --git a/config/arm.gni b/config/arm.gni 307 index 25e64d430..46416a57e 100644 308 --- a/config/arm.gni 309 +++ b/config/arm.gni 310 @@ -5,11 +5,11 @@ 311 import("//chromium/build/config/chromeos/ui_mode.gni") 312 import("//chromium/build/config/v8_target_cpu.gni") 313 314 -# These are primarily relevant in current_cpu == "arm" contexts, where 315 +# These are primarily relevant in target_cpu == "arm" contexts, where 316 # ARM code is being compiled. But they can also be relevant in the 317 # other contexts when the code will change its behavior based on the 318 # cpu it wants to generate code for. 319 -if (current_cpu == "arm" || v8_current_cpu == "arm") { 320 +if (target_cpu == "arm" || v8_target_cpu == "arm") { 321 declare_args() { 322 # Version of the ARM processor when compiling on ARM. Ignored on non-ARM 323 # platforms. 324 @@ -118,7 +118,7 @@ if (current_cpu == "arm" || v8_current_cpu == "arm") { 325 } 326 } 327 } 328 -} else if (current_cpu == "arm64" || v8_current_cpu == "arm64") { 329 +} else if (target_cpu == "arm64" || v8_target_cpu == "arm64") { 330 # arm64 supports only "hard". 331 arm_float_abi = "hard" 332 arm_use_neon = true 333 diff --git a/config/chromecast/BUILD.gn b/config/chromecast/BUILD.gn 334 index a7e085e46..43aaeb84a 100644 335 --- a/config/chromecast/BUILD.gn 336 +++ b/config/chromecast/BUILD.gn 337 @@ -56,7 +56,7 @@ config("ldconfig") { 338 config("executable_config") { 339 configs = [ ":ldconfig" ] 340 341 - if (!is_clang && current_cpu == "arm") { 342 + if (!is_clang && target_cpu == "arm") { 343 ldflags = [ 344 # Export stdlibc++ and libgcc symbols to force shlibs to refer to these 345 # symbols from the executable. 346 @@ -84,7 +84,7 @@ config("executable_config") { 347 # shared libs to inherit RPATH from the parent executable that is loading 348 # the shared library. (See internal b/37514052 for more details.) 349 config("shared_library_config") { 350 - if (current_cpu == "arm") { 351 + if (target_cpu == "arm") { 352 configs = [ ":static_config" ] 353 } 354 } 355 diff --git a/config/chromeos/BUILD.gn b/config/chromeos/BUILD.gn 356 index f850557db..2bbbd9d28 100644 357 --- a/config/chromeos/BUILD.gn 358 +++ b/config/chromeos/BUILD.gn 359 @@ -12,7 +12,7 @@ config("compiler_cpu_abi") { 360 # the cmake flags that clang was built with. Passing them redundantly 361 # is harmless and prepares for using Chromium's toolchain. 362 if (is_chromeos_device) { 363 - if (current_cpu == "x64") { 364 + if (target_cpu == "x64") { 365 asmflags = [ "--target=x86_64-cros-linux-gnu" ] 366 cflags = [ 367 "--target=x86_64-cros-linux-gnu", 368 @@ -22,16 +22,16 @@ config("compiler_cpu_abi") { 369 "--target=x86_64-cros-linux-gnu", 370 "-mno-movbe", 371 ] 372 - } else if (current_cpu == "arm") { 373 + } else if (target_cpu == "arm") { 374 asmflags = [ "--target=armv7a-cros-linux-gnueabihf" ] 375 cflags = [ "--target=armv7a-cros-linux-gnueabihf" ] 376 ldflags = [ "--target=armv7a-cros-linux-gnueabihf" ] 377 - } else if (current_cpu == "arm64") { 378 + } else if (target_cpu == "arm64") { 379 asmflags = [ "--target=aarch64-cros-linux-gnu" ] 380 cflags = [ "--target=aarch64-cros-linux-gnu" ] 381 ldflags = [ "--target=aarch64-cros-linux-gnu" ] 382 } else { 383 - assert(false, "add support for $current_cpu here") 384 + assert(false, "add support for $target_cpu here") 385 } 386 } 387 } 388 diff --git a/config/clang/BUILD.gn b/config/clang/BUILD.gn 389 index 166c55798..24a3be52e 100644 390 --- a/config/clang/BUILD.gn 391 +++ b/config/clang/BUILD.gn 392 @@ -173,11 +173,11 @@ template("clang_lib") { 393 _dir = "windows" 394 _prefix = "" 395 _ext = "lib" 396 - if (current_cpu == "x64") { 397 + if (target_cpu == "x64") { 398 _suffix = "-x86_64" 399 - } else if (current_cpu == "x86") { 400 + } else if (target_cpu == "x86") { 401 _suffix = "-i386" 402 - } else if (current_cpu == "arm64") { 403 + } else if (target_cpu == "arm64") { 404 _suffix = "-aarch64" 405 } else { 406 assert(false) # Unhandled cpu type 407 @@ -187,48 +187,48 @@ template("clang_lib") { 408 } else if (_use_cros_sysroot_libs) { 409 _clang_lib_dir = _cros_resource_dir 410 _dir = "lib/linux" 411 - if (current_cpu == "x64") { 412 + if (target_cpu == "x64") { 413 _suffix = "-x86_64" 414 - } else if (current_cpu == "x86") { 415 + } else if (target_cpu == "x86") { 416 _suffix = "-i386" 417 - } else if (current_cpu == "arm") { 418 + } else if (target_cpu == "arm") { 419 _suffix = "-armhf" 420 - } else if (current_cpu == "arm64") { 421 + } else if (target_cpu == "arm64") { 422 _suffix = "-aarch64" 423 } else { 424 assert(false) # Unhandled cpu type 425 } 426 } else if (is_linux || is_chromeos) { 427 - if (current_cpu == "x64") { 428 + if (target_cpu == "x64") { 429 _dir = "x86_64-unknown-linux-gnu" 430 - } else if (current_cpu == "x86") { 431 + } else if (target_cpu == "x86") { 432 _dir = "i386-unknown-linux-gnu" 433 - } else if (current_cpu == "arm") { 434 + } else if (target_cpu == "arm") { 435 _dir = "armv7-unknown-linux-gnueabihf" 436 - } else if (current_cpu == "arm64") { 437 + } else if (target_cpu == "arm64") { 438 _dir = "aarch64-unknown-linux-gnu" 439 } else { 440 assert(false) # Unhandled cpu type 441 } 442 } else if (is_fuchsia) { 443 - if (current_cpu == "x64") { 444 + if (target_cpu == "x64") { 445 _dir = "x86_64-unknown-fuchsia" 446 - } else if (current_cpu == "arm64") { 447 + } else if (target_cpu == "arm64") { 448 _dir = "aarch64-unknown-fuchsia" 449 } else { 450 assert(false) # Unhandled cpu type 451 } 452 } else if (is_android) { 453 _dir = "linux" 454 - if (current_cpu == "x64") { 455 + if (target_cpu == "x64") { 456 _suffix = "-x86_64-android" 457 - } else if (current_cpu == "x86") { 458 + } else if (target_cpu == "x86") { 459 _suffix = "-i686-android" 460 - } else if (current_cpu == "arm") { 461 + } else if (target_cpu == "arm") { 462 _suffix = "-arm-android" 463 - } else if (current_cpu == "arm64") { 464 + } else if (target_cpu == "arm64") { 465 _suffix = "-aarch64-android" 466 - } else if (current_cpu == "riscv64") { 467 + } else if (target_cpu == "riscv64") { 468 _suffix = "-riscv64-android" 469 } else { 470 assert(false) # Unhandled cpu type 471 diff --git a/config/compiler/BUILD.gn b/config/compiler/BUILD.gn 472 index 7111affd1..a59a5df6e 100644 473 --- a/config/compiler/BUILD.gn 474 +++ b/config/compiler/BUILD.gn 475 @@ -22,11 +22,11 @@ import("//chromium/build/toolchain/rbe.gni") 476 import("//chromium/build/toolchain/toolchain.gni") 477 import("//build_overrides/build.gni") 478 479 -if (current_cpu == "arm" || current_cpu == "arm64") { 480 +if (target_cpu == "arm" || target_cpu == "arm64") { 481 import("//chromium/build/config/arm.gni") 482 } 483 -if (current_cpu == "mipsel" || current_cpu == "mips64el" || 484 - current_cpu == "mips" || current_cpu == "mips64") { 485 +if (target_cpu == "mipsel" || target_cpu == "mips64el" || 486 + target_cpu == "mips" || target_cpu == "mips64") { 487 import("//chromium/build/config/mips.gni") 488 } 489 if (is_mac) { 490 @@ -217,9 +217,9 @@ if (is_android) { 491 # The orderfile is trained on PGO builds (for arm64) and AFDO builds (for 492 # arm32), so apply them only in these cases. 493 if (defined(default_chrome_orderfile)) { 494 - if (((current_cpu == "arm64" || current_cpu == "x64") && 495 + if (((target_cpu == "arm64" || target_cpu == "x64") && 496 chrome_pgo_phase == 2) || 497 - ((current_cpu == "arm" || current_cpu == "x86") && 498 + ((target_cpu == "arm" || target_cpu == "x86") && 499 clang_use_default_sample_profile)) { 500 chrome_orderfile_path = default_chrome_orderfile 501 } 502 @@ -473,7 +473,7 @@ config("compiler") { 503 # entries). This reduces object file size a bit and makes linking a bit 504 # faster. 505 # On arm64, this is already the default behavior. 506 - if (current_cpu == "x64") { 507 + if (target_cpu == "x64") { 508 asmflags += [ "-femit-dwarf-unwind=no-compact-unwind" ] 509 cflags += [ "-femit-dwarf-unwind=no-compact-unwind" ] 510 } 511 @@ -832,7 +832,7 @@ config("compiler") { 512 513 # TODO(crbug.com/40182783): investigate why this isn't effective on 514 # arm32. 515 - if (!is_android || current_cpu == "arm64") { 516 + if (!is_android || target_cpu == "arm64") { 517 cflags += [ "-fwhole-program-vtables" ] 518 519 if (toolchain_supports_rust_thin_lto) { 520 @@ -858,7 +858,7 @@ config("compiler") { 521 # unless the architecture revision in .ARM.attributes is sufficiently new. 522 # TODO(pcc): The contents of .ARM.attributes should be based on the 523 # -march flag passed at compile time (see llvm.org/pr36291). 524 - if (current_cpu == "arm") { 525 + if (target_cpu == "arm") { 526 ldflags += [ "-march=$arm_arch" ] 527 } 528 } 529 @@ -1087,7 +1087,7 @@ config("compiler") { 530 # 531 # Reduce confusion by making the __ARM_NEON__ #define always available, 532 # as NEON is a mandatory part of ARMv8 anyway. 533 - if (current_cpu == "arm64") { 534 + if (target_cpu == "arm64") { 535 defines += [ "__ARM_NEON__=1" ] 536 } 537 } 538 @@ -1196,13 +1196,13 @@ config("compiler_cpu_abi") { 539 if ((is_posix && !is_apple) || is_fuchsia) { 540 # CPU architecture. We may or may not be doing a cross compile now, so for 541 # simplicity we always explicitly set the architecture. 542 - if (current_cpu == "x64") { 543 + if (target_cpu == "x64") { 544 cflags += [ 545 "-m64", 546 "-msse3", 547 ] 548 ldflags += [ "-m64" ] 549 - } else if (current_cpu == "x86") { 550 + } else if (target_cpu == "x86") { 551 cflags += [ "-m32" ] 552 ldflags += [ "-m32" ] 553 if (!is_nacl) { 554 @@ -1211,7 +1211,7 @@ config("compiler_cpu_abi") { 555 "-msse2", 556 ] 557 } 558 - } else if (current_cpu == "arm") { 559 + } else if (target_cpu == "arm") { 560 if (is_clang && !is_android && !is_nacl && !is_chromeos_device) { 561 cflags += [ "--target=arm-linux-gnueabihf" ] 562 ldflags += [ "--target=arm-linux-gnueabihf" ] 563 @@ -1225,13 +1225,13 @@ config("compiler_cpu_abi") { 564 if (arm_tune != "") { 565 cflags += [ "-mtune=$arm_tune" ] 566 } 567 - } else if (current_cpu == "arm64") { 568 + } else if (target_cpu == "arm64") { 569 if (is_clang && !is_android && !is_nacl && !is_fuchsia && 570 !is_chromeos_device) { 571 cflags += [ "--target=aarch64-linux-gnu" ] 572 ldflags += [ "--target=aarch64-linux-gnu" ] 573 } 574 - } else if (current_cpu == "mipsel" && !is_nacl) { 575 + } else if (target_cpu == "mipsel" && !is_nacl) { 576 ldflags += [ "-Wl,--hash-style=sysv" ] 577 if (custom_toolchain == "") { 578 if (is_clang) { 579 @@ -1316,7 +1316,7 @@ config("compiler_cpu_abi") { 580 } 581 582 cflags += [ "-m${mips_float_abi}-float" ] 583 - } else if (current_cpu == "mips" && !is_nacl) { 584 + } else if (target_cpu == "mips" && !is_nacl) { 585 ldflags += [ "-Wl,--hash-style=sysv" ] 586 if (custom_toolchain == "") { 587 if (is_clang) { 588 @@ -1361,7 +1361,7 @@ config("compiler_cpu_abi") { 589 } 590 591 cflags += [ "-m${mips_float_abi}-float" ] 592 - } else if (current_cpu == "mips64el") { 593 + } else if (target_cpu == "mips64el") { 594 cflags += [ "-D__SANE_USERSPACE_TYPES__" ] 595 ldflags += [ "-Wl,--hash-style=sysv" ] 596 if (custom_toolchain == "") { 597 @@ -1425,7 +1425,7 @@ config("compiler_cpu_abi") { 598 "-Wa,-march=loongson3a", 599 ] 600 } 601 - } else if (current_cpu == "mips64") { 602 + } else if (target_cpu == "mips64") { 603 ldflags += [ "-Wl,--hash-style=sysv" ] 604 if (custom_toolchain == "") { 605 if (is_clang) { 606 @@ -1463,7 +1463,7 @@ config("compiler_cpu_abi") { 607 ] 608 ldflags += [ "-mips64r2" ] 609 } 610 - } else if (current_cpu == "ppc64") { 611 + } else if (target_cpu == "ppc64") { 612 if (current_os == "aix") { 613 cflags += [ "-maix64" ] 614 ldflags += [ "-maix64" ] 615 @@ -1471,13 +1471,13 @@ config("compiler_cpu_abi") { 616 cflags += [ "-m64" ] 617 ldflags += [ "-m64" ] 618 } 619 - } else if (current_cpu == "riscv64") { 620 + } else if (target_cpu == "riscv64") { 621 if (is_clang && !is_android) { 622 cflags += [ "--target=riscv64-linux-gnu" ] 623 ldflags += [ "--target=riscv64-linux-gnu" ] 624 } 625 cflags += [ "-mabi=lp64d" ] 626 - } else if (current_cpu == "loong64") { 627 + } else if (target_cpu == "loong64") { 628 if (is_clang) { 629 cflags += [ "--target=loongarch64-linux-gnu" ] 630 ldflags += [ "--target=loongarch64-linux-gnu" ] 631 @@ -1486,7 +1486,7 @@ config("compiler_cpu_abi") { 632 "-mabi=lp64d", 633 "-mcmodel=medium", 634 ] 635 - } else if (current_cpu == "s390x") { 636 + } else if (target_cpu == "s390x") { 637 cflags += [ "-m64" ] 638 ldflags += [ "-m64" ] 639 } 640 @@ -1507,7 +1507,7 @@ config("compiler_codegen") { 641 configs += [ "//chromium/build/config/nacl:compiler_codegen" ] 642 } 643 644 - if (current_cpu == "arm64" && !is_win && is_clang) { 645 + if (target_cpu == "arm64" && !is_win && is_clang) { 646 # Disable outlining everywhere on arm64 except Win. For more information see 647 # crbug.com/931297 for Android and crbug.com/1410297 for iOS. 648 # TODO(crbug.com/40890229): Enable this on Windows if possible. 649 @@ -1678,7 +1678,7 @@ config("rustc_revision") { 650 } 651 652 config("compiler_arm_fpu") { 653 - if (current_cpu == "arm" && !is_ios && !is_nacl) { 654 + if (target_cpu == "arm" && !is_ios && !is_nacl) { 655 cflags = [ "-mfpu=$arm_fpu" ] 656 if (!arm_use_thumb) { 657 cflags += [ "-marm" ] 658 @@ -1688,14 +1688,14 @@ config("compiler_arm_fpu") { 659 } 660 661 config("compiler_arm_thumb") { 662 - if (current_cpu == "arm" && arm_use_thumb && is_posix && 663 + if (target_cpu == "arm" && arm_use_thumb && is_posix && 664 !(is_apple || is_nacl)) { 665 cflags = [ "-mthumb" ] 666 } 667 } 668 669 config("compiler_arm") { 670 - if (current_cpu == "arm" && is_chromeos) { 671 + if (target_cpu == "arm" && is_chromeos) { 672 # arm is normally the default mode for clang, but on chromeos a wrapper 673 # is used to pass -mthumb, and therefor change the default. 674 cflags = [ "-marm" ] 675 @@ -1894,7 +1894,7 @@ config("default_warnings") { 676 677 # Suppress warnings about ABI changes on ARM (Clang doesn't give this 678 # warning). 679 - if (current_cpu == "arm" && !is_clang) { 680 + if (target_cpu == "arm" && !is_clang) { 681 cflags += [ "-Wno-psabi" ] 682 } 683 684 @@ -2129,10 +2129,10 @@ config("chromium_code") { 685 "__STDC_FORMAT_MACROS", 686 ] 687 688 - if (!is_debug && !using_sanitizer && current_cpu != "s390x" && 689 - current_cpu != "s390" && current_cpu != "ppc64" && 690 - current_cpu != "mips" && current_cpu != "mips64" && 691 - current_cpu != "riscv64" && current_cpu != "loong64") { 692 + if (!is_debug && !using_sanitizer && target_cpu != "s390x" && 693 + target_cpu != "s390" && target_cpu != "ppc64" && 694 + target_cpu != "mips" && target_cpu != "mips64" && 695 + target_cpu != "riscv64" && target_cpu != "loong64") { 696 # Non-chromium code is not guaranteed to compile cleanly with 697 # _FORTIFY_SOURCE. Also, fortified build may fail when optimizations are 698 # disabled, so only do that for Release build. 699 @@ -2412,9 +2412,9 @@ config("no_incompatible_pointer_warnings") { 700 cflags = [] 701 if (is_clang) { 702 cflags += [ "-Wno-incompatible-pointer-types" ] 703 - } else if (current_cpu == "mipsel" || current_cpu == "mips64el") { 704 + } else if (target_cpu == "mipsel" || target_cpu == "mips64el") { 705 cflags += [ "-w" ] 706 - } else if (is_chromeos && current_cpu == "arm") { 707 + } else if (is_chromeos && target_cpu == "arm") { 708 cflags += [ "-w" ] 709 } 710 } 711 @@ -2471,7 +2471,7 @@ if (is_win) { 712 if (is_android) { 713 # TODO(jdduke) Re-enable on mips after resolving linking 714 # issues with libc++ (crbug.com/456380). 715 - if (current_cpu != "mipsel" && current_cpu != "mips64el") { 716 + if (target_cpu != "mipsel" && target_cpu != "mips64el") { 717 common_optimize_on_ldflags += [ 718 # Warn in case of text relocations. 719 "-Wl,--warn-shared-textrel", 720 @@ -2533,7 +2533,7 @@ config("default_stack_frames") { 721 # Omit frame pointers for leaf functions on x86, otherwise building libyuv 722 # gives clang's register allocator issues, see llvm.org/PR15798 / 723 # crbug.com/233709 724 - if (is_clang && current_cpu == "x86" && !is_apple) { 725 + if (is_clang && target_cpu == "x86" && !is_apple) { 726 cflags += [ "-momit-leaf-frame-pointer" ] 727 } 728 } else { 729 @@ -2944,12 +2944,12 @@ config("symbols") { 730 # DWARF info may be corrupt; offsets in a range list entry are in different 731 # sections" there. Maybe just a bug in nacl_switch_32.S. 732 _enable_gdb_index = 733 - symbol_level == 2 && !is_apple && !is_nacl && current_cpu != "x86" && 734 + symbol_level == 2 && !is_apple && !is_nacl && target_cpu != "x86" && 735 current_os != "zos" && use_lld && !is_wasm && 736 # Disable on non-fission 32-bit Android because it pushes 737 # libcomponents_unittests over the 4gb size limit. 738 - !(is_android && !use_debug_fission && current_cpu != "x64" && 739 - current_cpu != "arm64") 740 + !(is_android && !use_debug_fission && target_cpu != "x64" && 741 + target_cpu != "arm64") 742 if (_enable_gdb_index) { 743 if (is_clang) { 744 # This flag enables the GNU-format pubnames and pubtypes sections, 745 @@ -2965,7 +2965,7 @@ config("symbols") { 746 # Compress debug on 32-bit ARM to stay under 4GB file size limit. 747 # https://b/243982712, https://crbug.com/1354616, https://crbug.com/334073642 748 if (symbol_level == 2 && !use_debug_fission && !is_nacl && !is_win && 749 - (current_cpu == "arm" || current_cpu == "x86")) { 750 + (target_cpu == "arm" || target_cpu == "x86")) { 751 configs += [ "//chromium/build/config:compress_debug_sections" ] 752 } 753 754 diff --git a/config/compiler/compiler.gni b/config/compiler/compiler.gni 755 index dd833211b..6bd4710ae 100644 756 --- a/config/compiler/compiler.gni 757 +++ b/config/compiler/compiler.gni 758 @@ -17,7 +17,7 @@ import("//build_overrides/build.gni") 759 if (is_android) { 760 import("//chromium/build/config/android/abi.gni") 761 } 762 -if (current_cpu == "arm" || current_cpu == "arm64") { 763 +if (target_cpu == "arm" || target_cpu == "arm64") { 764 import("//chromium/build/config/arm.gni") 765 } 766 767 @@ -89,7 +89,7 @@ declare_args() { 768 # 769 # It's currently not possible to collect AFDO profiles on anything but 770 # x86{,_64}. 771 - using_mismatched_sample_profile = current_cpu != "x64" && current_cpu != "x86" 772 + using_mismatched_sample_profile = target_cpu != "x64" && target_cpu != "x86" 773 774 # Whether an error should be raised on attempts to make debug builds with 775 # is_component_build=false. Very large debug symbols can have unwanted side 776 @@ -138,7 +138,7 @@ declare_args() { 777 # Use offsets rather than pointers in vtables in order to reduce the number of 778 # relocations. This is safe to enable only when all C++ code is built with the 779 # flag set to the same value. 780 - use_relative_vtables_abi = is_android && current_cpu == "arm64" && 781 + use_relative_vtables_abi = is_android && target_cpu == "arm64" && 782 use_custom_libcxx && !is_component_build 783 } 784 785 @@ -164,14 +164,14 @@ if (is_chromeos) { 786 # However, Clang does not currently generate usable frame pointers in ARM 787 # 32-bit builds (https://bugs.llvm.org/show_bug.cgi?id=18505) so disable them 788 # there to avoid the unnecessary overhead. 789 - enable_frame_pointers = current_cpu != "arm" 790 + enable_frame_pointers = target_cpu != "arm" 791 } else if (is_apple || is_linux) { 792 enable_frame_pointers = true 793 } else if (is_win) { 794 # 64-bit Windows ABI doesn't support frame pointers. 795 # NOTE: This setting is actually not used in the BUILD.gn for Windows, 796 # but it still reflects correctly that we don't emit frame pointers on x64. 797 - if (current_cpu == "x64") { 798 + if (target_cpu == "x64") { 799 enable_frame_pointers = false 800 } else { 801 enable_frame_pointers = true 802 @@ -180,16 +180,16 @@ if (is_chromeos) { 803 enable_frame_pointers = 804 enable_profiling || 805 # Ensure that stacks from arm64 crash dumps are usable (crbug.com/391706). 806 - current_cpu == "arm64" || 807 + target_cpu == "arm64" || 808 # For x86 Android, unwind tables are huge without frame pointers 809 # (crbug.com/762629). Enabling frame pointers grows the code size slightly 810 # but overall shrinks binaries considerably by avoiding huge unwind 811 # tables. 812 - (current_cpu == "x86" && !exclude_unwind_tables && optimize_for_size) || 813 + (target_cpu == "x86" && !exclude_unwind_tables && optimize_for_size) || 814 using_sanitizer 815 } else if (is_fuchsia) { 816 # Fuchsia on arm64 could use shadow call stack for unwinding. 817 - enable_frame_pointers = current_cpu != "arm64" 818 + enable_frame_pointers = target_cpu != "arm64" 819 } else { 820 # Explicitly ask for frame pointers, otherwise stacks may be missing for 821 # sanitizer and profiling builds. 822 @@ -201,7 +201,7 @@ if (is_chromeos) { 823 # most translation units, that they are emitted correctly, and that the 824 # compiler or platform provides a way to access them. 825 can_unwind_with_frame_pointers = enable_frame_pointers 826 -if (current_cpu == "arm" && arm_use_thumb) { 827 +if (target_cpu == "arm" && arm_use_thumb) { 828 # We cannot currently unwind ARM Thumb frame pointers correctly. 829 # See https://bugs.llvm.org/show_bug.cgi?id=18505 830 can_unwind_with_frame_pointers = false 831 @@ -216,12 +216,12 @@ assert(!can_unwind_with_frame_pointers || enable_frame_pointers) 832 # Unwinding with CFI table is only possible on static library builds and 833 # requried only when frame pointers are not enabled. 834 can_unwind_with_cfi_table = is_android && !is_component_build && 835 - !enable_frame_pointers && current_cpu == "arm" 836 + !enable_frame_pointers && target_cpu == "arm" 837 838 # Whether or not cfi table should be enabled on arm. 839 # TODO(crbug.com/40133751): Replace can_unwind_with_cfi_table with this once 840 # sampling profiler is enabled on android. 841 -enable_arm_cfi_table = is_android && !is_component_build && current_cpu == "arm" 842 +enable_arm_cfi_table = is_android && !is_component_build && target_cpu == "arm" 843 844 # Use relative paths for debug info. This is important to make the build 845 # results independent of the checkout and build directory names, which 846 diff --git a/config/compiler/pgo/BUILD.gn b/config/compiler/pgo/BUILD.gn 847 index c0085398b..de7b3ce0e 100644 848 --- a/config/compiler/pgo/BUILD.gn 849 +++ b/config/compiler/pgo/BUILD.gn 850 @@ -62,8 +62,8 @@ config("pgo_optimization_flags") { 851 } else if (is_linux) { 852 _pgo_target = "linux" 853 } else if (is_android) { 854 - # Use |current_cpu| and not |target_cpu|; for Android we may built both. 855 - if (current_cpu == "arm64") { 856 + # Use |target_cpu| and not |target_cpu|; for Android we may built both. 857 + if (target_cpu == "arm64") { 858 _pgo_target = "android-arm64" 859 } else { 860 _pgo_target = "android-arm32" 861 diff --git a/config/fuchsia/gn_configs.gni b/config/fuchsia/gn_configs.gni 862 index 779e908f6..a0152413e 100644 863 --- a/config/fuchsia/gn_configs.gni 864 +++ b/config/fuchsia/gn_configs.gni 865 @@ -51,7 +51,7 @@ declare_args() { 866 867 # Copy from third_party/fuchsia-gn-sdk/src/gn_configs.gni to avoid importing 868 # files from //third_party/ in //build/. 869 -# Note, `current_cpu` should always exist in the //build/ tree, so the 870 +# Note, `target_cpu` should always exist in the //build/ tree, so the 871 # `target_cpu` fallback has been removed. 872 fuchsia_target_api_level = 26 873 fuchsia_arch_root = 874 diff --git a/config/ios/BUILD.gn b/config/ios/BUILD.gn 875 index 6296924b7..5b1a8d701 100644 876 --- a/config/ios/BUILD.gn 877 +++ b/config/ios/BUILD.gn 878 @@ -18,16 +18,16 @@ config("compiler") { 879 common_flags = [] 880 881 # CPU architecture. 882 - if (current_cpu == "x64") { 883 + if (target_cpu == "x64") { 884 triplet_cpu = "x86_64" 885 - } else if (current_cpu == "x86") { 886 + } else if (target_cpu == "x86") { 887 triplet_cpu = "i386" 888 - } else if (current_cpu == "arm" || current_cpu == "armv7") { 889 + } else if (target_cpu == "arm" || target_cpu == "armv7") { 890 triplet_cpu = "armv7" 891 - } else if (current_cpu == "arm64") { 892 + } else if (target_cpu == "arm64") { 893 triplet_cpu = "arm64" 894 } else { 895 - assert(false, "unsupported cpu: $current_cpu") 896 + assert(false, "unsupported cpu: $target_cpu") 897 } 898 899 # Environment. 900 diff --git a/config/ios/rules.gni b/config/ios/rules.gni 901 index e856096bd..af2015aa2 100644 902 --- a/config/ios/rules.gni 903 +++ b/config/ios/rules.gni 904 @@ -381,7 +381,7 @@ template("ios_app_bundle") { 905 "--deployment-target", 906 ios_deployment_target, 907 "--target-cpu", 908 - current_cpu, 909 + target_cpu, 910 "--target-environment", 911 target_environment, 912 "--depfile", 913 diff --git a/config/linux/BUILD.gn b/config/linux/BUILD.gn 914 index 6ba0fde13..a8b6d3d09 100644 915 --- a/config/linux/BUILD.gn 916 +++ b/config/linux/BUILD.gn 917 @@ -15,7 +15,7 @@ group("linux") { 918 # is applied to all targets. It is here to separate out the logic that is 919 # Linux-only. This is not applied to Android, but is applied to ChromeOS. 920 config("compiler") { 921 - if (current_cpu == "arm64") { 922 + if (target_cpu == "arm64") { 923 import("//chromium/build/config/arm.gni") 924 cflags = [] 925 asmflags = [] 926 @@ -43,7 +43,7 @@ config("runtime_library") { 927 # Mozilla disable libatomic on linux builds 928 if (false) { 929 if ((!is_chromeos || default_toolchain != "//chromium/build/toolchain/cros:target") && 930 - (!use_custom_libcxx || current_cpu == "mipsel")) { 931 + (!use_custom_libcxx || target_cpu == "mipsel")) { 932 libs = [ "atomic" ] 933 } 934 } 935 diff --git a/config/linux/pkg_config.gni b/config/linux/pkg_config.gni 936 index c84606ae2..282af364c 100644 937 --- a/config/linux/pkg_config.gni 938 +++ b/config/linux/pkg_config.gni 939 @@ -61,7 +61,7 @@ if (sysroot != "") { 940 "-s", 941 rebase_path(sysroot), 942 "-a", 943 - current_cpu, 944 + target_cpu, 945 ] 946 } 947 948 diff --git a/config/loongarch64.gni b/config/loongarch64.gni 949 index 76e4c9378..4196013a6 100644 950 --- a/config/loongarch64.gni 951 +++ b/config/loongarch64.gni 952 @@ -4,7 +4,7 @@ 953 954 import("//chromium/build/config/v8_target_cpu.gni") 955 956 -if (current_cpu == "loong64") { 957 +if (target_cpu == "loong64") { 958 declare_args() { 959 # LOONGARCH64 SIMD Arch compilation flag. 960 loongarch64_use_lsx = false 961 diff --git a/config/mac/BUILD.gn b/config/mac/BUILD.gn 962 index 4d70334d3..cd7680312 100644 963 --- a/config/mac/BUILD.gn 964 +++ b/config/mac/BUILD.gn 965 @@ -16,14 +16,14 @@ config("compiler") { 966 common_mac_flags = [] 967 968 # CPU architecture. 969 - if (current_cpu == "x64") { 970 + if (target_cpu == "x64") { 971 clang_arch = "x86_64" 972 - } else if (current_cpu == "x86") { 973 + } else if (target_cpu == "x86") { 974 clang_arch = "i386" 975 - } else if (current_cpu == "arm64") { 976 - clang_arch = current_cpu 977 + } else if (target_cpu == "arm64") { 978 + clang_arch = target_cpu 979 } else { 980 - assert(false, "unknown current_cpu $current_cpu") 981 + assert(false, "unknown target_cpu $target_cpu") 982 } 983 common_mac_flags += [ "--target=$clang_arch-apple-macos" ] 984 985 diff --git a/config/mips.gni b/config/mips.gni 986 index 2df1646a8..056856198 100644 987 --- a/config/mips.gni 988 +++ b/config/mips.gni 989 @@ -4,7 +4,7 @@ 990 991 import("//chromium/build/config/v8_target_cpu.gni") 992 993 -# These are primarily relevant in current_cpu == "mips*" contexts, where 994 +# These are primarily relevant in target_cpu == "mips*" contexts, where 995 # MIPS code is being compiled. But they can also be relevant in the 996 # other contexts when the code will change its behavior based on the 997 # cpu it wants to generate code for. 998 @@ -13,8 +13,8 @@ declare_args() { 999 mips_use_mmi = false 1000 } 1001 1002 -if (current_cpu == "mipsel" || v8_current_cpu == "mipsel" || 1003 - current_cpu == "mips" || v8_current_cpu == "mips") { 1004 +if (target_cpu == "mipsel" || v8_target_cpu == "mipsel" || 1005 + target_cpu == "mips" || v8_target_cpu == "mips") { 1006 declare_args() { 1007 # MIPS arch variant. Possible values are: 1008 # "r1" 1009 @@ -43,8 +43,8 @@ if (current_cpu == "mipsel" || v8_current_cpu == "mipsel" || 1010 # "fpxx": sets the GCC -mfpxx option. 1011 mips_fpu_mode = "fp32" 1012 } 1013 -} else if (current_cpu == "mips64el" || v8_current_cpu == "mips64el" || 1014 - current_cpu == "mips64" || v8_current_cpu == "mips64") { 1015 +} else if (target_cpu == "mips64el" || v8_target_cpu == "mips64el" || 1016 + target_cpu == "mips64" || v8_target_cpu == "mips64") { 1017 # MIPS arch variant. Possible values are: 1018 # "r2" 1019 # "r6" 1020 diff --git a/config/nacl/BUILD.gn b/config/nacl/BUILD.gn 1021 index 13489657f..3fcc72f0b 100644 1022 --- a/config/nacl/BUILD.gn 1023 +++ b/config/nacl/BUILD.gn 1024 @@ -17,7 +17,7 @@ config("nacl_defines") { 1025 defines = [ "__STDC_LIMIT_MACROS=1" ] 1026 } 1027 1028 - if (current_cpu == "pnacl") { 1029 + if (target_cpu == "pnacl") { 1030 # TODO: Remove the following definition once NACL_BUILD_ARCH and 1031 # NACL_BUILD_SUBARCH are defined by the PNaCl toolchain. 1032 defines += [ "NACL_BUILD_ARCH=pnacl" ] 1033 @@ -49,7 +49,7 @@ config("nacl_static_libstdc++") { 1034 # libstdc++ can then lead to linking against symbols that are not found when 1035 # running the executable. 1036 # Therefore, link statically instead. 1037 - if (is_linux && current_cpu == "x86") { 1038 + if (is_linux && target_cpu == "x86") { 1039 ldflags = [ "-static-libstdc++" ] 1040 } 1041 } 1042 @@ -76,7 +76,7 @@ config("compiler") { 1043 ldflags = [] 1044 libs = [] 1045 1046 - if (is_clang && current_cpu != "pnacl") { 1047 + if (is_clang && target_cpu != "pnacl") { 1048 # -no-integrated-as is the default in nacl-clang for historical 1049 # compatibility with inline assembly code and so forth. But there 1050 # are no such cases in Chromium code, and -integrated-as is nicer in 1051 @@ -102,7 +102,7 @@ config("compiler_codegen") { 1052 "-fomit-frame-pointer", 1053 ] 1054 1055 - if (current_cpu == "x86") { 1056 + if (target_cpu == "x86") { 1057 # The x86-32 IRT needs to be callable with an under-aligned 1058 # stack; so we disable SSE instructions, which can fault on 1059 # misaligned addresses. See 1060 diff --git a/config/nacl/config.gni b/config/nacl/config.gni 1061 index dd774495e..103cb93d8 100644 1062 --- a/config/nacl/config.gni 1063 +++ b/config/nacl/config.gni 1064 @@ -18,22 +18,22 @@ declare_args() { 1065 nacl_toolchain_dir = "//native_client/toolchain/${host_os}_x86" 1066 1067 if (is_nacl_glibc) { 1068 - if (current_cpu == "x86" || current_cpu == "x64") { 1069 + if (target_cpu == "x86" || target_cpu == "x64") { 1070 nacl_toolchain_package = "nacl_x86_glibc" 1071 - } else if (current_cpu == "arm") { 1072 + } else if (target_cpu == "arm") { 1073 nacl_toolchain_package = "nacl_arm_glibc" 1074 } 1075 } else { 1076 nacl_toolchain_package = "pnacl_newlib" 1077 } 1078 1079 -if (current_cpu == "pnacl") { 1080 +if (target_cpu == "pnacl") { 1081 _nacl_tuple = "pnacl" 1082 -} else if (current_cpu == "x86" || current_cpu == "x64") { 1083 +} else if (target_cpu == "x86" || target_cpu == "x64") { 1084 _nacl_tuple = "x86_64-nacl" 1085 -} else if (current_cpu == "arm") { 1086 +} else if (target_cpu == "arm") { 1087 _nacl_tuple = "arm-nacl" 1088 -} else if (current_cpu == "mipsel") { 1089 +} else if (target_cpu == "mipsel") { 1090 _nacl_tuple = "mipsel-nacl" 1091 } else { 1092 # In order to allow this file to be included unconditionally 1093 @@ -49,5 +49,5 @@ nacl_toolchain_tooldir = 1094 "${nacl_toolchain_dir}/${nacl_toolchain_package}/${_nacl_tuple}" 1095 nacl_toolprefix = "${nacl_toolchain_bindir}/${_nacl_tuple}-" 1096 1097 -nacl_irt_toolchain = "//chromium/build/toolchain/nacl:irt_" + current_cpu 1098 +nacl_irt_toolchain = "//chromium/build/toolchain/nacl:irt_" + target_cpu 1099 is_nacl_irt = current_toolchain == nacl_irt_toolchain 1100 diff --git a/config/nacl/host_toolchain.gni b/config/nacl/host_toolchain.gni 1101 index f877fe47b..f6fabf23e 100644 1102 --- a/config/nacl/host_toolchain.gni 1103 +++ b/config/nacl/host_toolchain.gni 1104 @@ -5,14 +5,14 @@ 1105 default_nacl_bootstrap_compiler = "g++" 1106 if (default_toolchain == "//chromium/build/toolchain/cros:target") { 1107 import("//chromium/build/toolchain/cros_toolchain.gni") 1108 - if (target_cpu == "arm64" && current_cpu == "arm") { 1109 + if (target_cpu == "arm64" && target_cpu == "arm") { 1110 default_nacl_bootstrap_compiler = cros_nacl_helper_arm32_cxx 1111 } else { 1112 default_nacl_bootstrap_compiler = cros_target_cxx 1113 } 1114 -} else if (current_cpu == "arm" && !is_android) { 1115 +} else if (target_cpu == "arm" && !is_android) { 1116 default_nacl_bootstrap_compiler = "arm-linux-gnueabihf-g++" 1117 -} else if (current_cpu == "mipsel" && !is_android) { 1118 +} else if (target_cpu == "mipsel" && !is_android) { 1119 default_nacl_bootstrap_compiler = "mipsel-linux-gnu-g++" 1120 } 1121 1122 diff --git a/config/nacl/rules.gni b/config/nacl/rules.gni 1123 index 7d916e8f5..5a0daf061 100644 1124 --- a/config/nacl/rules.gni 1125 +++ b/config/nacl/rules.gni 1126 @@ -40,7 +40,7 @@ template("generate_nmf") { 1127 # TODO(phosek): Remove this conditional once 1128 # https://bugs.chromium.org/p/nativeclient/issues/detail?id=4339 is 1129 # resolved. 1130 - if (current_cpu == "pnacl") { 1131 + if (target_cpu == "pnacl") { 1132 objdump = rebase_path("${nacl_toolchain_bindir}/x86_64-nacl-objdump") 1133 } else { 1134 objdump = rebase_path("${nacl_toolprefix}objdump") 1135 @@ -75,18 +75,18 @@ template("generate_nmf") { 1136 # NOTE: There is no explicit dependency for the lib directory 1137 # (lib32 and lib64 for x86/x64) created in the product directory. 1138 # They are created as a side-effect of nmf creation. 1139 - if (current_cpu != "x86" && current_cpu != "x64") { 1140 + if (target_cpu != "x86" && target_cpu != "x64") { 1141 nmfflags += 1142 [ "--library-path=" + 1143 rebase_path("${nacl_toolchain_tooldir}/lib", root_build_dir) ] 1144 - if (current_cpu == "arm") { 1145 + if (target_cpu == "arm") { 1146 data += [ "${lib_path}/libarm/" ] 1147 } else { 1148 data += [ "${lib_path}/lib/" ] 1149 } 1150 } else { 1151 # For x86-32, the lib/ directory is called lib32/ instead. 1152 - if (current_cpu == "x86") { 1153 + if (target_cpu == "x86") { 1154 nmfflags += 1155 [ "--library-path=" + 1156 rebase_path("${nacl_toolchain_tooldir}/lib32", root_build_dir) ] 1157 @@ -98,12 +98,12 @@ template("generate_nmf") { 1158 # gets handled at a higher level (see the nacl_test_data template), 1159 # so a single generate_nmf invocation gets both x86-32 and x86-64 1160 # nexes listed in executables. 1161 - if (current_cpu == "x64" || target_os == "win") { 1162 + if (target_cpu == "x64" || target_os == "win") { 1163 # For x86-64, the lib/ directory is called lib64/ instead 1164 # when copied by create_nmf.py. 1165 glibc_tc = "//chromium/build/toolchain/nacl:glibc" 1166 - assert(current_toolchain == "${glibc_tc}_${current_cpu}") 1167 - if (current_cpu == "x64") { 1168 + assert(current_toolchain == "${glibc_tc}_${target_cpu}") 1169 + if (target_cpu == "x64") { 1170 x64_out_dir = root_out_dir 1171 } else { 1172 x64_out_dir = get_label_info(":${target_name}(${glibc_tc}_x64)", 1173 @@ -123,7 +123,7 @@ template("generate_nmf") { 1174 "--objdump=" + rebase_path(objdump, root_build_dir), 1175 "--output=" + rebase_path(nmf, root_build_dir), 1176 ] + nmfflags + rebase_path(sources, root_build_dir) 1177 - if (is_nacl_glibc && current_cpu == "arm") { 1178 + if (is_nacl_glibc && target_cpu == "arm") { 1179 deps += [ "//native_client/src/untrusted/elf_loader:elf_loader" ] 1180 } 1181 } 1182 diff --git a/config/riscv.gni b/config/riscv.gni 1183 index afe2c7aee..a0a163ab8 100644 1184 --- a/config/riscv.gni 1185 +++ b/config/riscv.gni 1186 @@ -4,8 +4,8 @@ 1187 1188 import("//chromium/build/config/v8_target_cpu.gni") 1189 1190 -if (current_cpu == "riscv64" || v8_current_cpu == "riscv64" || 1191 - current_cpu == "riscv32" || v8_current_cpu == "riscv32") { 1192 +if (target_cpu == "riscv64" || v8_target_cpu == "riscv64" || 1193 + target_cpu == "riscv32" || v8_target_cpu == "riscv32") { 1194 declare_args() { 1195 # RISCV Vector extension compilation flag. 1196 riscv_use_rvv = false 1197 diff --git a/config/rust.gni b/config/rust.gni 1198 index 0b032436a..6dd7de5fb 100644 1199 --- a/config/rust.gni 1200 +++ b/config/rust.gni 1201 @@ -174,16 +174,16 @@ if (enable_rust) { 1202 # https://issues.chromium.org/u/1/issues/372512092#comment5 for an example. 1203 rust_abi_target = "" 1204 if (is_linux || is_chromeos) { 1205 - if (current_cpu == "arm64") { 1206 + if (target_cpu == "arm64") { 1207 rust_abi_target = "aarch64-unknown-linux-gnu" 1208 cargo_target_abi = "" 1209 - } else if (current_cpu == "x86") { 1210 + } else if (target_cpu == "x86") { 1211 rust_abi_target = "i686-unknown-linux-gnu" 1212 cargo_target_abi = "" 1213 - } else if (current_cpu == "x64") { 1214 + } else if (target_cpu == "x64") { 1215 rust_abi_target = "x86_64-unknown-linux-gnu" 1216 cargo_target_abi = "" 1217 - } else if (current_cpu == "arm") { 1218 + } else if (target_cpu == "arm") { 1219 if (arm_float_abi == "hard") { 1220 float_suffix = "hf" 1221 } else { 1222 @@ -210,12 +210,12 @@ if (is_linux || is_chromeos) { 1223 rust_abi_target = "arm-unknown-linux-gnueabi" + float_suffix 1224 cargo_target_abi = "eabi" + float_suffix 1225 } 1226 - } else if (current_cpu == "riscv64") { 1227 + } else if (target_cpu == "riscv64") { 1228 rust_abi_target = "riscv64gc-unknown-linux-gnu" 1229 cargo_target_abi = "" 1230 } else { 1231 # Best guess for other future platforms. 1232 - rust_abi_target = current_cpu + "-unknown-linux-gnu" 1233 + rust_abi_target = target_cpu + "-unknown-linux-gnu" 1234 cargo_target_abi = "" 1235 } 1236 } else if (is_android) { 1237 @@ -255,17 +255,17 @@ if (is_linux || is_chromeos) { 1238 assert(false, "Unknown Android ABI: " + android_abi_target) 1239 } 1240 } else if (is_fuchsia) { 1241 - if (current_cpu == "arm64") { 1242 + if (target_cpu == "arm64") { 1243 rust_abi_target = "aarch64-unknown-fuchsia" 1244 cargo_target_abi = "" 1245 - } else if (current_cpu == "x64") { 1246 + } else if (target_cpu == "x64") { 1247 rust_abi_target = "x86_64-unknown-fuchsia" 1248 cargo_target_abi = "" 1249 } else { 1250 assert(false, "Architecture not supported") 1251 } 1252 } else if (is_ios) { 1253 - if (current_cpu == "arm64") { 1254 + if (target_cpu == "arm64") { 1255 if (target_platform == "iphoneos") { 1256 if (target_environment == "simulator") { 1257 rust_abi_target = "aarch64-apple-ios-sim" 1258 @@ -292,10 +292,10 @@ if (is_linux || is_chromeos) { 1259 } else { 1260 assert(false, "unsupported target_platform=$target_platform") 1261 } 1262 - } else if (current_cpu == "arm") { 1263 + } else if (target_cpu == "arm") { 1264 rust_abi_target = "armv7s-apple-ios" 1265 cargo_target_abi = "" 1266 - } else if (current_cpu == "x64") { 1267 + } else if (target_cpu == "x64") { 1268 if (target_platform == "iphoneos") { 1269 if (target_environment == "simulator") { 1270 rust_abi_target = "x86_64-apple-ios" 1271 @@ -316,29 +316,29 @@ if (is_linux || is_chromeos) { 1272 } else { 1273 assert(false, "unsupported target_platform=$target_platform") 1274 } 1275 - } else if (current_cpu == "x86") { 1276 + } else if (target_cpu == "x86") { 1277 rust_abi_target = "i386-apple-ios" 1278 } else { 1279 assert(false, "Architecture not supported") 1280 } 1281 } else if (is_mac) { 1282 - if (current_cpu == "arm64") { 1283 + if (target_cpu == "arm64") { 1284 rust_abi_target = "aarch64-apple-darwin" 1285 cargo_target_abi = "" 1286 - } else if (current_cpu == "x64") { 1287 + } else if (target_cpu == "x64") { 1288 rust_abi_target = "x86_64-apple-darwin" 1289 cargo_target_abi = "" 1290 } else { 1291 assert(false, "Architecture not supported") 1292 } 1293 } else if (is_win) { 1294 - if (current_cpu == "arm64") { 1295 + if (target_cpu == "arm64") { 1296 rust_abi_target = "aarch64-pc-windows-msvc" 1297 cargo_target_abi = "" 1298 - } else if (current_cpu == "x64") { 1299 + } else if (target_cpu == "x64") { 1300 rust_abi_target = "x86_64-pc-windows-msvc" 1301 cargo_target_abi = "" 1302 - } else if (current_cpu == "x86") { 1303 + } else if (target_cpu == "x86") { 1304 rust_abi_target = "i686-pc-windows-msvc" 1305 cargo_target_abi = "" 1306 } else { 1307 @@ -350,23 +350,23 @@ assert(!toolchain_has_rust || rust_abi_target != "") 1308 1309 # This variable is passed to the Rust libstd build. 1310 rust_target_arch = "" 1311 -if (current_cpu == "x86") { 1312 +if (target_cpu == "x86") { 1313 rust_target_arch = "x86" 1314 -} else if (current_cpu == "x64") { 1315 +} else if (target_cpu == "x64") { 1316 rust_target_arch = "x86_64" 1317 -} else if (current_cpu == "arm") { 1318 +} else if (target_cpu == "arm") { 1319 rust_target_arch = "arm" 1320 -} else if (current_cpu == "arm64") { 1321 +} else if (target_cpu == "arm64") { 1322 rust_target_arch = "aarch64" 1323 -} else if (current_cpu == "mipsel") { 1324 +} else if (target_cpu == "mipsel") { 1325 rust_target_arch = "mips" 1326 -} else if (current_cpu == "mips64el") { 1327 +} else if (target_cpu == "mips64el") { 1328 rust_target_arch = "mips64" 1329 -} else if (current_cpu == "s390x") { 1330 +} else if (target_cpu == "s390x") { 1331 rust_target_arch = "s390x" 1332 -} else if (current_cpu == "ppc64") { 1333 +} else if (target_cpu == "ppc64") { 1334 rust_target_arch = "powerpc64" 1335 -} else if (current_cpu == "riscv64") { 1336 +} else if (target_cpu == "riscv64") { 1337 rust_target_arch = "riscv64" 1338 } 1339 1340 diff --git a/config/sanitizers/BUILD.gn b/config/sanitizers/BUILD.gn 1341 index 3f1e1f285..cb36e20a2 100644 1342 --- a/config/sanitizers/BUILD.gn 1343 +++ b/config/sanitizers/BUILD.gn 1344 @@ -82,7 +82,7 @@ group("deps") { 1345 } 1346 } 1347 1348 -assert(!(is_win && is_asan && current_cpu == "x86"), 1349 +assert(!(is_win && is_asan && target_cpu == "x86"), 1350 "ASan is only supported in 64-bit builds on Windows.") 1351 1352 if ((is_apple || is_win) && (is_asan || is_ubsan_any)) { 1353 @@ -104,7 +104,7 @@ if ((is_apple || is_win) && (is_asan || is_ubsan_any)) { 1354 assert(is_ubsan_any) 1355 _clang_rt_dso_path = "darwin/libclang_rt.ubsan_iossim_dynamic.dylib" 1356 } 1357 - } else if (is_win && current_cpu == "x64") { 1358 + } else if (is_win && target_cpu == "x64") { 1359 if (is_asan) { 1360 _clang_rt_dso_path = "windows/clang_rt.asan_dynamic-x86_64.dll" 1361 } else { 1362 @@ -288,7 +288,7 @@ config("default_sanitizer_ldflags") { 1363 # or -fsanitize=fuzzer. 1364 ldflags = [] 1365 if (is_asan) { 1366 - assert(current_cpu == "x64", "WinASan unsupported architecture") 1367 + assert(target_cpu == "x64", "WinASan unsupported architecture") 1368 libs = [ "clang_rt.asan_dynamic-x86_64.lib" ] 1369 if (is_component_build) { 1370 ldflags += 1371 @@ -299,7 +299,7 @@ config("default_sanitizer_ldflags") { 1372 } 1373 } 1374 if (use_libfuzzer) { 1375 - assert(current_cpu == "x64", "LibFuzzer unsupported architecture") 1376 + assert(target_cpu == "x64", "LibFuzzer unsupported architecture") 1377 assert(!is_component_build, 1378 "LibFuzzer only supports non-component builds on Windows") 1379 1380 @@ -457,7 +457,7 @@ config("coverage_flags") { 1381 "-mllvm", 1382 "-sanitizer-coverage-prune-blocks=1", 1383 ] 1384 - if (current_cpu == "arm") { 1385 + if (target_cpu == "arm") { 1386 # http://crbug.com/517105 1387 cflags += [ 1388 "-mllvm", 1389 diff --git a/config/sanitizers/sanitizers.gni b/config/sanitizers/sanitizers.gni 1390 index 105b28470..b3c4413ce 100644 1391 --- a/config/sanitizers/sanitizers.gni 1392 +++ b/config/sanitizers/sanitizers.gni 1393 @@ -229,7 +229,7 @@ if (!is_a_target_toolchain || toolchain_for_rust_host_build_tools) { 1394 use_locally_built_instrumented_libraries = false 1395 use_sanitizer_coverage = false 1396 enable_fuzztest_fuzz = false 1397 -} else if (current_cpu != "arm64") { 1398 +} else if (target_cpu != "arm64") { 1399 is_hwasan = false 1400 } 1401 1402 @@ -330,7 +330,7 @@ if (use_libfuzzer && (is_linux || is_chromeos)) { 1403 assert(!is_debug || !(is_msan || is_ubsan || is_ubsan_vptr), 1404 "Sanitizers should generally be used in release (set is_debug=false).") 1405 1406 -assert(!is_msan || ((is_linux || is_chromeos) && current_cpu == "x64"), 1407 +assert(!is_msan || ((is_linux || is_chromeos) && target_cpu == "x64"), 1408 "MSan currently only works on 64-bit Linux and ChromeOS builds.") 1409 1410 assert(!is_lsan || is_asan, "is_lsan = true requires is_asan = true also.") 1411 diff --git a/config/sysroot.gni b/config/sysroot.gni 1412 index 6d96c685d..e1834c9b2 100644 1413 --- a/config/sysroot.gni 1414 +++ b/config/sysroot.gni 1415 @@ -20,13 +20,13 @@ declare_args() { 1416 # Controls default is_linux sysroot. If set to true, and sysroot 1417 # is empty, default sysroot is calculated. 1418 use_sysroot = 1419 - current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm" || 1420 - current_cpu == "arm64" || current_cpu == "mipsel" || 1421 - current_cpu == "mips64el" || (current_cpu == "riscv64" && is_android) 1422 + target_cpu == "x86" || target_cpu == "x64" || target_cpu == "arm" || 1423 + target_cpu == "arm64" || target_cpu == "mipsel" || 1424 + target_cpu == "mips64el" || (target_cpu == "riscv64" && is_android) 1425 } 1426 1427 if (sysroot == "") { 1428 - if (current_os == target_os && current_cpu == target_cpu && 1429 + if (current_os == target_os && target_cpu == target_cpu && 1430 target_sysroot != "") { 1431 sysroot = target_sysroot 1432 } else if (is_android) { 1433 @@ -37,24 +37,24 @@ if (sysroot == "") { 1434 } else if ((is_linux || is_chromeos) && use_sysroot) { 1435 # By default build against a sysroot image downloaded from Cloud Storage 1436 # during gclient runhooks. 1437 - if (current_cpu == "x64") { 1438 + if (target_cpu == "x64") { 1439 sysroot = "$target_sysroot_dir/debian_bullseye_amd64-sysroot" 1440 - } else if (current_cpu == "x86") { 1441 + } else if (target_cpu == "x86") { 1442 sysroot = "$target_sysroot_dir/debian_bullseye_i386-sysroot" 1443 - } else if (current_cpu == "mipsel") { 1444 + } else if (target_cpu == "mipsel") { 1445 sysroot = "$target_sysroot_dir/debian_bullseye_mipsel-sysroot" 1446 - } else if (current_cpu == "mips64el") { 1447 + } else if (target_cpu == "mips64el") { 1448 sysroot = "$target_sysroot_dir/debian_bullseye_mips64el-sysroot" 1449 - } else if (current_cpu == "arm") { 1450 + } else if (target_cpu == "arm") { 1451 sysroot = "$target_sysroot_dir/debian_bullseye_armhf-sysroot" 1452 - } else if (current_cpu == "arm64") { 1453 + } else if (target_cpu == "arm64") { 1454 sysroot = "$target_sysroot_dir/debian_bullseye_arm64-sysroot" 1455 } else { 1456 assert(false, "No linux sysroot for cpu: $target_cpu") 1457 } 1458 1459 if (sysroot != "") { 1460 - _script_arch = current_cpu 1461 + _script_arch = target_cpu 1462 if (_script_arch == "x86") { 1463 _script_arch = "i386" 1464 } else if (_script_arch == "x64") { 1465 diff --git a/config/win/BUILD.gn b/config/win/BUILD.gn 1466 index 94bf8c16c..430fb1a7a 100644 1467 --- a/config/win/BUILD.gn 1468 +++ b/config/win/BUILD.gn 1469 @@ -48,7 +48,7 @@ declare_args() { 1470 # is applied to all targets. It is here to separate out the logic that is 1471 # Windows-only. 1472 config("compiler") { 1473 - if (current_cpu == "x86") { 1474 + if (target_cpu == "x86") { 1475 asmflags = [ 1476 # When /safeseh is specified, the linker will only produce an image if it 1477 # can also produce a table of the image's safe exception handlers. This 1478 @@ -99,28 +99,28 @@ config("compiler") { 1479 ] 1480 } 1481 1482 - if (current_cpu == "x86") { 1483 + if (target_cpu == "x86") { 1484 if (host_cpu == "x86" || host_cpu == "x64") { 1485 cflags += [ "-m32" ] 1486 } else { 1487 cflags += [ "--target=i386-windows" ] 1488 } 1489 - } else if (current_cpu == "x64") { 1490 + } else if (target_cpu == "x64") { 1491 if (host_cpu == "x86" || host_cpu == "x64") { 1492 cflags += [ "-m64" ] 1493 } else { 1494 cflags += [ "--target=x86_64-windows" ] 1495 } 1496 - } else if (current_cpu == "arm64") { 1497 + } else if (target_cpu == "arm64") { 1498 cflags += [ "--target=aarch64-pc-windows" ] 1499 } else { 1500 - assert(false, "unknown current_cpu " + current_cpu) 1501 + assert(false, "unknown target_cpu " + target_cpu) 1502 } 1503 1504 # Chrome currently requires SSE3. Clang supports targeting any Intel 1505 # microarchitecture. MSVC only supports a subset of architectures, and the 1506 # next step after SSE2 will be AVX. 1507 - if (current_cpu == "x86" || current_cpu == "x64") { 1508 + if (target_cpu == "x86" || target_cpu == "x64") { 1509 cflags += [ "-msse3" ] 1510 } 1511 1512 @@ -301,7 +301,7 @@ config("winver") { 1513 1514 # Linker flags for Windows SDK setup, this is applied only to EXEs and DLLs. 1515 config("sdk_link") { 1516 - if (current_cpu == "x86") { 1517 + if (target_cpu == "x86") { 1518 ldflags = [ 1519 "/SAFESEH", # Not compatible with x64 so use only for x86. 1520 "/largeaddressaware", 1521 @@ -478,12 +478,12 @@ config("delayloads_not_for_child_dll") { 1522 # sandboxed processes in an app container when run from the out directory. 1523 group("maybe_set_appcontainer_acls") { 1524 # Exclude setting ACLs when build is not happening on chromium, or with a different toolchain. 1525 - if (build_with_chromium && current_cpu == target_cpu && host_os == "win") { 1526 + if (build_with_chromium && target_cpu == target_cpu && host_os == "win") { 1527 deps = [ ":set_appcontainer_acls" ] 1528 } 1529 } 1530 1531 -if (build_with_chromium && current_cpu == target_cpu && host_os == "win") { 1532 +if (build_with_chromium && target_cpu == target_cpu && host_os == "win") { 1533 action("set_appcontainer_acls") { 1534 script = "//chromium/build/win/set_appcontainer_acls.py" 1535 stamp_file = "$target_out_dir/acls.stamp" 1536 diff --git a/linux/extract_symbols.gni b/linux/extract_symbols.gni 1537 index af40a7cd8..f9ecbb094 100644 1538 --- a/linux/extract_symbols.gni 1539 +++ b/linux/extract_symbols.gni 1540 @@ -10,7 +10,7 @@ import("//chromium/build/toolchain/toolchain.gni") 1541 # binary: Path to the binary containing symbols to extract, e.g.: 1542 # "$root_out_dir/chrome" 1543 # symbol_file: Desired output file for symbols, e.g.: 1544 -# "$root_out_dir/chrome.breakpad.$current_cpu" 1545 +# "$root_out_dir/chrome.breakpad.$target_cpu" 1546 template("extract_symbols") { 1547 forward_variables_from(invoker, 1548 [ 1549 diff --git a/rust/std/gnrt_config.toml b/rust/std/gnrt_config.toml 1550 index d920be21f..3fc98bdf1 100644 1551 --- a/rust/std/gnrt_config.toml 1552 +++ b/rust/std/gnrt_config.toml 1553 @@ -45,7 +45,7 @@ extra_kv = { include_coverage = true } 1554 # Dependencies of profiler_builtins must have instrumentation disabled 1555 # The build script conditionally generates a file; it's simplest to just paste 1556 # raw GN into the output. (crbug.com/1470653) 1557 -extra_kv = { include_coverage = false, raw_gn = 'if (current_cpu == "arm64") { build_script_outputs = ["outlined_atomics.rs"] }' } 1558 +extra_kv = { include_coverage = false, raw_gn = 'if (target_cpu == "arm64") { build_script_outputs = ["outlined_atomics.rs"] }' } 1559 extra_src_roots = [ 1560 # compiler_builtins depends on libm on windows crbug.com/1472681 1561 '../libm', 1562 diff --git a/rust/std/rules/BUILD.gn b/rust/std/rules/BUILD.gn 1563 index d5f8efac4..3a31c32ff 100644 1564 --- a/rust/std/rules/BUILD.gn 1565 +++ b/rust/std/rules/BUILD.gn 1566 @@ -555,7 +555,7 @@ cargo_crate("compiler_builtins") { 1567 output_dir = 1568 "$root_out_dir/local_rustc_sysroot/lib/rustlib/$rust_abi_target/lib/" 1569 1570 - if (current_cpu == "arm64") { 1571 + if (target_cpu == "arm64") { 1572 build_script_outputs = [ "outlined_atomics.rs" ] 1573 } 1574 } 1575 diff --git a/toolchain/aix/BUILD.gn b/toolchain/aix/BUILD.gn 1576 index 1f8132a8d..4d1e2c1b7 100644 1577 --- a/toolchain/aix/BUILD.gn 1578 +++ b/toolchain/aix/BUILD.gn 1579 @@ -14,7 +14,7 @@ gcc_toolchain("ppc64") { 1580 ld = cxx 1581 1582 toolchain_args = { 1583 - current_cpu = "ppc64" 1584 + target_cpu = "ppc64" 1585 current_os = "aix" 1586 1587 # reclient does not support gcc. 1588 diff --git a/toolchain/android/BUILD.gn b/toolchain/android/BUILD.gn 1589 index 5bba14cad..6957bb620 100644 1590 --- a/toolchain/android/BUILD.gn 1591 +++ b/toolchain/android/BUILD.gn 1592 @@ -52,37 +52,37 @@ template("android_clang_toolchain") { 1593 1594 android_clang_toolchain("android_clang_x86") { 1595 toolchain_args = { 1596 - current_cpu = "x86" 1597 + target_cpu = "x86" 1598 } 1599 } 1600 1601 android_clang_toolchain("android_clang_arm") { 1602 toolchain_args = { 1603 - current_cpu = "arm" 1604 + target_cpu = "arm" 1605 } 1606 } 1607 1608 android_clang_toolchain("android_clang_mipsel") { 1609 toolchain_args = { 1610 - current_cpu = "mipsel" 1611 + target_cpu = "mipsel" 1612 } 1613 } 1614 1615 android_clang_toolchain("android_clang_x64") { 1616 toolchain_args = { 1617 - current_cpu = "x64" 1618 + target_cpu = "x64" 1619 } 1620 } 1621 1622 android_clang_toolchain("android_clang_arm64") { 1623 toolchain_args = { 1624 - current_cpu = "arm64" 1625 + target_cpu = "arm64" 1626 } 1627 } 1628 1629 android_clang_toolchain("android_clang_arm64_hwasan") { 1630 toolchain_args = { 1631 - current_cpu = "arm64" 1632 + target_cpu = "arm64" 1633 is_hwasan = true 1634 android64_ndk_api_level = 29 1635 } 1636 @@ -90,14 +90,14 @@ android_clang_toolchain("android_clang_arm64_hwasan") { 1637 1638 android_clang_toolchain("android_clang_mips64el") { 1639 toolchain_args = { 1640 - current_cpu = "mips64el" 1641 + target_cpu = "mips64el" 1642 } 1643 } 1644 1645 # Placeholder for riscv64 support, not tested since the toolchain is not ready. 1646 android_clang_toolchain("android_clang_riscv64") { 1647 toolchain_args = { 1648 - current_cpu = "riscv64" 1649 + target_cpu = "riscv64" 1650 } 1651 } 1652 1653 @@ -113,7 +113,7 @@ android_clang_toolchain("android_clang_riscv64") { 1654 clang_toolchain("robolectric_$host_cpu") { 1655 toolchain_args = { 1656 current_os = host_os 1657 - current_cpu = host_cpu 1658 + target_cpu = host_cpu 1659 is_robolectric = true 1660 if (build_with_chromium) { 1661 # Forwarding this value from the primary toolchain to the secondary 1662 diff --git a/toolchain/cros/BUILD.gn b/toolchain/cros/BUILD.gn 1663 index a25f18b66..9be1ec133 100644 1664 --- a/toolchain/cros/BUILD.gn 1665 +++ b/toolchain/cros/BUILD.gn 1666 @@ -57,7 +57,7 @@ template("cros_toolchain") { 1667 # This is the normal toolchain for most targets. 1668 cros_toolchain("target") { 1669 toolchain_args = { 1670 - current_cpu = target_cpu 1671 + target_cpu = target_cpu 1672 current_os = "chromeos" 1673 sysroot = target_sysroot 1674 } 1675 @@ -90,9 +90,9 @@ cros_toolchain("target") { 1676 cros_toolchain("nacl_bootstrap") { 1677 toolchain_args = { 1678 if (target_cpu == "arm64") { 1679 - current_cpu = "arm" 1680 + target_cpu = "arm" 1681 } else { 1682 - current_cpu = target_cpu 1683 + target_cpu = target_cpu 1684 } 1685 current_os = "chromeos" 1686 use_debug_fission = false 1687 @@ -136,7 +136,7 @@ cros_toolchain("nacl_bootstrap") { 1688 # building an Arm32 nacl_helper binary on Arm64 ChromeOS targets. 1689 cros_toolchain("nacl_helper_arm32") { 1690 toolchain_args = { 1691 - current_cpu = "arm" 1692 + target_cpu = "arm" 1693 current_os = "chromeos" 1694 use_debug_fission = false 1695 sysroot = cros_nacl_helper_arm32_sysroot 1696 @@ -167,7 +167,7 @@ cros_toolchain("nacl_helper_arm32") { 1697 1698 cros_toolchain("host") { 1699 toolchain_args = { 1700 - current_cpu = host_cpu 1701 + target_cpu = host_cpu 1702 current_os = "linux" 1703 sysroot = cros_host_sysroot 1704 } 1705 @@ -197,11 +197,11 @@ cros_toolchain("host") { 1706 cros_toolchain("v8_snapshot") { 1707 toolchain_args = { 1708 if (target_cpu == "x86" || target_cpu == "arm" || target_cpu == "mipsel") { 1709 - current_cpu = "x86" 1710 + target_cpu = "x86" 1711 } else { 1712 - current_cpu = "x64" 1713 + target_cpu = "x64" 1714 } 1715 - v8_current_cpu = v8_target_cpu 1716 + v8_target_cpu = v8_target_cpu 1717 current_os = "linux" 1718 sysroot = cros_v8_snapshot_sysroot 1719 } 1720 diff --git a/toolchain/fuchsia/BUILD.gn b/toolchain/fuchsia/BUILD.gn 1721 index 4040aa762..2136148db 100644 1722 --- a/toolchain/fuchsia/BUILD.gn 1723 +++ b/toolchain/fuchsia/BUILD.gn 1724 @@ -27,12 +27,12 @@ template("fuchsia_clang_toolchain") { 1725 1726 fuchsia_clang_toolchain("x64") { 1727 toolchain_args = { 1728 - current_cpu = "x64" 1729 + target_cpu = "x64" 1730 } 1731 } 1732 1733 fuchsia_clang_toolchain("arm64") { 1734 toolchain_args = { 1735 - current_cpu = "arm64" 1736 + target_cpu = "arm64" 1737 } 1738 } 1739 diff --git a/toolchain/gcc_toolchain.gni b/toolchain/gcc_toolchain.gni 1740 index b18f3e5cb..8c9e41963 100644 1741 --- a/toolchain/gcc_toolchain.gni 1742 +++ b/toolchain/gcc_toolchain.gni 1743 @@ -135,8 +135,8 @@ template("single_gcc_toolchain") { 1744 assert(defined(invoker.toolchain_args), 1745 "Toolchains must specify toolchain_args") 1746 invoker_toolchain_args = invoker.toolchain_args 1747 - assert(defined(invoker_toolchain_args.current_cpu), 1748 - "toolchain_args must specify a current_cpu") 1749 + assert(defined(invoker_toolchain_args.target_cpu), 1750 + "toolchain_args must specify a target_cpu") 1751 assert(defined(invoker_toolchain_args.current_os), 1752 "toolchain_args must specify a current_os") 1753 1754 @@ -159,8 +159,8 @@ template("single_gcc_toolchain") { 1755 # set on those toolchains. 1756 host_toolchain = host_toolchain 1757 1758 - if (!defined(invoker_toolchain_args.v8_current_cpu)) { 1759 - v8_current_cpu = invoker_toolchain_args.current_cpu 1760 + if (!defined(invoker_toolchain_args.v8_target_cpu)) { 1761 + v8_target_cpu = invoker_toolchain_args.target_cpu 1762 } 1763 } 1764 1765 diff --git a/toolchain/ios/BUILD.gn b/toolchain/ios/BUILD.gn 1766 index eaed740ab..901bc90ce 100644 1767 --- a/toolchain/ios/BUILD.gn 1768 +++ b/toolchain/ios/BUILD.gn 1769 @@ -72,73 +72,73 @@ template("ios_blink_app_ext_toolchain") { 1770 1771 ios_toolchain("ios_clang_arm64") { 1772 toolchain_args = { 1773 - current_cpu = "arm64" 1774 + target_cpu = "arm64" 1775 } 1776 } 1777 1778 ios_toolchain("ios_clang_arm64_16_0") { 1779 toolchain_args = { 1780 - current_cpu = "arm64" 1781 + target_cpu = "arm64" 1782 ios_deployment_target = "16.0" 1783 } 1784 } 1785 1786 ios_toolchain("ios_clang_x64") { 1787 toolchain_args = { 1788 - current_cpu = "x64" 1789 + target_cpu = "x64" 1790 } 1791 } 1792 1793 ios_toolchain("ios_clang_x64_16_0") { 1794 toolchain_args = { 1795 - current_cpu = "x64" 1796 + target_cpu = "x64" 1797 ios_deployment_target = "16.0" 1798 } 1799 } 1800 1801 ios_app_ext_toolchain("ios_clang_arm64_app_ext") { 1802 toolchain_args = { 1803 - current_cpu = "arm64" 1804 + target_cpu = "arm64" 1805 } 1806 } 1807 1808 ios_blink_app_ext_toolchain("ios_clang_arm64_blink_app_ext") { 1809 toolchain_args = { 1810 - current_cpu = "arm64" 1811 + target_cpu = "arm64" 1812 use_blink = true 1813 } 1814 } 1815 1816 ios_blink_app_ext_toolchain("ios_clang_x64_blink_app_ext") { 1817 toolchain_args = { 1818 - current_cpu = "x64" 1819 + target_cpu = "x64" 1820 use_blink = true 1821 } 1822 } 1823 1824 ios_app_ext_toolchain("ios_clang_arm64_app_ext_13_4") { 1825 toolchain_args = { 1826 - current_cpu = "arm64" 1827 + target_cpu = "arm64" 1828 ios_deployment_target = "13.4" 1829 } 1830 } 1831 1832 ios_app_ext_toolchain("ios_clang_x64_app_ext") { 1833 toolchain_args = { 1834 - current_cpu = "x64" 1835 + target_cpu = "x64" 1836 } 1837 } 1838 1839 ios_app_ext_toolchain("ios_clang_x64_app_ext_13_4") { 1840 toolchain_args = { 1841 - current_cpu = "x64" 1842 + target_cpu = "x64" 1843 ios_deployment_target = "13.4" 1844 } 1845 } 1846 1847 ios_toolchain("ios_clang_arm64_blink") { 1848 toolchain_args = { 1849 - current_cpu = "arm64" 1850 + target_cpu = "arm64" 1851 use_blink = true 1852 } 1853 } 1854 diff --git a/toolchain/linux/BUILD.gn b/toolchain/linux/BUILD.gn 1855 index ead0a34b8..5844d7a09 100644 1856 --- a/toolchain/linux/BUILD.gn 1857 +++ b/toolchain/linux/BUILD.gn 1858 @@ -11,21 +11,21 @@ import("//chromium/build/toolchain/gcc_toolchain.gni") 1859 clang_toolchain("clang_ppc64") { 1860 enable_linker_map = true 1861 toolchain_args = { 1862 - current_cpu = "ppc64" 1863 + target_cpu = "ppc64" 1864 current_os = "linux" 1865 } 1866 } 1867 1868 clang_toolchain("clang_arm") { 1869 toolchain_args = { 1870 - current_cpu = "arm" 1871 + target_cpu = "arm" 1872 current_os = "linux" 1873 } 1874 } 1875 1876 clang_toolchain("clang_arm64") { 1877 toolchain_args = { 1878 - current_cpu = "arm64" 1879 + target_cpu = "arm64" 1880 current_os = "linux" 1881 } 1882 } 1883 @@ -42,7 +42,7 @@ gcc_toolchain("arm64") { 1884 nm = "${toolprefix}nm" 1885 1886 toolchain_args = { 1887 - current_cpu = "arm64" 1888 + target_cpu = "arm64" 1889 current_os = "linux" 1890 1891 # remote execution does not support gcc. 1892 @@ -63,7 +63,7 @@ gcc_toolchain("arm") { 1893 nm = "${toolprefix}nm" 1894 1895 toolchain_args = { 1896 - current_cpu = "arm" 1897 + target_cpu = "arm" 1898 current_os = "linux" 1899 1900 # remote execution does not support gcc. 1901 @@ -77,7 +77,7 @@ clang_toolchain("clang_x86") { 1902 enable_linker_map = true 1903 1904 toolchain_args = { 1905 - current_cpu = "x86" 1906 + target_cpu = "x86" 1907 current_os = "linux" 1908 } 1909 } 1910 @@ -95,7 +95,7 @@ gcc_toolchain("x86") { 1911 enable_linker_map = true 1912 1913 toolchain_args = { 1914 - current_cpu = "x86" 1915 + target_cpu = "x86" 1916 current_os = "linux" 1917 1918 # remote execution does not support gcc. 1919 @@ -109,7 +109,7 @@ clang_toolchain("clang_x64") { 1920 enable_linker_map = true 1921 1922 toolchain_args = { 1923 - current_cpu = "x64" 1924 + target_cpu = "x64" 1925 current_os = "linux" 1926 } 1927 } 1928 @@ -125,57 +125,57 @@ template("clang_v8_toolchain") { 1929 1930 clang_v8_toolchain("clang_x86_v8_arm") { 1931 toolchain_args = { 1932 - current_cpu = "x86" 1933 - v8_current_cpu = "arm" 1934 + target_cpu = "x86" 1935 + v8_target_cpu = "arm" 1936 } 1937 } 1938 1939 clang_v8_toolchain("clang_x86_v8_mipsel") { 1940 toolchain_args = { 1941 - current_cpu = "x86" 1942 - v8_current_cpu = "mipsel" 1943 + target_cpu = "x86" 1944 + v8_target_cpu = "mipsel" 1945 } 1946 } 1947 1948 clang_v8_toolchain("clang_x86_v8_mips") { 1949 toolchain_args = { 1950 - current_cpu = "x86" 1951 - v8_current_cpu = "mips" 1952 + target_cpu = "x86" 1953 + v8_target_cpu = "mips" 1954 } 1955 } 1956 1957 clang_v8_toolchain("clang_x64_v8_arm64") { 1958 toolchain_args = { 1959 - current_cpu = "x64" 1960 - v8_current_cpu = "arm64" 1961 + target_cpu = "x64" 1962 + v8_target_cpu = "arm64" 1963 } 1964 } 1965 1966 clang_v8_toolchain("clang_x64_v8_mips64el") { 1967 toolchain_args = { 1968 - current_cpu = "x64" 1969 - v8_current_cpu = "mips64el" 1970 + target_cpu = "x64" 1971 + v8_target_cpu = "mips64el" 1972 } 1973 } 1974 1975 clang_v8_toolchain("clang_x64_v8_mips64") { 1976 toolchain_args = { 1977 - current_cpu = "x64" 1978 - v8_current_cpu = "mips64" 1979 + target_cpu = "x64" 1980 + v8_target_cpu = "mips64" 1981 } 1982 } 1983 1984 clang_v8_toolchain("clang_x64_v8_riscv64") { 1985 toolchain_args = { 1986 - current_cpu = "x64" 1987 - v8_current_cpu = "riscv64" 1988 + target_cpu = "x64" 1989 + v8_target_cpu = "riscv64" 1990 } 1991 } 1992 1993 clang_v8_toolchain("clang_x64_v8_loong64") { 1994 toolchain_args = { 1995 - current_cpu = "x64" 1996 - v8_current_cpu = "loong64" 1997 + target_cpu = "x64" 1998 + v8_target_cpu = "loong64" 1999 } 2000 } 2001 2002 @@ -192,7 +192,7 @@ gcc_toolchain("x64") { 2003 enable_linker_map = true 2004 2005 toolchain_args = { 2006 - current_cpu = "x64" 2007 + target_cpu = "x64" 2008 current_os = "linux" 2009 2010 # remote execution does not support gcc. 2011 @@ -203,21 +203,21 @@ gcc_toolchain("x64") { 2012 2013 clang_toolchain("clang_mipsel") { 2014 toolchain_args = { 2015 - current_cpu = "mipsel" 2016 + target_cpu = "mipsel" 2017 current_os = "linux" 2018 } 2019 } 2020 2021 clang_toolchain("clang_mips64el") { 2022 toolchain_args = { 2023 - current_cpu = "mips64el" 2024 + target_cpu = "mips64el" 2025 current_os = "linux" 2026 } 2027 } 2028 2029 clang_toolchain("clang_mips64") { 2030 toolchain_args = { 2031 - current_cpu = "mips64" 2032 + target_cpu = "mips64" 2033 current_os = "linux" 2034 } 2035 } 2036 @@ -234,7 +234,7 @@ gcc_toolchain("mipsel") { 2037 2038 toolchain_args = { 2039 cc_wrapper = "" 2040 - current_cpu = "mipsel" 2041 + target_cpu = "mipsel" 2042 current_os = "linux" 2043 2044 # remote execution does not support gcc. 2045 @@ -255,7 +255,7 @@ gcc_toolchain("mips64el") { 2046 2047 toolchain_args = { 2048 cc_wrapper = "" 2049 - current_cpu = "mips64el" 2050 + target_cpu = "mips64el" 2051 current_os = "linux" 2052 2053 # remote execution does not support gcc. 2054 @@ -267,7 +267,7 @@ gcc_toolchain("mips64el") { 2055 clang_toolchain("clang_riscv64") { 2056 enable_linker_map = true 2057 toolchain_args = { 2058 - current_cpu = "riscv64" 2059 + target_cpu = "riscv64" 2060 current_os = "linux" 2061 is_clang = true 2062 } 2063 @@ -285,7 +285,7 @@ gcc_toolchain("riscv64") { 2064 ld = cxx 2065 2066 toolchain_args = { 2067 - current_cpu = "riscv64" 2068 + target_cpu = "riscv64" 2069 current_os = "linux" 2070 is_clang = false 2071 } 2072 @@ -293,7 +293,7 @@ gcc_toolchain("riscv64") { 2073 2074 clang_toolchain("clang_s390x") { 2075 toolchain_args = { 2076 - current_cpu = "s390x" 2077 + target_cpu = "s390x" 2078 current_os = "linux" 2079 is_clang = true 2080 } 2081 @@ -309,7 +309,7 @@ gcc_toolchain("s390x") { 2082 ld = cxx 2083 2084 toolchain_args = { 2085 - current_cpu = "s390x" 2086 + target_cpu = "s390x" 2087 current_os = "linux" 2088 2089 # remote execution does not support gcc. 2090 @@ -328,7 +328,7 @@ gcc_toolchain("s390x") { 2091 # ld = cxx 2092 # 2093 # toolchain_args = { 2094 -# current_cpu = "mips64" 2095 +# target_cpu = "mips64" 2096 # current_os = "linux" 2097 # is_clang = false 2098 # } 2099 @@ -344,7 +344,7 @@ gcc_toolchain("ppc64") { 2100 ld = cxx 2101 2102 toolchain_args = { 2103 - current_cpu = "ppc64" 2104 + target_cpu = "ppc64" 2105 current_os = "linux" 2106 2107 # remote execution does not support gcc. 2108 @@ -365,7 +365,7 @@ gcc_toolchain("mips") { 2109 ld = cxx 2110 2111 toolchain_args = { 2112 - current_cpu = "mips" 2113 + target_cpu = "mips" 2114 current_os = "linux" 2115 2116 # remote execution does not support gcc. 2117 @@ -386,7 +386,7 @@ gcc_toolchain("mips64") { 2118 ld = cxx 2119 2120 toolchain_args = { 2121 - current_cpu = "mips64" 2122 + target_cpu = "mips64" 2123 current_os = "linux" 2124 2125 # remote execution does not support gcc. 2126 @@ -397,7 +397,7 @@ gcc_toolchain("mips64") { 2127 2128 clang_toolchain("clang_loong64") { 2129 toolchain_args = { 2130 - current_cpu = "loong64" 2131 + target_cpu = "loong64" 2132 current_os = "linux" 2133 } 2134 } 2135 @@ -414,7 +414,7 @@ gcc_toolchain("loong64") { 2136 ld = cxx 2137 2138 toolchain_args = { 2139 - current_cpu = "loong64" 2140 + target_cpu = "loong64" 2141 current_os = "linux" 2142 is_clang = false 2143 } 2144 diff --git a/toolchain/linux/unbundle/BUILD.gn b/toolchain/linux/unbundle/BUILD.gn 2145 index 68502471e..62317ef89 100644 2146 --- a/toolchain/linux/unbundle/BUILD.gn 2147 +++ b/toolchain/linux/unbundle/BUILD.gn 2148 @@ -17,7 +17,7 @@ gcc_toolchain("default") { 2149 extra_ldflags = getenv("LDFLAGS") 2150 2151 toolchain_args = { 2152 - current_cpu = current_cpu 2153 + target_cpu = target_cpu 2154 current_os = current_os 2155 } 2156 } 2157 @@ -35,7 +35,7 @@ gcc_toolchain("host") { 2158 extra_ldflags = getenv("BUILD_LDFLAGS") 2159 2160 toolchain_args = { 2161 - current_cpu = current_cpu 2162 + target_cpu = target_cpu 2163 current_os = current_os 2164 } 2165 } 2166 diff --git a/toolchain/mac/BUILD.gn b/toolchain/mac/BUILD.gn 2167 index 4b99db308..0ca8dfc3b 100644 2168 --- a/toolchain/mac/BUILD.gn 2169 +++ b/toolchain/mac/BUILD.gn 2170 @@ -54,67 +54,67 @@ template("mac_toolchain") { 2171 2172 mac_toolchain("clang_arm") { 2173 toolchain_args = { 2174 - current_cpu = "arm" 2175 + target_cpu = "arm" 2176 } 2177 } 2178 2179 mac_toolchain("clang_arm64") { 2180 toolchain_args = { 2181 - current_cpu = "arm64" 2182 + target_cpu = "arm64" 2183 } 2184 } 2185 2186 mac_toolchain("clang_x64") { 2187 toolchain_args = { 2188 - current_cpu = "x64" 2189 + target_cpu = "x64" 2190 } 2191 } 2192 2193 mac_toolchain("clang_x86") { 2194 toolchain_args = { 2195 - current_cpu = "x86" 2196 + target_cpu = "x86" 2197 } 2198 } 2199 2200 mac_toolchain("clang_x86_v8_arm") { 2201 toolchain_args = { 2202 - current_cpu = "x86" 2203 - v8_current_cpu = "arm" 2204 + target_cpu = "x86" 2205 + v8_target_cpu = "arm" 2206 } 2207 } 2208 2209 mac_toolchain("clang_x86_v8_mipsel") { 2210 toolchain_args = { 2211 - current_cpu = "x86" 2212 - v8_current_cpu = "mipsel" 2213 + target_cpu = "x86" 2214 + v8_target_cpu = "mipsel" 2215 } 2216 } 2217 2218 mac_toolchain("clang_x64_v8_arm64") { 2219 toolchain_args = { 2220 - current_cpu = "x64" 2221 - v8_current_cpu = "arm64" 2222 + target_cpu = "x64" 2223 + v8_target_cpu = "arm64" 2224 } 2225 } 2226 2227 mac_toolchain("clang_x64_v8_mips64el") { 2228 toolchain_args = { 2229 - current_cpu = "x64" 2230 - v8_current_cpu = "mips64el" 2231 + target_cpu = "x64" 2232 + v8_target_cpu = "mips64el" 2233 } 2234 } 2235 2236 mac_toolchain("clang_arm64_v8_x64") { 2237 toolchain_args = { 2238 - current_cpu = "arm64" 2239 - v8_current_cpu = "x64" 2240 + target_cpu = "arm64" 2241 + v8_target_cpu = "x64" 2242 } 2243 } 2244 2245 # Needed to run v8 on the host during a arm64 -> x86_64 cross-build 2246 mac_toolchain("clang_arm64_v8_arm64") { 2247 toolchain_args = { 2248 - current_cpu = "arm64" 2249 - v8_current_cpu = "arm64" 2250 + target_cpu = "arm64" 2251 + v8_target_cpu = "arm64" 2252 } 2253 } 2254 diff --git a/toolchain/nacl/BUILD.gn b/toolchain/nacl/BUILD.gn 2255 index 8d70258fc..81af95759 100644 2256 --- a/toolchain/nacl/BUILD.gn 2257 +++ b/toolchain/nacl/BUILD.gn 2258 @@ -95,7 +95,7 @@ template("pnacl_toolchain") { 2259 2260 toolchain_args = { 2261 is_clang = true 2262 - current_cpu = "pnacl" 2263 + target_cpu = "pnacl" 2264 use_lld = false 2265 } 2266 } 2267 @@ -145,7 +145,7 @@ template("nacl_glibc_toolchain") { 2268 strip = toolprefix + "strip" + toolsuffix 2269 2270 toolchain_args = { 2271 - current_cpu = toolchain_cpu 2272 + target_cpu = toolchain_cpu 2273 2274 # reclient does not support gcc. 2275 use_remoteexec = false 2276 @@ -203,7 +203,7 @@ template("nacl_clang_toolchain") { 2277 strip = toolprefix + "strip" + toolsuffix 2278 2279 toolchain_args = { 2280 - current_cpu = toolchain_cpu 2281 + target_cpu = toolchain_cpu 2282 is_clang = true 2283 use_lld = false 2284 } 2285 @@ -261,7 +261,7 @@ template("nacl_irt_toolchain") { 2286 } 2287 2288 toolchain_args = { 2289 - current_cpu = toolchain_cpu 2290 + target_cpu = toolchain_cpu 2291 is_clang = true 2292 use_lld = false 2293 is_nacl_saigo = true 2294 @@ -303,7 +303,7 @@ template("nacl_test_irt_toolchain") { 2295 strip = toolprefix + "strip" + toolsuffix 2296 2297 toolchain_args = { 2298 - current_cpu = toolchain_cpu 2299 + target_cpu = toolchain_cpu 2300 is_clang = true 2301 use_lld = false 2302 is_nacl_saigo = true 2303 diff --git a/toolchain/wasm/BUILD.gn b/toolchain/wasm/BUILD.gn 2304 index 26d790b0b..44db05c13 100644 2305 --- a/toolchain/wasm/BUILD.gn 2306 +++ b/toolchain/wasm/BUILD.gn 2307 @@ -22,7 +22,7 @@ gcc_toolchain("wasm") { 2308 ld = cxx 2309 2310 toolchain_args = { 2311 - current_cpu = "wasm" 2312 + target_cpu = "wasm" 2313 current_os = "emscripten" 2314 2315 is_clang = true 2316 diff --git a/toolchain/win/BUILD.gn b/toolchain/win/BUILD.gn 2317 index 1727eb6f6..103e78534 100644 2318 --- a/toolchain/win/BUILD.gn 2319 +++ b/toolchain/win/BUILD.gn 2320 @@ -87,7 +87,7 @@ if (target_os == "winuwp") { 2321 cl = "\"${store_cpu_toolchain_data.vc_bin_dir}/cl.exe\"" 2322 toolchain_args = { 2323 current_os = "winuwp" 2324 - current_cpu = target_cpu 2325 + target_cpu = target_cpu 2326 is_clang = false 2327 } 2328 } 2329 diff --git a/toolchain/win/midl.gni b/toolchain/win/midl.gni 2330 index fcab19141..611bbbe54 100644 2331 --- a/toolchain/win/midl.gni 2332 +++ b/toolchain/win/midl.gni 2333 @@ -148,13 +148,13 @@ template("midl") { 2334 outputs += [ "$out_dir/$proxy_file" ] 2335 } 2336 2337 - if (current_cpu == "x86") { 2338 + if (target_cpu == "x86") { 2339 win_tool_arch = "environment.x86" 2340 idl_target_platform = "win32" 2341 - } else if (current_cpu == "x64") { 2342 + } else if (target_cpu == "x64") { 2343 win_tool_arch = "environment.x64" 2344 idl_target_platform = "x64" 2345 - } else if (current_cpu == "arm64") { 2346 + } else if (target_cpu == "arm64") { 2347 win_tool_arch = "environment.arm64" 2348 idl_target_platform = "arm64" 2349 } else { 2350 diff --git a/toolchain/win/toolchain.gni b/toolchain/win/toolchain.gni 2351 index 96b978aad..3e62d17be 100644 2352 --- a/toolchain/win/toolchain.gni 2353 +++ b/toolchain/win/toolchain.gni 2354 @@ -32,7 +32,7 @@ _clang_bin_path = rebase_path("$clang_base_path/bin", root_build_dir) 2355 # environment: File name of environment file. 2356 # 2357 # You would also define a toolchain_args variable with at least these set: 2358 -# current_cpu: current_cpu to pass as a build arg 2359 +# target_cpu: target_cpu to pass as a build arg 2360 # current_os: current_os to pass as a build arg 2361 template("msvc_toolchain") { 2362 toolchain(target_name) { 2363 @@ -145,18 +145,18 @@ template("msvc_toolchain") { 2364 sys_lib_flags = "${invoker.sys_lib_flags}" 2365 2366 # TODO(thakis): Remove once crbug.com/1300005 is fixed 2367 - assert(toolchain_args.current_cpu == "x64" || 2368 - toolchain_args.current_cpu == "x86" || 2369 - toolchain_args.current_cpu == "arm" || 2370 - toolchain_args.current_cpu == "arm64", 2371 + assert(toolchain_args.target_cpu == "x64" || 2372 + toolchain_args.target_cpu == "x86" || 2373 + toolchain_args.target_cpu == "arm" || 2374 + toolchain_args.target_cpu == "arm64", 2375 "Only supports x64, x86, arm and arm64 CPUs") 2376 - if (toolchain_args.current_cpu == "x64") { 2377 + if (toolchain_args.target_cpu == "x64") { 2378 sys_lib_flags += " /MACHINE:X64" 2379 - } else if (toolchain_args.current_cpu == "x86") { 2380 + } else if (toolchain_args.target_cpu == "x86") { 2381 sys_lib_flags += " /MACHINE:X86" 2382 - } else if (toolchain_args.current_cpu == "arm") { 2383 + } else if (toolchain_args.target_cpu == "arm") { 2384 sys_lib_flags += " /MACHINE:ARM" 2385 - } else if (toolchain_args.current_cpu == "arm64") { 2386 + } else if (toolchain_args.target_cpu == "arm64") { 2387 sys_lib_flags += " /MACHINE:ARM64" 2388 } 2389 2390 @@ -261,7 +261,7 @@ template("msvc_toolchain") { 2391 tool("asm") { 2392 is_msvc_assembler = true 2393 2394 - if (toolchain_args.current_cpu == "arm64") { 2395 + if (toolchain_args.target_cpu == "arm64") { 2396 if (toolchain_is_clang) { 2397 ml = "${cl_prefix}${_clang_bin_path}/clang-cl${_exe} --target=aarch64-pc-windows" 2398 if (host_os == "win") { 2399 @@ -280,13 +280,13 @@ template("msvc_toolchain") { 2400 if (toolchain_is_clang && !disable_llvm_ml) { 2401 prefix = rebase_path("$clang_base_path/bin", root_build_dir) 2402 ml = "$prefix/llvm-ml${_exe}" 2403 - if (toolchain_args.current_cpu == "x64") { 2404 + if (toolchain_args.target_cpu == "x64") { 2405 ml += " -m64" 2406 } else { 2407 ml += " -m32" 2408 } 2409 } else { 2410 - if (toolchain_args.current_cpu == "x64") { 2411 + if (toolchain_args.target_cpu == "x64") { 2412 ml = "ml64.exe" 2413 } else { 2414 ml = "ml.exe" 2415 @@ -299,7 +299,7 @@ template("msvc_toolchain") { 2416 2417 # Suppress final-stage linking on x64/x86 builds. (Armasm64 does not 2418 # require /c because it doesn't support linking.) 2419 - if (toolchain_args.current_cpu != "arm64") { 2420 + if (toolchain_args.target_cpu != "arm64") { 2421 ml += " /c" 2422 } 2423 if (use_lld && (!toolchain_is_clang || disable_llvm_ml)) { 2424 @@ -310,7 +310,7 @@ template("msvc_toolchain") { 2425 ml = "\"$python_path\" $ml_py $ml" 2426 } 2427 2428 - if (toolchain_args.current_cpu == "arm64") { 2429 + if (toolchain_args.target_cpu == "arm64") { 2430 # armasm64.exe does not support definitions passed via the command 2431 # line. (Fortunately, they're not needed for compiling the V8 2432 # snapshot, which is the only time this assembler is required.) 2433 @@ -725,7 +725,7 @@ template("win_toolchains") { 2434 is_clang = false 2435 use_clang_coverage = false 2436 current_os = "win" 2437 - current_cpu = toolchain_arch 2438 + target_cpu = toolchain_arch 2439 } 2440 } 2441 msvc_system_allocator_toolchain( 2442 @@ -740,7 +740,7 @@ template("win_toolchains") { 2443 is_clang = false 2444 use_clang_coverage = false 2445 current_os = "win" 2446 - current_cpu = rust_host_toolchain_arch 2447 + target_cpu = rust_host_toolchain_arch 2448 } 2449 } 2450 msvc_system_allocator_toolchain( 2451 @@ -755,7 +755,7 @@ template("win_toolchains") { 2452 is_clang = false 2453 use_clang_coverage = false 2454 current_os = "win" 2455 - current_cpu = toolchain_arch 2456 + target_cpu = toolchain_arch 2457 } 2458 } 2459 msvc_rust_host_build_tools_toolchain( 2460 @@ -770,7 +770,7 @@ template("win_toolchains") { 2461 is_clang = false 2462 use_clang_coverage = false 2463 current_os = "win" 2464 - current_cpu = rust_host_toolchain_arch 2465 + target_cpu = rust_host_toolchain_arch 2466 } 2467 } 2468 } 2469 @@ -803,7 +803,7 @@ template("win_toolchains") { 2470 } 2471 is_clang = true 2472 current_os = "win" 2473 - current_cpu = toolchain_arch 2474 + target_cpu = toolchain_arch 2475 } 2476 } 2477 msvc_system_allocator_toolchain( 2478 @@ -823,7 +823,7 @@ template("win_toolchains") { 2479 } 2480 is_clang = true 2481 current_os = "win" 2482 - current_cpu = rust_host_toolchain_arch 2483 + target_cpu = rust_host_toolchain_arch 2484 } 2485 } 2486 msvc_system_allocator_toolchain( 2487 @@ -843,7 +843,7 @@ template("win_toolchains") { 2488 } 2489 is_clang = true 2490 current_os = "win" 2491 - current_cpu = toolchain_arch 2492 + target_cpu = toolchain_arch 2493 } 2494 } 2495 msvc_rust_host_build_tools_toolchain( 2496 @@ -863,7 +863,7 @@ template("win_toolchains") { 2497 } 2498 is_clang = true 2499 current_os = "win" 2500 - current_cpu = rust_host_toolchain_arch 2501 + target_cpu = rust_host_toolchain_arch 2502 } 2503 } 2504 } 2505 diff --git a/toolchain/zos/BUILD.gn b/toolchain/zos/BUILD.gn 2506 index 01689744c..5b30dd437 100644 2507 --- a/toolchain/zos/BUILD.gn 2508 +++ b/toolchain/zos/BUILD.gn 2509 @@ -14,7 +14,7 @@ toolchain("s390x") { 2510 ld = cxx 2511 2512 toolchain_args = { 2513 - current_cpu = "s390x" 2514 + target_cpu = "s390x" 2515 current_os = "zos" 2516 } 2517 2518 diff --git a/win/BUILD.gn b/win/BUILD.gn 2519 index 23be394aa..e920595d3 100644 2520 --- a/win/BUILD.gn 2521 +++ b/win/BUILD.gn 2522 @@ -38,7 +38,7 @@ if (is_win) { 2523 ] 2524 args = [ 2525 rebase_path("$root_out_dir/cdb", root_out_dir), 2526 - current_cpu, 2527 + target_cpu, 2528 ] 2529 } 2530 2531 @@ -65,7 +65,7 @@ if (is_win) { 2532 "$root_out_dir/vccorlib140${vcrt_suffix}.dll", 2533 "$root_out_dir/vcruntime140${vcrt_suffix}.dll", 2534 ] 2535 - if (current_cpu == "x64") { 2536 + if (target_cpu == "x64") { 2537 data += [ "$root_out_dir/vcruntime140_1${vcrt_suffix}.dll" ] 2538 } 2539 if (is_debug) { 2540 diff --git a/win/message_compiler.gni b/win/message_compiler.gni 2541 index ffbfbf396..afe427c23 100644 2542 --- a/win/message_compiler.gni 2543 +++ b/win/message_compiler.gni 2544 @@ -52,7 +52,7 @@ template("message_compiler") { 2545 # directory. This is required because the Windows toolchain setup saves 2546 # the VC paths and such so that running "mc.exe" will work with the 2547 # configured toolchain. This file is in the root build dir. 2548 - "environment.$current_cpu", 2549 + "environment.$target_cpu", 2550 2551 # Where to put the header. 2552 "-h",