Bug 1654112 - deconflate the target and host architectures in libwebrtc build files; r=mjf

This patch changes the meaning of the target architecture to mean what it nominally should according to the gn documentation. I question as to if this could be upstreamed, but it may be worth a shot. If we do choose to pursue that. There are several other smaller patches that tackle individual instances, that this could be combined with.

Differential Revision: https://phabricator.services.mozilla.com/D119707
This commit is contained in:
Nico Grunbaum 2021-07-14 22:28:13 +00:00
Родитель ff83654a3a
Коммит f54f13e7c9
57 изменённых файлов: 303 добавлений и 303 удалений

Просмотреть файл

@ -21,10 +21,10 @@ declare_args() {
config("libyuv_config") {
include_dirs = [ "include" ]
if (is_android && current_cpu == "arm64") {
if (is_android && target_cpu == "arm64") {
ldflags = [ "-Wl,--dynamic-linker,/system/bin/linker64" ]
}
if (is_android && current_cpu != "arm64") {
if (is_android && target_cpu != "arm64") {
ldflags = [ "-Wl,--dynamic-linker,/system/bin/linker" ]
}
}
@ -204,7 +204,7 @@ if (libyuv_use_neon) {
configs += [ "//build/config/compiler:optimize_max" ]
}
if (current_cpu != "arm64") {
if (target_cpu != "arm64") {
configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
cflags = [ "-mfpu=neon" ]
}

6
third_party/libwebrtc/BUILD.gn поставляемый
Просмотреть файл

@ -360,12 +360,12 @@ config("common_config") {
}
}
if (current_cpu == "arm64") {
if (target_cpu == "arm64") {
defines += [ "WEBRTC_ARCH_ARM64" ]
defines += [ "WEBRTC_HAS_NEON" ]
}
if (current_cpu == "arm") {
if (target_cpu == "arm") {
defines += [ "WEBRTC_ARCH_ARM" ]
if (arm_version >= 7) {
defines += [ "WEBRTC_ARCH_ARM_V7" ]
@ -375,7 +375,7 @@ config("common_config") {
}
}
if (current_cpu == "mipsel") {
if (target_cpu == "mipsel") {
defines += [ "MIPS32_LE" ]
if (mips_float_abi == "hard") {
defines += [ "MIPS_FPU_LE" ]

Просмотреть файл

@ -22,7 +22,7 @@ rtc_source_set("audio_encoder_isac") {
poisonous = [ "audio_codecs" ]
public = [ "audio_encoder_isac.h" ]
public_configs = [ ":isac_config" ]
if (current_cpu == "arm") {
if (target_cpu == "arm") {
deps = [ ":audio_encoder_isac_fix" ]
} else {
deps = [ ":audio_encoder_isac_float" ]
@ -34,7 +34,7 @@ rtc_source_set("audio_decoder_isac") {
poisonous = [ "audio_codecs" ]
public = [ "audio_decoder_isac.h" ]
public_configs = [ ":isac_config" ]
if (current_cpu == "arm") {
if (target_cpu == "arm") {
deps = [ ":audio_decoder_isac_fix" ]
} else {
deps = [ ":audio_decoder_isac_float" ]
@ -43,7 +43,7 @@ rtc_source_set("audio_decoder_isac") {
config("isac_config") {
visibility = [ ":*" ]
if (current_cpu == "arm") {
if (target_cpu == "arm") {
defines = [
"WEBRTC_USE_BUILTIN_ISAC_FIX=1",
"WEBRTC_USE_BUILTIN_ISAC_FLOAT=0",

2
third_party/libwebrtc/build/config/BUILD.gn поставляемый
Просмотреть файл

@ -134,7 +134,7 @@ config("debug") {
# builds, and we have to tell it to turn it off.
defines += [ "_HAS_ITERATOR_DEBUGGING=0" ]
}
} else if ((is_linux || is_chromeos) && current_cpu == "x64" && enable_iterator_debugging) {
} else if ((is_linux || is_chromeos) && target_cpu == "x64" && enable_iterator_debugging) {
# Enable libstdc++ debugging facilities to help catch problems early, see
# http://crbug.com/65151 .
# TODO(phajdan.jr): Should we enable this for all of POSIX?

Просмотреть файл

@ -33,7 +33,7 @@ config("compiler") {
"ANDROID_NDK_VERSION_ROLL=${android_ndk_version}_1",
]
if (current_cpu == "mips64el") {
if (target_cpu == "mips64el") {
cflags += [
# Have to force IAS for mips64.
"-fintegrated-as",
@ -53,24 +53,24 @@ config("compiler") {
# $compile_api_level corresponds to the API level used for the sysroot path
# calculation in //build/config/android/config.gni
if (current_cpu == "arm") {
if (target_cpu == "arm") {
abi_target = "arm-linux-androideabi"
compile_api_level = android32_ndk_api_level
} else if (current_cpu == "x86") {
} else if (target_cpu == "x86") {
abi_target = "i686-linux-android"
compile_api_level = android32_ndk_api_level
} else if (current_cpu == "arm64") {
} else if (target_cpu == "arm64") {
abi_target = "aarch64-linux-android"
compile_api_level = android64_ndk_api_level
} else if (current_cpu == "x64") {
} else if (target_cpu == "x64") {
# Place holder for x64 support, not tested.
# TODO: Enable clang support for Android x64. http://crbug.com/539781
abi_target = "x86_64-linux-android"
compile_api_level = android64_ndk_api_level
} else if (current_cpu == "mipsel") {
} else if (target_cpu == "mipsel") {
abi_target = "mipsel-linux-android"
compile_api_level = android32_ndk_api_level
} else if (current_cpu == "mips64el") {
} else if (target_cpu == "mips64el") {
# Place holder for mips64 support, not tested.
abi_target = "mips64el-linux-android"
compile_api_level = android64_ndk_api_level
@ -99,26 +99,26 @@ config("runtime_library") {
# strto{d,f,l,ul}_l. These symbols are not used by our libc++, and newer NDKs
# don't provide a libandroid_support.a on 64-bit platforms, so we only depend
# on this library on 32-bit platforms.
if (current_cpu == "arm" || current_cpu == "x86") {
if (target_cpu == "arm" || target_cpu == "x86") {
libs += [ "android_support" ]
}
# arm builds of libc++ starting in NDK r12 depend on unwind.
if (current_cpu == "arm") {
if (target_cpu == "arm") {
libs += [ "unwind" ]
}
if (current_cpu == "arm" && arm_version == 6) {
if (target_cpu == "arm" && arm_version == 6) {
libs += [ "atomic" ]
}
if (current_cpu == "mipsel") {
if (target_cpu == "mipsel") {
libs += [ "atomic" ]
}
# TODO(jdduke) Re-enable on mips after resolving linking
# issues with libc++ (crbug.com/456380).
if (current_cpu != "mipsel" && current_cpu != "mips64el") {
if (target_cpu != "mipsel" && target_cpu != "mips64el") {
ldflags += [ "-Wl,--warn-shared-textrel" ]
}
}

Просмотреть файл

@ -36,25 +36,25 @@ assert(!devtools_instrumentation_dumping || use_order_profiling,
assert(!use_call_graph || use_order_profiling,
"use_call_graph requires use_order_profiling")
if (current_cpu == "x86") {
if (target_cpu == "x86") {
android_app_abi = "x86"
} else if (current_cpu == "arm") {
} else if (target_cpu == "arm") {
import("//build/config/arm.gni")
if (arm_version < 7) {
android_app_abi = "armeabi"
} else {
android_app_abi = "armeabi-v7a"
}
} else if (current_cpu == "mipsel") {
} else if (target_cpu == "mipsel") {
android_app_abi = "mips"
} else if (current_cpu == "x64") {
} else if (target_cpu == "x64") {
android_app_abi = "x86_64"
} else if (current_cpu == "arm64") {
} else if (target_cpu == "arm64") {
android_app_abi = "arm64-v8a"
} else if (current_cpu == "mips64el") {
} else if (target_cpu == "mips64el") {
android_app_abi = "mips64"
} else {
assert(false, "Unknown Android ABI: " + current_cpu)
assert(false, "Unknown Android ABI: " + target_cpu)
}
if (target_cpu == "arm64" || target_cpu == "x64" || target_cpu == "mips64el") {

Просмотреть файл

@ -292,22 +292,22 @@ if (is_android || is_chromeos) {
# Location of libgcc. This is only needed for the current GN toolchain, so we
# only need to define the current one, rather than one for every platform
# like the toolchain roots.
if (current_cpu == "x86") {
if (target_cpu == "x86") {
android_prebuilt_arch = "android-x86"
_binary_prefix = "i686-linux-android"
} else if (current_cpu == "arm") {
} else if (target_cpu == "arm") {
android_prebuilt_arch = "android-arm"
_binary_prefix = "arm-linux-androideabi"
} else if (current_cpu == "mipsel") {
} else if (target_cpu == "mipsel") {
android_prebuilt_arch = "android-mips"
_binary_prefix = "mipsel-linux-android"
} else if (current_cpu == "x64") {
} else if (target_cpu == "x64") {
android_prebuilt_arch = "android-x86_64"
_binary_prefix = "x86_64-linux-android"
} else if (current_cpu == "arm64") {
} else if (target_cpu == "arm64") {
android_prebuilt_arch = "android-arm64"
_binary_prefix = "aarch64-linux-android"
} else if (current_cpu == "mips64el") {
} else if (target_cpu == "mips64el") {
android_prebuilt_arch = "android-mips64"
_binary_prefix = "mips64el-linux-android"
} else {

Просмотреть файл

@ -674,11 +674,11 @@ if (enable_java_templates) {
# variables must not be set.
template("write_native_libraries_java") {
_native_libraries_file = "$target_gen_dir/$target_name.srcjar"
if (current_cpu == "arm" || current_cpu == "arm64") {
if (target_cpu == "arm" || target_cpu == "arm64") {
_cpu_family = "CPU_FAMILY_ARM"
} else if (current_cpu == "x86" || current_cpu == "x64") {
} else if (target_cpu == "x86" || target_cpu == "x64") {
_cpu_family = "CPU_FAMILY_X86"
} else if (current_cpu == "mipsel" || current_cpu == "mips64el") {
} else if (target_cpu == "mipsel" || target_cpu == "mips64el") {
_cpu_family = "CPU_FAMILY_MIPS"
} else {
assert(false, "Unsupported CPU family")

6
third_party/libwebrtc/build/config/arm.gni поставляемый
Просмотреть файл

@ -4,11 +4,11 @@
import("//build/config/v8_target_cpu.gni")
# These are primarily relevant in current_cpu == "arm" contexts, where
# These are primarily relevant in target_cpu == "arm" contexts, where
# ARM code is being compiled. But they can also be relevant in the
# other contexts when the code will change its behavior based on the
# cpu it wants to generate code for.
if (current_cpu == "arm" || v8_current_cpu == "arm") {
if (target_cpu == "arm" || v8_target_cpu == "arm") {
declare_args() {
# Version of the ARM processor when compiling on ARM. Ignored on non-ARM
# platforms.
@ -120,7 +120,7 @@ if (current_cpu == "arm" || v8_current_cpu == "arm") {
}
}
}
} else if (current_cpu == "arm64" || v8_current_cpu == "arm64") {
} else if (target_cpu == "arm64" || v8_target_cpu == "arm64") {
# arm64 supports only "hard".
arm_float_abi = "hard"
arm_use_neon = true

Просмотреть файл

@ -42,7 +42,7 @@ declare_args() {
}
use_custom_libcxx =
use_custom_libcxx || (use_custom_libcxx_for_host && current_cpu == host_cpu)
use_custom_libcxx || (use_custom_libcxx_for_host && target_cpu == host_cpu)
use_custom_libcxx = use_custom_libcxx && !is_nacl
declare_args() {

Просмотреть файл

@ -55,7 +55,7 @@ config("ldconfig") {
config("executable_config") {
configs = [ ":ldconfig" ]
if (!is_clang && current_cpu == "arm") {
if (!is_clang && target_cpu == "arm") {
ldflags = [
# Export stdlibc++ and libgcc symbols to force shlibs to refer to these
# symbols from the executable.
@ -83,7 +83,7 @@ config("executable_config") {
# shared libs to inherit RPATH from the parent executable that is loading
# the shared library. (See internal b/37514052 for more details.)
config("shared_library_config") {
if (current_cpu == "arm") {
if (target_cpu == "arm") {
configs = [ ":static_config" ]
}
}

Просмотреть файл

@ -20,14 +20,14 @@ import("//build/toolchain/goma.gni")
import("//build/toolchain/toolchain.gni")
import("//build_overrides/build.gni")
if (current_cpu == "arm" || current_cpu == "arm64") {
if (target_cpu == "arm" || target_cpu == "arm64") {
import("//build/config/arm.gni")
}
if (current_cpu == "mipsel" || current_cpu == "mips64el" ||
current_cpu == "mips" || current_cpu == "mips64") {
if (target_cpu == "mipsel" || target_cpu == "mips64el" ||
target_cpu == "mips" || target_cpu == "mips64") {
import("//build/config/mips.gni")
}
if (current_cpu == "x64") {
if (target_cpu == "x64") {
import("//build/config/x64.gni")
}
if (is_mac) {
@ -170,8 +170,8 @@ declare_args() {
# lld doesn't have the bug.
use_icf = (is_posix || is_fuchsia) && !is_debug && !using_sanitizer &&
!use_clang_coverage && !(is_android && use_order_profiling) &&
(use_lld || (use_gold && (is_chromeos || !(current_cpu == "x86" ||
current_cpu == "x64"))))
(use_lld || (use_gold && (is_chromeos || !(target_cpu == "x86" ||
target_cpu == "x64"))))
}
if (use_debug_fission == "default") {
@ -285,7 +285,7 @@ config("compiler") {
cflags += [ "--param=ssp-buffer-size=4" ]
# The x86 toolchain currently has problems with stack-protector.
if (is_android && current_cpu == "x86") {
if (is_android && target_cpu == "x86") {
cflags += [ "-fno-stack-protector" ]
} else if (current_os != "aix") {
# Not available on aix.
@ -412,7 +412,7 @@ config("compiler") {
# ------------------------------------
if ((is_posix || is_fuchsia) && use_lld) {
ldflags += [ "-fuse-ld=lld" ]
if (current_cpu == "arm64") {
if (target_cpu == "arm64") {
# Reduce the page size from 65536 in order to reduce binary size slightly
# by shrinking the alignment gap between segments. This also causes all
# segments to be mapped adjacently, which breakpad relies on.
@ -692,7 +692,7 @@ config("compiler") {
# unless the architecture revision in .ARM.attributes is sufficiently new.
# TODO(pcc): The contents of .ARM.attributes should be based on the
# -march flag passed at compile time (see llvm.org/pr36291).
if (current_cpu == "arm") {
if (target_cpu == "arm") {
ldflags += [ "-march=$arm_arch" ]
}
}
@ -765,13 +765,13 @@ config("compiler_cpu_abi") {
if ((is_posix && !is_apple) || is_fuchsia) {
# CPU architecture. We may or may not be doing a cross compile now, so for
# simplicity we always explicitly set the architecture.
if (current_cpu == "x64") {
if (target_cpu == "x64") {
cflags += [
"-m64",
"-march=$x64_arch",
]
ldflags += [ "-m64" ]
} else if (current_cpu == "x86") {
} else if (target_cpu == "x86") {
cflags += [ "-m32" ]
ldflags += [ "-m32" ]
if (!is_nacl) {
@ -781,7 +781,7 @@ config("compiler_cpu_abi") {
"-mmmx",
]
}
} else if (current_cpu == "arm") {
} else if (target_cpu == "arm") {
if (is_clang && !is_android && !is_nacl) {
cflags += [ "--target=arm-linux-gnueabihf" ]
ldflags += [ "--target=arm-linux-gnueabihf" ]
@ -795,12 +795,12 @@ config("compiler_cpu_abi") {
if (arm_tune != "") {
cflags += [ "-mtune=$arm_tune" ]
}
} else if (current_cpu == "arm64") {
} else if (target_cpu == "arm64") {
if (is_clang && !is_android && !is_nacl && !is_fuchsia) {
cflags += [ "--target=aarch64-linux-gnu" ]
ldflags += [ "--target=aarch64-linux-gnu" ]
}
} else if (current_cpu == "mipsel" && !is_nacl) {
} else if (target_cpu == "mipsel" && !is_nacl) {
ldflags += [ "-Wl,--hash-style=sysv" ]
if (custom_toolchain == "") {
if (is_clang) {
@ -885,7 +885,7 @@ config("compiler_cpu_abi") {
}
cflags += [ "-m${mips_float_abi}-float" ]
} else if (current_cpu == "mips" && !is_nacl) {
} else if (target_cpu == "mips" && !is_nacl) {
ldflags += [ "-Wl,--hash-style=sysv" ]
if (custom_toolchain == "") {
if (is_clang) {
@ -930,7 +930,7 @@ config("compiler_cpu_abi") {
}
cflags += [ "-m${mips_float_abi}-float" ]
} else if (current_cpu == "mips64el") {
} else if (target_cpu == "mips64el") {
cflags += [ "-D__SANE_USERSPACE_TYPES__" ]
ldflags += [ "-Wl,--hash-style=sysv" ]
if (custom_toolchain == "") {
@ -994,7 +994,7 @@ config("compiler_cpu_abi") {
"-Wa,-march=loongson3a",
]
}
} else if (current_cpu == "mips64") {
} else if (target_cpu == "mips64") {
ldflags += [ "-Wl,--hash-style=sysv" ]
if (custom_toolchain == "") {
if (is_clang) {
@ -1032,7 +1032,7 @@ config("compiler_cpu_abi") {
]
ldflags += [ "-mips64r2" ]
}
} else if (current_cpu == "pnacl" && is_nacl_nonsfi) {
} else if (target_cpu == "pnacl" && is_nacl_nonsfi) {
if (target_cpu == "x86" || target_cpu == "x64") {
cflags += [
"-arch",
@ -1059,7 +1059,7 @@ config("compiler_cpu_abi") {
"--target=armv7-unknown-nacl-gnueabihf",
]
}
} else if (current_cpu == "ppc64") {
} else if (target_cpu == "ppc64") {
if (current_os == "aix") {
cflags += [ "-maix64" ]
ldflags += [ "-maix64" ]
@ -1067,7 +1067,7 @@ config("compiler_cpu_abi") {
cflags += [ "-m64" ]
ldflags += [ "-m64" ]
}
} else if (current_cpu == "s390x") {
} else if (target_cpu == "s390x") {
cflags += [ "-m64" ]
ldflags += [ "-m64" ]
}
@ -1088,7 +1088,7 @@ config("compiler_codegen") {
configs += [ "//build/config/nacl:compiler_codegen" ]
}
if (current_cpu == "arm64" && is_android) {
if (target_cpu == "arm64" && is_android) {
# On arm64 disable outlining for Android. See crbug.com/931297 for more
# information.
cflags += [ "-mno-outline" ]
@ -1198,7 +1198,7 @@ config("clang_revision") {
}
config("compiler_arm_fpu") {
if (current_cpu == "arm" && !is_ios && !is_nacl) {
if (target_cpu == "arm" && !is_ios && !is_nacl) {
cflags = [ "-mfpu=$arm_fpu" ]
if (!arm_use_thumb) {
cflags += [ "-marm" ]
@ -1208,14 +1208,14 @@ config("compiler_arm_fpu") {
}
config("compiler_arm_thumb") {
if (current_cpu == "arm" && arm_use_thumb && is_posix &&
if (target_cpu == "arm" && arm_use_thumb && is_posix &&
!(is_apple || is_nacl)) {
cflags = [ "-mthumb" ]
}
}
config("compiler_arm") {
if (current_cpu == "arm" && is_chromeos) {
if (target_cpu == "arm" && is_chromeos) {
# arm is normally the default mode for clang, but on chromeos a wrapper
# is used to pass -mthumb, and therefor change the default.
cflags = [ "-marm" ]
@ -1431,7 +1431,7 @@ config("default_warnings") {
"/wd4577",
]
if (current_cpu == "x86") {
if (target_cpu == "x86") {
cflags += [
# VC++ 2015 changes 32-bit size_t truncation warnings from 4244 to
# 4267. Example: short TruncTest(size_t x) { return x; }
@ -1455,7 +1455,7 @@ config("default_warnings") {
# Suppress warnings about ABI changes on ARM (Clang doesn't give this
# warning).
if (current_cpu == "arm" && !is_clang) {
if (target_cpu == "arm" && !is_clang) {
cflags += [ "-Wno-psabi" ]
}
@ -1612,9 +1612,9 @@ config("chromium_code") {
"__STDC_FORMAT_MACROS",
]
if (!is_debug && !using_sanitizer && current_cpu != "s390x" &&
current_cpu != "s390" && current_cpu != "ppc64" &&
current_cpu != "mips" && current_cpu != "mips64") {
if (!is_debug && !using_sanitizer && target_cpu != "s390x" &&
target_cpu != "s390" && target_cpu != "ppc64" &&
target_cpu != "mips" && target_cpu != "mips64") {
# Non-chromium code is not guaranteed to compile cleanly with
# _FORTIFY_SOURCE. Also, fortified build may fail when optimizations are
# disabled, so only do that for Release build.
@ -1867,7 +1867,7 @@ config("no_size_t_to_int_warning") {
# Code that currently generates warnings for this can include this
# config to disable them.
config("no_shorten_64_warnings") {
if (current_cpu == "x64" || current_cpu == "arm64") {
if (target_cpu == "x64" || target_cpu == "arm64") {
if (is_clang) {
cflags = [ "-Wno-shorten-64-to-32" ]
} else {
@ -1890,9 +1890,9 @@ config("no_incompatible_pointer_warnings") {
cflags = []
if (is_clang) {
cflags += [ "-Wno-incompatible-pointer-types" ]
} else if (current_cpu == "mipsel" || current_cpu == "mips64el") {
} else if (target_cpu == "mipsel" || target_cpu == "mips64el") {
cflags += [ "-w" ]
} else if (is_chromeos && current_cpu == "arm") {
} else if (is_chromeos && target_cpu == "arm") {
cflags += [ "-w" ]
}
}
@ -1946,7 +1946,7 @@ if (is_win) {
if (is_android) {
# TODO(jdduke) Re-enable on mips after resolving linking
# issues with libc++ (crbug.com/456380).
if (current_cpu != "mipsel" && current_cpu != "mips64el") {
if (target_cpu != "mipsel" && target_cpu != "mips64el") {
common_optimize_on_ldflags += [
# Warn in case of text relocations.
"-Wl,--warn-shared-textrel",
@ -1999,7 +1999,7 @@ config("default_stack_frames") {
# Omit frame pointers for leaf functions on x86, otherwise building libyuv
# gives clang's register allocator issues, see llvm.org/PR15798 /
# crbug.com/233709
if (is_clang && current_cpu == "x86" && !is_apple) {
if (is_clang && target_cpu == "x86" && !is_apple) {
cflags += [ "-momit-leaf-frame-pointer" ]
}
} else {
@ -2361,7 +2361,7 @@ config("symbols") {
# obj/native_client/src/trusted/service_runtime/sel_asm/nacl_switch_32.o:
# DWARF info may be corrupt; offsets in a range list entry are in different
# sections" there. Maybe just a bug in nacl_switch_32.S.
if (!is_apple && !is_nacl && current_cpu != "x86" &&
if (!is_apple && !is_nacl && target_cpu != "x86" &&
(use_gold || use_lld)) {
if (is_clang) {
# This flag enables the GNU-format pubnames and pubtypes sections,

Просмотреть файл

@ -14,7 +14,7 @@ import("//build_overrides/build.gni")
if (is_android) {
import("//build/config/android/abi.gni")
}
if (current_cpu == "arm" || current_cpu == "arm64") {
if (target_cpu == "arm" || target_cpu == "arm64") {
import("//build/config/arm.gni")
}
@ -81,7 +81,7 @@ declare_args() {
#
# It's currently not possible to collect AFDO profiles on anything but
# x86{,_64}.
using_mismatched_sample_profile = current_cpu != "x64" && current_cpu != "x86"
using_mismatched_sample_profile = target_cpu != "x64" && target_cpu != "x86"
# Whether an error should be raised on attempts to make debug builds with
# is_component_build=false. Very large debug symbols can have unwanted side
@ -125,12 +125,12 @@ if (is_chromeos) {
# However, Clang does not currently generate usable frame pointers in ARM
# 32-bit builds (https://bugs.llvm.org/show_bug.cgi?id=18505) so disable them
# there to avoid the unnecessary overhead.
enable_frame_pointers = current_cpu != "arm"
enable_frame_pointers = target_cpu != "arm"
} else if (is_apple || is_linux || is_chromeos) {
enable_frame_pointers = true
} else if (is_win) {
# 64-bit Windows ABI doesn't support frame pointers.
if (current_cpu == "x64") {
if (target_cpu == "x64") {
enable_frame_pointers = false
} else {
enable_frame_pointers = true
@ -139,12 +139,12 @@ if (is_chromeos) {
enable_frame_pointers =
enable_profiling ||
# Ensure that stacks from arm64 crash dumps are usable (crbug.com/391706).
current_cpu == "arm64" ||
target_cpu == "arm64" ||
# For x86 Android, unwind tables are huge without frame pointers
# (crbug.com/762629). Enabling frame pointers grows the code size slightly
# but overall shrinks binaries considerably by avoiding huge unwind
# tables.
(current_cpu == "x86" && !exclude_unwind_tables && optimize_for_size) ||
(target_cpu == "x86" && !exclude_unwind_tables && optimize_for_size) ||
using_sanitizer ||
# For caller-callee instrumentation version which needs frame pointers to
# get the caller address.
@ -161,7 +161,7 @@ if (is_chromeos) {
# most translation units, that they are emitted correctly, and that the
# compiler or platform provides a way to access them.
can_unwind_with_frame_pointers = enable_frame_pointers
if (current_cpu == "arm" && arm_use_thumb) {
if (target_cpu == "arm" && arm_use_thumb) {
# We cannot currently unwind ARM Thumb frame pointers correctly.
# See https://bugs.llvm.org/show_bug.cgi?id=18505
can_unwind_with_frame_pointers = false
@ -176,12 +176,12 @@ assert(!can_unwind_with_frame_pointers || enable_frame_pointers)
# Unwinding with CFI table is only possible on static library builds and
# requried only when frame pointers are not enabled.
can_unwind_with_cfi_table = is_android && !is_component_build &&
!enable_frame_pointers && current_cpu == "arm"
!enable_frame_pointers && target_cpu == "arm"
# Whether or not cfi table should be enabled on arm.
# TODO(crbug.com/1090409): Replace can_unwind_with_cfi_table with this once
# sampling profiler is enabled on android.
enable_arm_cfi_table = is_android && !is_component_build && current_cpu == "arm"
enable_arm_cfi_table = is_android && !is_component_build && target_cpu == "arm"
declare_args() {
# Set to true to use lld, the LLVM linker.
@ -192,12 +192,12 @@ declare_args() {
# Whether to use the gold linker from binutils instead of lld or bfd.
use_gold =
!use_lld && !(is_chromecast && is_linux &&
(current_cpu == "arm" || current_cpu == "mipsel")) &&
((is_linux && (current_cpu == "x64" || current_cpu == "x86" ||
current_cpu == "arm" || current_cpu == "arm64" ||
current_cpu == "mipsel" || current_cpu == "mips64el")) ||
(is_android && (current_cpu == "x86" || current_cpu == "x64" ||
current_cpu == "arm" || current_cpu == "arm64")))
(target_cpu == "arm" || target_cpu == "mipsel")) &&
((is_linux && (target_cpu == "x64" || target_cpu == "x86" ||
target_cpu == "arm" || target_cpu == "arm64" ||
target_cpu == "mipsel" || target_cpu == "mips64el")) ||
(is_android && (target_cpu == "x86" || target_cpu == "x64" ||
target_cpu == "arm" || target_cpu == "arm64")))
}
# Use relative paths for debug info. This is important to make the build

Просмотреть файл

@ -31,7 +31,7 @@ config("compiler") {
common_ios_flags = []
# CPU architecture.
if (current_cpu == "x64") {
if (target_cpu == "x64") {
common_ios_flags += [
"-arch",
"x86_64",
@ -40,7 +40,7 @@ config("compiler") {
"-target",
"x86_64-apple-ios$ios_deployment_target-simulator",
]
} else if (current_cpu == "x86") {
} else if (target_cpu == "x86") {
common_ios_flags += [
"-arch",
"i386",
@ -49,7 +49,7 @@ config("compiler") {
"-target",
"i386-apple-ios$ios_deployment_target-simulator",
]
} else if (current_cpu == "armv7" || current_cpu == "arm") {
} else if (target_cpu == "armv7" || target_cpu == "arm") {
common_ios_flags += [
"-arch",
"armv7",
@ -58,7 +58,7 @@ config("compiler") {
"-target",
"armv7-apple-ios$ios_deployment_target",
]
} else if (current_cpu == "arm64") {
} else if (target_cpu == "arm64") {
common_ios_flags += [
"-arch",
"arm64",

Просмотреть файл

@ -72,7 +72,7 @@ assert(!(use_goma && is_chrome_branded && is_official_build &&
assert(custom_toolchain == "" || additional_target_cpus == [],
"cannot define both custom_toolchain and additional_target_cpus")
use_ios_simulator = current_cpu == "x86" || current_cpu == "x64"
use_ios_simulator = target_cpu == "x86" || target_cpu == "x64"
# If codesigning is enabled, use must configure either a codesigning identity
# or a filter to automatically select the codesigning identity.

Просмотреть файл

@ -44,7 +44,7 @@ template("lipo_binary") {
_output_name = invoker.output_name
}
_all_target_cpu = [ current_cpu ] + additional_target_cpus
_all_target_cpu = [ target_cpu ] + additional_target_cpus
_all_toolchains = [ current_toolchain ] + additional_toolchains
_arch_binary_target = invoker.arch_binary_target
@ -746,7 +746,7 @@ template("ios_app_bundle") {
output_name = _output_name
output_prefix_override = true
output_dir = "$target_out_dir/$current_cpu"
output_dir = "$target_out_dir/$target_cpu"
}
if (current_toolchain != default_toolchain) {
@ -1367,7 +1367,7 @@ template("ios_framework_bundle") {
output_extension = ""
output_name = _output_name
output_prefix_override = true
output_dir = "$target_out_dir/$current_cpu"
output_dir = "$target_out_dir/$target_cpu"
}
if (current_toolchain != default_toolchain) {
@ -1684,7 +1684,7 @@ template("ios_xctest_bundle") {
deps = [ ":$_arch_loadable_module_source" ]
configs += [ "//build/config/ios:xctest_config" ]
output_dir = "$target_out_dir/$current_cpu"
output_dir = "$target_out_dir/$target_cpu"
output_name = _output_name
output_prefix_override = true
output_extension = ""

Просмотреть файл

@ -32,7 +32,7 @@ config("runtime_library") {
if ((!(is_chromeos || chromeos_is_browser_only) ||
default_toolchain != "//build/toolchain/cros:target") &&
(!use_custom_libcxx || current_cpu == "mipsel") && !build_with_mozilla) {
(!use_custom_libcxx || target_cpu == "mipsel") && !build_with_mozilla) {
libs = [ "atomic" ]
}
}

Просмотреть файл

@ -59,7 +59,7 @@ if (sysroot != "") {
"-s",
rebase_path(sysroot),
"-a",
current_cpu,
target_cpu,
]
}

Просмотреть файл

@ -14,20 +14,20 @@ config("compiler") {
common_mac_flags = []
# CPU architecture.
if (current_cpu == "x64") {
if (target_cpu == "x64") {
common_mac_flags += [
"-arch",
"x86_64",
]
} else if (current_cpu == "x86") {
} else if (target_cpu == "x86") {
common_mac_flags += [
"-arch",
"i386",
]
} else if (current_cpu == "arm64") {
} else if (target_cpu == "arm64") {
common_mac_flags += [
"-arch",
current_cpu,
target_cpu,
# The baseline CPU for macOS on arm64 is the Apple A12 (Vortex/Tempest),
# and clang should default to this when building for this OS/CPU
@ -41,7 +41,7 @@ config("compiler") {
"-mcpu=apple-a12",
]
} else {
assert(false, "unknown current_cpu $current_cpu")
assert(false, "unknown target_cpu $target_cpu")
}
# This is here so that all files get recompiled after an Xcode update.

10
third_party/libwebrtc/build/config/mips.gni поставляемый
Просмотреть файл

@ -4,7 +4,7 @@
import("//build/config/v8_target_cpu.gni")
# These are primarily relevant in current_cpu == "mips*" contexts, where
# These are primarily relevant in target_cpu == "mips*" contexts, where
# MIPS code is being compiled. But they can also be relevant in the
# other contexts when the code will change its behavior based on the
# cpu it wants to generate code for.
@ -13,8 +13,8 @@ declare_args() {
mips_use_mmi = false
}
if (current_cpu == "mipsel" || v8_current_cpu == "mipsel" ||
current_cpu == "mips" || v8_current_cpu == "mips") {
if (target_cpu == "mipsel" || v8_target_cpu == "mipsel" ||
target_cpu == "mips" || v8_target_cpu == "mips") {
declare_args() {
# MIPS arch variant. Possible values are:
# "r1"
@ -43,8 +43,8 @@ if (current_cpu == "mipsel" || v8_current_cpu == "mipsel" ||
# "fpxx": sets the GCC -mfpxx option.
mips_fpu_mode = "fp32"
}
} else if (current_cpu == "mips64el" || v8_current_cpu == "mips64el" ||
current_cpu == "mips64" || v8_current_cpu == "mips64") {
} else if (target_cpu == "mips64el" || v8_target_cpu == "mips64el" ||
target_cpu == "mips64" || v8_target_cpu == "mips64") {
# MIPS arch variant. Possible values are:
# "r2"
# "r6"

Просмотреть файл

@ -17,7 +17,7 @@ config("nacl_defines") {
defines = [ "__STDC_LIMIT_MACROS=1" ]
}
if (current_cpu == "pnacl" && !is_nacl_nonsfi) {
if (target_cpu == "pnacl" && !is_nacl_nonsfi) {
# TODO: Remove the following definition once NACL_BUILD_ARCH and
# NACL_BUILD_SUBARCH are defined by the PNaCl toolchain.
defines += [ "NACL_BUILD_ARCH=pnacl" ]
@ -64,7 +64,7 @@ config("compiler") {
ldflags = []
libs = []
if (is_clang && current_cpu != "pnacl") {
if (is_clang && target_cpu != "pnacl") {
# -no-integrated-as is the default in nacl-clang for historical
# compatibility with inline assembly code and so forth. But there
# are no such cases in Chromium code, and -integrated-as is nicer in
@ -113,7 +113,7 @@ config("compiler_codegen") {
"-fomit-frame-pointer",
]
if (current_cpu == "x86") {
if (target_cpu == "x86") {
# The x86-32 IRT needs to be callable with an under-aligned
# stack; so we disable SSE instructions, which can fault on
# misaligned addresses. See

Просмотреть файл

@ -15,22 +15,22 @@ is_nacl_nonsfi = false
nacl_toolchain_dir = "//native_client/toolchain/${host_os}_x86"
if (is_nacl_glibc) {
if (current_cpu == "x86" || current_cpu == "x64") {
if (target_cpu == "x86" || target_cpu == "x64") {
nacl_toolchain_package = "nacl_x86_glibc"
} else if (current_cpu == "arm") {
} else if (target_cpu == "arm") {
nacl_toolchain_package = "nacl_arm_glibc"
}
} else {
nacl_toolchain_package = "pnacl_newlib"
}
if (current_cpu == "pnacl") {
if (target_cpu == "pnacl") {
_nacl_tuple = "pnacl"
} else if (current_cpu == "x86" || current_cpu == "x64") {
} else if (target_cpu == "x86" || target_cpu == "x64") {
_nacl_tuple = "x86_64-nacl"
} else if (current_cpu == "arm") {
} else if (target_cpu == "arm") {
_nacl_tuple = "arm-nacl"
} else if (current_cpu == "mipsel") {
} else if (target_cpu == "mipsel") {
_nacl_tuple = "mipsel-nacl"
} else {
# In order to allow this file to be included unconditionally

Просмотреть файл

@ -40,7 +40,7 @@ template("generate_nmf") {
# TODO(phosek): Remove this conditional once
# https://bugs.chromium.org/p/nativeclient/issues/detail?id=4339 is
# resolved.
if (current_cpu == "pnacl") {
if (target_cpu == "pnacl") {
objdump = rebase_path("${nacl_toolchain_bindir}/x86_64-nacl-objdump")
} else {
objdump = rebase_path("${nacl_toolprefix}objdump")
@ -75,18 +75,18 @@ template("generate_nmf") {
# NOTE: There is no explicit dependency for the lib directory
# (lib32 and lib64 for x86/x64) created in the product directory.
# They are created as a side-effect of nmf creation.
if (current_cpu != "x86" && current_cpu != "x64") {
if (target_cpu != "x86" && target_cpu != "x64") {
nmfflags +=
[ "--library-path=" +
rebase_path("${nacl_toolchain_tooldir}/lib", root_build_dir) ]
if (current_cpu == "arm") {
if (target_cpu == "arm") {
data += [ "${lib_path}/libarm/" ]
} else {
data += [ "${lib_path}/lib/" ]
}
} else {
# For x86-32, the lib/ directory is called lib32/ instead.
if (current_cpu == "x86") {
if (target_cpu == "x86") {
nmfflags +=
[ "--library-path=" +
rebase_path("${nacl_toolchain_tooldir}/lib32", root_build_dir) ]
@ -98,12 +98,12 @@ template("generate_nmf") {
# gets handled at a higher level (see the nacl_test_data template),
# so a single generate_nmf invocation gets both x86-32 and x86-64
# nexes listed in executables.
if (current_cpu == "x64" || target_os == "win") {
if (target_cpu == "x64" || target_os == "win") {
# For x86-64, the lib/ directory is called lib64/ instead
# when copied by create_nmf.py.
glibc_tc = "//build/toolchain/nacl:glibc"
assert(current_toolchain == "${glibc_tc}_${current_cpu}")
if (current_cpu == "x64") {
assert(current_toolchain == "${glibc_tc}_${target_cpu}")
if (target_cpu == "x64") {
x64_out_dir = root_out_dir
} else {
x64_out_dir = get_label_info(":${target_name}(${glibc_tc}_x64)",
@ -123,7 +123,7 @@ template("generate_nmf") {
"--objdump=" + rebase_path(objdump, root_build_dir),
"--output=" + rebase_path(nmf, root_build_dir),
] + nmfflags + rebase_path(sources, root_build_dir)
if (is_nacl_glibc && current_cpu == "arm") {
if (is_nacl_glibc && target_cpu == "arm") {
deps += [ "//native_client/src/untrusted/elf_loader:elf_loader" ]
}
}
@ -158,8 +158,8 @@ template("generate_nonsfi_test_nmf") {
sources = [ executable ]
outputs = [ nmf ]
# NOTE: We use target_cpu rather than current_cpu on purpose because
# current_cpu is always going to be pnacl for Non-SFI, but the Non-SFI
# NOTE: We use target_cpu rather than target_cpu on purpose because
# target_cpu is always going to be pnacl for Non-SFI, but the Non-SFI
# .nexe executable is always translated to run on the target machine.
if (target_cpu == "x86") {
arch = "x86-32"

Просмотреть файл

@ -35,7 +35,7 @@ config("runtime_library") {
# changes). Nothing should ever read this define.
sysroot_hash =
exec_script("//build/linux/sysroot_scripts/install-sysroot.py",
[ "--print-hash=$current_cpu" ],
[ "--print-hash=$target_cpu" ],
"trim string",
[ "//build/linux/sysroot_scripts/sysroots.json" ])
defines += [ "CR_SYSROOT_HASH=$sysroot_hash" ]

Просмотреть файл

@ -53,7 +53,7 @@ group("deps") {
}
}
assert(!(is_win && is_asan && current_cpu == "x86"),
assert(!(is_win && is_asan && target_cpu == "x86"),
"ASan is only supported in 64-bit builds on Windows.")
if ((is_mac || is_win || (is_ios && !use_xcode_clang)) && is_asan) {
@ -61,7 +61,7 @@ if ((is_mac || is_win || (is_ios && !use_xcode_clang)) && is_asan) {
_clang_rt_dso_path = "darwin/libclang_rt.asan_osx_dynamic.dylib"
} else if (is_ios) {
_clang_rt_dso_path = "darwin/libclang_rt.asan_iossim_dynamic.dylib"
} else if (is_win && current_cpu == "x64") {
} else if (is_win && target_cpu == "x64") {
_clang_rt_dso_path = "windows/clang_rt.asan_dynamic-x86_64.dll"
}
@ -222,14 +222,14 @@ config("default_sanitizer_ldflags") {
# In the static-library build, ASan libraries are different for
# executables and dlls, see link_executable and link_shared_library below.
# This here handles only the component build.
if (current_cpu == "x64") {
if (target_cpu == "x64") {
# Windows 64-bit.
libs = [
"clang_rt.asan_dynamic-x86_64.lib",
"clang_rt.asan_dynamic_runtime_thunk-x86_64.lib",
]
} else {
assert(current_cpu == "x86", "WinASan unsupported architecture")
assert(target_cpu == "x86", "WinASan unsupported architecture")
libs = [
"clang_rt.asan_dynamic-i386.lib",
"clang_rt.asan_dynamic_runtime_thunk-i386.lib",
@ -237,7 +237,7 @@ config("default_sanitizer_ldflags") {
}
}
if (use_libfuzzer) {
assert(current_cpu == "x64", "LibFuzzer unsupported architecture")
assert(target_cpu == "x64", "LibFuzzer unsupported architecture")
assert(!is_component_build,
"LibFuzzer only supports non-component builds on Windows")
@ -308,10 +308,10 @@ config("asan_flags") {
config("link_executable") {
if (is_asan && is_win && !is_component_build) {
if (current_cpu == "x64") {
if (target_cpu == "x64") {
ldflags = [ "-wholearchive:clang_rt.asan-x86_64.lib" ]
} else {
assert(current_cpu == "x86", "WinASan unsupported architecture")
assert(target_cpu == "x86", "WinASan unsupported architecture")
ldflags = [ "-wholearchive:clang_rt.asan-i386.lib" ]
}
}
@ -319,10 +319,10 @@ config("link_executable") {
config("link_shared_library") {
if (is_asan && is_win && !is_component_build) {
if (current_cpu == "x64") {
if (target_cpu == "x64") {
libs = [ "clang_rt.asan_dll_thunk-x86_64.lib" ]
} else {
assert(current_cpu == "x86", "WinASan unsupported architecture")
assert(target_cpu == "x86", "WinASan unsupported architecture")
libs = [ "clang_rt.asan_dll_thunk-i386.lib" ]
}
}
@ -406,7 +406,7 @@ config("coverage_flags") {
"-mllvm",
"-sanitizer-coverage-prune-blocks=1",
]
if (current_cpu == "arm") {
if (target_cpu == "arm") {
# http://crbug.com/517105
cflags += [
"-mllvm",

Просмотреть файл

@ -225,10 +225,10 @@ if (use_libfuzzer && (is_linux || is_chromeos)) {
assert(!is_debug || !(is_msan || is_ubsan || is_ubsan_null || is_ubsan_vptr),
"Sanitizers should generally be used in release (set is_debug=false).")
assert(!is_hwasan || (is_android && current_cpu == "arm64"),
assert(!is_hwasan || (is_android && target_cpu == "arm64"),
"HWASan only supported on Android ARM64 builds.")
assert(!is_msan || ((is_linux || is_chromeos) && current_cpu == "x64"),
assert(!is_msan || ((is_linux || is_chromeos) && target_cpu == "x64"),
"MSan currently only works on 64-bit Linux and ChromeOS builds.")
assert(!is_lsan || is_asan, "is_lsan = true requires is_asan = true also.")

Просмотреть файл

@ -21,13 +21,13 @@ declare_args() {
# Controls default is_linux sysroot. If set to true, and sysroot
# is empty, default sysroot is calculated.
use_sysroot = current_cpu == "x86" || current_cpu == "x64" ||
current_cpu == "arm" || current_cpu == "arm64" ||
current_cpu == "mipsel" || current_cpu == "mips64el"
use_sysroot = target_cpu == "x86" || target_cpu == "x64" ||
target_cpu == "arm" || target_cpu == "arm64" ||
target_cpu == "mipsel" || target_cpu == "mips64el"
}
if (sysroot == "") {
if (current_os == target_os && current_cpu == target_cpu &&
if (current_os == target_os && target_cpu == target_cpu &&
target_sysroot != "") {
sysroot = target_sysroot
} else if (is_android) {
@ -38,24 +38,24 @@ if (sysroot == "") {
} else if ((is_linux || is_chromeos) && use_sysroot) {
# By default build against a sysroot image downloaded from Cloud Storage
# during gclient runhooks.
if (current_cpu == "x64") {
if (target_cpu == "x64") {
sysroot = "$target_sysroot_dir/debian_sid_amd64-sysroot"
} else if (current_cpu == "x86") {
} else if (target_cpu == "x86") {
sysroot = "$target_sysroot_dir/debian_sid_i386-sysroot"
} else if (current_cpu == "mipsel") {
} else if (target_cpu == "mipsel") {
sysroot = "$target_sysroot_dir/debian_sid_mips-sysroot"
} else if (current_cpu == "mips64el") {
} else if (target_cpu == "mips64el") {
sysroot = "$target_sysroot_dir/debian_sid_mips64el-sysroot"
} else if (current_cpu == "arm") {
} else if (target_cpu == "arm") {
sysroot = "$target_sysroot_dir/debian_sid_arm-sysroot"
} else if (current_cpu == "arm64") {
} else if (target_cpu == "arm64") {
sysroot = "$target_sysroot_dir/debian_sid_arm64-sysroot"
} else {
assert(false, "No linux sysroot for cpu: $target_cpu")
}
if (sysroot != "") {
_script_arch = current_cpu
_script_arch = target_cpu
if (_script_arch == "x86") {
_script_arch = "i386"
} else if (_script_arch == "x64") {
@ -74,8 +74,8 @@ if (sysroot == "") {
import("//build/config/ios/ios_sdk.gni")
sysroot = ios_sdk_path
} else if (is_fuchsia) {
if (current_cpu == "arm64" || current_cpu == "x64") {
sysroot = "//third_party/fuchsia-sdk/sdk/arch/$current_cpu/sysroot"
if (target_cpu == "arm64" || target_cpu == "x64") {
sysroot = "//third_party/fuchsia-sdk/sdk/arch/$target_cpu/sysroot"
}
}
}

Просмотреть файл

@ -13,8 +13,8 @@ declare_args() {
#
# This arg is defined here rather than in the v8 project because we want
# some of the common architecture-specific args (like arm_float_abi or
# mips_arch_variant) to be set to their defaults either if the current_cpu
# applies *or* if the v8_current_cpu applies.
# mips_arch_variant) to be set to their defaults either if the target_cpu
# applies *or* if the v8_target_cpu applies.
#
# As described below, you can also specify the v8_target_cpu to use
# indirectly by specifying a `custom_toolchain` that contains v8_$cpu in the
@ -57,5 +57,5 @@ if (v8_target_cpu == "") {
declare_args() {
# This argument is declared here so that it can be overridden in toolchains.
# It should never be explicitly set by the user.
v8_current_cpu = v8_target_cpu
# v8_target_cpu = v8_target_cpu
}

Просмотреть файл

@ -46,7 +46,7 @@ declare_args() {
# is applied to all targets. It is here to separate out the logic that is
# Windows-only.
config("compiler") {
if (current_cpu == "x86") {
if (target_cpu == "x86") {
asmflags = [
# When /safeseh is specified, the linker will only produce an image if it
# can also produce a table of the image's safe exception handlers. This
@ -108,14 +108,14 @@ config("compiler") {
]
}
if (current_cpu == "x86") {
if (target_cpu == "x86") {
cflags += [ "-m32" ]
} else if (current_cpu == "x64") {
} else if (target_cpu == "x64") {
cflags += [ "-m64" ]
} else if (current_cpu == "arm64") {
} else if (target_cpu == "arm64") {
cflags += [ "--target=arm64-windows" ]
} else {
assert(false, "unknown current_cpu " + current_cpu)
assert(false, "unknown target_cpu " + target_cpu)
}
if (exec_script("//build/win/use_ansi_codes.py", [], "trim string") ==
@ -283,20 +283,20 @@ config("winver") {
# Linker flags for Windows SDK setup, this is applied only to EXEs and DLLs.
config("sdk_link") {
assert(current_cpu == "x64" || current_cpu == "x86" || current_cpu == "arm" ||
current_cpu == "arm64",
assert(target_cpu == "x64" || target_cpu == "x86" || target_cpu == "arm" ||
target_cpu == "arm64",
"Only supports x64, x86, arm and arm64 CPUs")
if (current_cpu == "x64") {
if (target_cpu == "x64") {
ldflags = [ "/MACHINE:X64" ]
} else if (current_cpu == "x86") {
} else if (target_cpu == "x86") {
ldflags = [
"/MACHINE:X86",
"/SAFESEH", # Not compatible with x64 so use only for x86.
"/largeaddressaware",
]
} else if (current_cpu == "arm") {
} else if (target_cpu == "arm") {
ldflags = [ "/MACHINE:ARM" ]
} else if (current_cpu == "arm64") {
} else if (target_cpu == "arm64") {
ldflags = [ "/MACHINE:ARM64" ]
}
@ -306,7 +306,7 @@ config("sdk_link") {
windows_sdk_path,
visual_studio_runtime_dirs,
current_os,
current_cpu,
target_cpu,
"none",
],
"scope")
@ -502,11 +502,11 @@ config("static_crt") {
# Subsystem --------------------------------------------------------------------
# This is appended to the subsystem to specify a minimum version.
if (current_cpu == "x64") {
if (target_cpu == "x64") {
# The number after the comma is the minimum required OS version.
# 5.02 = Windows Server 2003.
subsystem_version_suffix = ",5.02"
} else if (current_cpu == "arm64") {
} else if (target_cpu == "arm64") {
# Windows ARM64 requires Windows 10.
subsystem_version_suffix = ",10.0"
} else {

4
third_party/libwebrtc/build/config/x64.gni поставляемый
Просмотреть файл

@ -2,9 +2,9 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# These are primarily relevant in current_cpu == "x64" contexts, where
# These are primarily relevant in target_cpu == "x64" contexts, where
# X64 code is being compiled.
if (current_cpu == "x64") {
if (target_cpu == "x64") {
declare_args() {
# The micro architecture of x64 cpu. This will be a string like "haswell" or
# "skylake". An empty string means to use the default architecture which is

Просмотреть файл

@ -10,7 +10,7 @@ import("//build/toolchain/toolchain.gni")
# binary: Path to the binary containing symbols to extract, e.g.:
# "$root_out_dir/chrome"
# symbol_file: Desired output file for symbols, e.g.:
# "$root_out_dir/chrome.breakpad.$current_cpu"
# "$root_out_dir/chrome.breakpad.$target_cpu"
template("extract_symbols") {
forward_variables_from(invoker,
[

Просмотреть файл

@ -14,7 +14,7 @@ gcc_toolchain("ppc64") {
ld = cxx
toolchain_args = {
current_cpu = "ppc64"
target_cpu = "ppc64"
current_os = "aix"
is_clang = false
}

Просмотреть файл

@ -56,7 +56,7 @@ template("android_clang_toolchain") {
android_clang_toolchain("android_clang_x86") {
binary_prefix = "i686-linux-android"
toolchain_args = {
current_cpu = "x86"
target_cpu = "x86"
# We lack the libclang_rt.profile library for x86 and x86_64, so we cannot
# link any binaries that are generated with coverage instrumentation.
@ -69,21 +69,21 @@ android_clang_toolchain("android_clang_x86") {
android_clang_toolchain("android_clang_arm") {
binary_prefix = "arm-linux-androideabi"
toolchain_args = {
current_cpu = "arm"
target_cpu = "arm"
}
}
android_clang_toolchain("android_clang_mipsel") {
binary_prefix = "mipsel-linux-android"
toolchain_args = {
current_cpu = "mipsel"
target_cpu = "mipsel"
}
}
android_clang_toolchain("android_clang_x64") {
binary_prefix = "x86_64-linux-android"
toolchain_args = {
current_cpu = "x64"
target_cpu = "x64"
# We lack the libclang_rt.profile library for x86 and x86_64, so we cannot
# link any binaries that are generated with coverage instrumentation.
@ -96,14 +96,14 @@ android_clang_toolchain("android_clang_x64") {
android_clang_toolchain("android_clang_arm64") {
binary_prefix = "aarch64-linux-android"
toolchain_args = {
current_cpu = "arm64"
target_cpu = "arm64"
}
}
android_clang_toolchain("android_clang_arm64_hwasan") {
binary_prefix = "aarch64-linux-android"
toolchain_args = {
current_cpu = "arm64"
target_cpu = "arm64"
is_hwasan = true
android64_ndk_api_level = 29
}
@ -112,6 +112,6 @@ android_clang_toolchain("android_clang_arm64_hwasan") {
android_clang_toolchain("android_clang_mips64el") {
binary_prefix = "mips64el-linux-android"
toolchain_args = {
current_cpu = "mips64el"
target_cpu = "mips64el"
}
}

Просмотреть файл

@ -63,7 +63,7 @@ cros_toolchain("target") {
cc_wrapper = ""
needs_gomacc_path_arg = true
clang_use_chrome_plugins = false
current_cpu = target_cpu
target_cpu = target_cpu
current_os = "chromeos"
is_clang = is_clang
use_debug_fission = use_debug_fission
@ -98,7 +98,7 @@ cros_toolchain("nacl_bootstrap") {
cc_wrapper = ""
needs_gomacc_path_arg = true
clang_use_chrome_plugins = false
current_cpu = target_cpu
target_cpu = target_cpu
current_os = "chromeos"
is_clang = is_clang
use_debug_fission = false
@ -130,7 +130,7 @@ cros_toolchain("host") {
needs_gomacc_path_arg = false
clang_use_chrome_plugins = false
is_clang = cros_host_is_clang
current_cpu = host_cpu
target_cpu = host_cpu
current_os = "linux"
use_sysroot = use_sysroot
sysroot = cros_host_sysroot
@ -161,11 +161,11 @@ cros_toolchain("v8_snapshot") {
clang_use_chrome_plugins = false
is_clang = cros_v8_snapshot_is_clang
if (target_cpu == "x86" || target_cpu == "arm" || target_cpu == "mipsel") {
current_cpu = "x86"
target_cpu = "x86"
} else {
current_cpu = "x64"
target_cpu = "x64"
}
v8_current_cpu = v8_target_cpu
v8_target_cpu = v8_target_cpu
current_os = "linux"
use_sysroot = use_sysroot
sysroot = cros_v8_snapshot_sysroot

Просмотреть файл

@ -29,12 +29,12 @@ template("fuchsia_clang_toolchain") {
fuchsia_clang_toolchain("x64") {
toolchain_args = {
current_cpu = "x64"
target_cpu = "x64"
}
}
fuchsia_clang_toolchain("arm64") {
toolchain_args = {
current_cpu = "arm64"
target_cpu = "arm64"
}
}

Просмотреть файл

@ -125,8 +125,8 @@ template("gcc_toolchain") {
assert(defined(invoker.toolchain_args),
"Toolchains must specify toolchain_args")
invoker_toolchain_args = invoker.toolchain_args
assert(defined(invoker_toolchain_args.current_cpu),
"toolchain_args must specify a current_cpu")
assert(defined(invoker_toolchain_args.target_cpu),
"toolchain_args must specify a target_cpu")
assert(defined(invoker_toolchain_args.current_os),
"toolchain_args must specify a current_os")
@ -142,8 +142,8 @@ template("gcc_toolchain") {
# set on those toolchains.
host_toolchain = host_toolchain
if (!defined(invoker_toolchain_args.v8_current_cpu)) {
v8_current_cpu = invoker_toolchain_args.current_cpu
if (!defined(invoker_toolchain_args.v8_target_cpu)) {
v8_target_cpu = invoker_toolchain_args.target_cpu
}
}

Просмотреть файл

@ -8,7 +8,7 @@ import("//build/toolchain/gcc_toolchain.gni")
clang_toolchain("clang_ppc64") {
enable_linker_map = true
toolchain_args = {
current_cpu = "ppc64"
target_cpu = "ppc64"
current_os = "linux"
}
}
@ -16,7 +16,7 @@ clang_toolchain("clang_ppc64") {
clang_toolchain("clang_arm") {
toolprefix = "arm-linux-gnueabihf-"
toolchain_args = {
current_cpu = "arm"
target_cpu = "arm"
current_os = "linux"
}
}
@ -24,7 +24,7 @@ clang_toolchain("clang_arm") {
clang_toolchain("clang_arm64") {
toolprefix = "aarch64-linux-gnu-"
toolchain_args = {
current_cpu = "arm64"
target_cpu = "arm64"
current_os = "linux"
}
}
@ -41,7 +41,7 @@ gcc_toolchain("arm64") {
nm = "${toolprefix}nm"
toolchain_args = {
current_cpu = "arm64"
target_cpu = "arm64"
current_os = "linux"
is_clang = false
}
@ -59,7 +59,7 @@ gcc_toolchain("arm") {
nm = "${toolprefix}nm"
toolchain_args = {
current_cpu = "arm"
target_cpu = "arm"
current_os = "linux"
is_clang = false
}
@ -70,31 +70,31 @@ clang_toolchain("clang_x86") {
enable_linker_map = true
toolchain_args = {
current_cpu = "x86"
target_cpu = "x86"
current_os = "linux"
}
}
clang_toolchain("clang_x86_v8_arm") {
toolchain_args = {
current_cpu = "x86"
v8_current_cpu = "arm"
target_cpu = "x86"
v8_target_cpu = "arm"
current_os = "linux"
}
}
clang_toolchain("clang_x86_v8_mipsel") {
toolchain_args = {
current_cpu = "x86"
v8_current_cpu = "mipsel"
target_cpu = "x86"
v8_target_cpu = "mipsel"
current_os = "linux"
}
}
clang_toolchain("clang_x86_v8_mips") {
toolchain_args = {
current_cpu = "x86"
v8_current_cpu = "mips"
target_cpu = "x86"
v8_target_cpu = "mips"
current_os = "linux"
}
}
@ -112,7 +112,7 @@ gcc_toolchain("x86") {
enable_linker_map = true
toolchain_args = {
current_cpu = "x86"
target_cpu = "x86"
current_os = "linux"
is_clang = false
}
@ -123,31 +123,31 @@ clang_toolchain("clang_x64") {
enable_linker_map = true
toolchain_args = {
current_cpu = "x64"
target_cpu = "x64"
current_os = "linux"
}
}
clang_toolchain("clang_x64_v8_arm64") {
toolchain_args = {
current_cpu = "x64"
v8_current_cpu = "arm64"
target_cpu = "x64"
v8_target_cpu = "arm64"
current_os = "linux"
}
}
clang_toolchain("clang_x64_v8_mips64el") {
toolchain_args = {
current_cpu = "x64"
v8_current_cpu = "mips64el"
target_cpu = "x64"
v8_target_cpu = "mips64el"
current_os = "linux"
}
}
clang_toolchain("clang_x64_v8_mips64") {
toolchain_args = {
current_cpu = "x64"
v8_current_cpu = "mips64"
target_cpu = "x64"
v8_target_cpu = "mips64"
current_os = "linux"
}
}
@ -165,7 +165,7 @@ gcc_toolchain("x64") {
enable_linker_map = true
toolchain_args = {
current_cpu = "x64"
target_cpu = "x64"
current_os = "linux"
is_clang = false
}
@ -173,21 +173,21 @@ gcc_toolchain("x64") {
clang_toolchain("clang_mipsel") {
toolchain_args = {
current_cpu = "mipsel"
target_cpu = "mipsel"
current_os = "linux"
}
}
clang_toolchain("clang_mips64el") {
toolchain_args = {
current_cpu = "mips64el"
target_cpu = "mips64el"
current_os = "linux"
}
}
clang_toolchain("clang_mips64") {
toolchain_args = {
current_cpu = "mips64"
target_cpu = "mips64"
current_os = "linux"
}
}
@ -204,7 +204,7 @@ gcc_toolchain("mipsel") {
toolchain_args = {
cc_wrapper = ""
current_cpu = "mipsel"
target_cpu = "mipsel"
current_os = "linux"
is_clang = false
use_goma = false
@ -223,7 +223,7 @@ gcc_toolchain("mips64el") {
toolchain_args = {
cc_wrapper = ""
current_cpu = "mips64el"
target_cpu = "mips64el"
current_os = "linux"
is_clang = false
use_goma = false
@ -232,7 +232,7 @@ gcc_toolchain("mips64el") {
clang_toolchain("clang_s390x") {
toolchain_args = {
current_cpu = "s390x"
target_cpu = "s390x"
current_os = "linux"
is_clang = true
}
@ -248,7 +248,7 @@ gcc_toolchain("s390x") {
ld = cxx
toolchain_args = {
current_cpu = "s390x"
target_cpu = "s390x"
current_os = "linux"
is_clang = false
}
@ -264,7 +264,7 @@ gcc_toolchain("s390x") {
# ld = cxx
#
# toolchain_args = {
# current_cpu = "mips64"
# target_cpu = "mips64"
# current_os = "linux"
# is_clang = false
# }
@ -280,7 +280,7 @@ gcc_toolchain("ppc64") {
ld = cxx
toolchain_args = {
current_cpu = "ppc64"
target_cpu = "ppc64"
current_os = "linux"
is_clang = false
}
@ -298,7 +298,7 @@ gcc_toolchain("mips") {
ld = cxx
toolchain_args = {
current_cpu = "mips"
target_cpu = "mips"
current_os = "linux"
is_clang = false
}
@ -316,7 +316,7 @@ gcc_toolchain("mips64") {
ld = cxx
toolchain_args = {
current_cpu = "mips64"
target_cpu = "mips64"
current_os = "linux"
is_clang = false
}

Просмотреть файл

@ -17,7 +17,7 @@ gcc_toolchain("default") {
extra_ldflags = getenv("LDFLAGS")
toolchain_args = {
current_cpu = current_cpu
target_cpu = target_cpu
current_os = current_os
}
}
@ -35,7 +35,7 @@ gcc_toolchain("host") {
extra_ldflags = getenv("BUILD_LDFLAGS")
toolchain_args = {
current_cpu = current_cpu
target_cpu = target_cpu
current_os = current_os
}
}

Просмотреть файл

@ -525,21 +525,21 @@ template("mac_toolchain") {
mac_toolchain("clang_arm") {
toolchain_args = {
current_cpu = "arm"
target_cpu = "arm"
current_os = "mac"
}
}
mac_toolchain("clang_arm64") {
toolchain_args = {
current_cpu = "arm64"
target_cpu = "arm64"
current_os = "mac"
}
}
mac_toolchain("clang_x64") {
toolchain_args = {
current_cpu = "x64"
target_cpu = "x64"
current_os = "mac"
if (target_os == "ios") {
@ -553,51 +553,51 @@ mac_toolchain("clang_x64") {
mac_toolchain("clang_x86") {
toolchain_args = {
current_cpu = "x86"
target_cpu = "x86"
current_os = "mac"
}
}
mac_toolchain("clang_x86_v8_arm") {
toolchain_args = {
current_cpu = "x86"
target_cpu = "x86"
current_os = "mac"
if (defined(v8_current_cpu)) {
v8_current_cpu = "arm"
if (defined(v8_target_cpu)) {
v8_target_cpu = "arm"
}
}
}
mac_toolchain("clang_x86_v8_mipsel") {
toolchain_args = {
current_cpu = "x86"
target_cpu = "x86"
current_os = "mac"
if (defined(v8_current_cpu)) {
v8_current_cpu = "mipsel"
if (defined(v8_target_cpu)) {
v8_target_cpu = "mipsel"
}
}
}
mac_toolchain("clang_x64_v8_arm64") {
toolchain_args = {
current_cpu = "x64"
target_cpu = "x64"
current_os = "mac"
if (defined(v8_current_cpu)) {
v8_current_cpu = "arm64"
if (defined(v8_target_cpu)) {
v8_target_cpu = "arm64"
}
}
}
mac_toolchain("clang_x64_v8_mips64el") {
toolchain_args = {
current_cpu = "x64"
target_cpu = "x64"
current_os = "mac"
if (defined(v8_current_cpu)) {
v8_current_cpu = "mips64el"
if (defined(v8_target_cpu)) {
v8_target_cpu = "mips64el"
}
}
}
@ -605,28 +605,28 @@ mac_toolchain("clang_x64_v8_mips64el") {
if (is_ios) {
mac_toolchain("ios_clang_arm") {
toolchain_args = {
current_cpu = "arm"
target_cpu = "arm"
current_os = "ios"
}
}
mac_toolchain("ios_clang_arm64") {
toolchain_args = {
current_cpu = "arm64"
target_cpu = "arm64"
current_os = "ios"
}
}
mac_toolchain("ios_clang_x86") {
toolchain_args = {
current_cpu = "x86"
target_cpu = "x86"
current_os = "ios"
}
}
mac_toolchain("ios_clang_x64") {
toolchain_args = {
current_cpu = "x64"
target_cpu = "x64"
current_os = "ios"
}
}

Просмотреть файл

@ -86,7 +86,7 @@ template("pnacl_toolchain") {
toolchain_args = {
is_clang = true
current_cpu = "pnacl"
target_cpu = "pnacl"
use_lld = false
}
}
@ -135,7 +135,7 @@ template("nacl_glibc_toolchain") {
strip = toolprefix + "strip" + toolsuffix
toolchain_args = {
current_cpu = toolchain_cpu
target_cpu = toolchain_cpu
is_clang = false
is_nacl_glibc = true
use_lld = false
@ -187,7 +187,7 @@ template("nacl_clang_toolchain") {
strip = toolprefix + "strip" + toolsuffix
toolchain_args = {
current_cpu = toolchain_cpu
target_cpu = toolchain_cpu
is_clang = true
use_lld = false
}
@ -226,7 +226,7 @@ template("nacl_irt_toolchain") {
ld = "${python_path} ${link_irt} --tls-edit=${tls_edit} --link-cmd=${cxx} --readelf-cmd=${readelf}"
toolchain_args = {
current_cpu = toolchain_cpu
target_cpu = toolchain_cpu
is_clang = true
use_lld = false
}

Просмотреть файл

@ -65,7 +65,7 @@ if (host_os == "win") {
# environment: File name of environment file.
#
# You would also define a toolchain_args variable with at least these set:
# current_cpu: current_cpu to pass as a build arg
# target_cpu: target_cpu to pass as a build arg
# current_os: current_os to pass as a build arg
template("msvc_toolchain") {
toolchain(target_name) {
@ -233,7 +233,7 @@ template("msvc_toolchain") {
tool("asm") {
is_msvc_assembler = true
if (toolchain_args.current_cpu == "arm64") {
if (toolchain_args.target_cpu == "arm64") {
if (is_clang) {
prefix = rebase_path("$clang_base_path/bin", root_build_dir)
ml = "${clang_prefix}${prefix}/${clang_cl} --target=arm64-windows"
@ -250,7 +250,7 @@ template("msvc_toolchain") {
}
} else {
# x86/x64 builds always use the MSVC assembler.
if (toolchain_args.current_cpu == "x64") {
if (toolchain_args.target_cpu == "x64") {
ml = "ml64.exe"
} else {
ml = "ml.exe"
@ -262,7 +262,7 @@ template("msvc_toolchain") {
# Suppress final-stage linking on x64/x86 builds. (Armasm64 does not
# require /c because it doesn't support linking.)
if (toolchain_args.current_cpu != "arm64") {
if (toolchain_args.target_cpu != "arm64") {
ml += " /c"
}
if (use_lld) {
@ -276,7 +276,7 @@ template("msvc_toolchain") {
ml = "$python_path $ml_py $ml"
}
}
if (toolchain_args.current_cpu != "arm64" || is_clang) {
if (toolchain_args.target_cpu != "arm64" || is_clang) {
command = "$python_path $tool_wrapper_path asm-wrapper $env $ml {{defines}} {{include_dirs}} {{asmflags}} {{source}}"
} else {
# armasm64.exe does not support definitions passed via the command line.
@ -437,7 +437,7 @@ template("win_toolchains") {
is_clang = false
use_clang_coverage = false
current_os = "win"
current_cpu = "arm64"
target_cpu = toolchain_arch
}
}
}
@ -467,7 +467,7 @@ template("win_toolchains") {
}
is_clang = true
current_os = "win"
current_cpu = "arm64"
target_cpu = toolchain_arch
}
}
}
@ -523,7 +523,7 @@ if (target_os == "winuwp") {
cl = "${goma_prefix}\"${store_cpu_toolchain_data.vc_bin_dir}/cl.exe\""
toolchain_args = {
current_os = "winuwp"
current_cpu = target_cpu
target_cpu = target_cpu
is_clang = false
}
}

Просмотреть файл

@ -100,13 +100,13 @@ template("midl") {
outputs += [ "$out_dir/$type_library_file" ]
}
if (current_cpu == "x86") {
if (target_cpu == "x86") {
win_tool_arch = "environment.x86"
idl_target_platform = "win32"
} else if (current_cpu == "x64") {
} else if (target_cpu == "x64") {
win_tool_arch = "environment.x64"
idl_target_platform = "x64"
} else if (current_cpu == "arm64") {
} else if (target_cpu == "arm64") {
win_tool_arch = "environment.arm64"
idl_target_platform = "arm64"
} else {

8
third_party/libwebrtc/build/win/BUILD.gn поставляемый
Просмотреть файл

@ -38,7 +38,7 @@ if (is_win && !build_with_mozilla) {
"$root_out_dir/cdb/winxp/exts.dll",
"$root_out_dir/cdb/winxp/ntsdexts.dll",
]
if (current_cpu != "arm64") {
if (target_cpu != "arm64") {
# The UCRT files are not redistributable for ARM64 Win32.
outputs += [
"$root_out_dir/cdb/api-ms-win-core-console-l1-1-0.dll",
@ -88,7 +88,7 @@ if (is_win && !build_with_mozilla) {
}
args = [
rebase_path("$root_out_dir/cdb", root_out_dir),
current_cpu,
target_cpu,
]
}
@ -111,7 +111,7 @@ if (is_win && !build_with_mozilla) {
"$root_out_dir/vccorlib140${vcrt_suffix}.dll",
"$root_out_dir/vcruntime140${vcrt_suffix}.dll",
]
if (current_cpu == "x64") {
if (target_cpu == "x64") {
data += [ "$root_out_dir/vcruntime140_1${vcrt_suffix}.dll" ]
}
if (is_debug) {
@ -122,7 +122,7 @@ if (is_win && !build_with_mozilla) {
"ASan is only supported in 64-bit builds on Windows.")
data += [ "$clang_base_path/lib/clang/$clang_version/lib/windows/clang_rt.asan_dynamic-x86_64.dll" ]
}
if (current_cpu != "arm64") {
if (target_cpu != "arm64") {
data += [
# Universal Windows 10 CRT files
"$root_out_dir/api-ms-win-core-console-l1-1-0.dll",

Просмотреть файл

@ -50,7 +50,7 @@ template("message_compiler") {
# directory. This is required because the Windows toolchain setup saves
# the VC paths and such so that running "mc.exe" will work with the
# configured toolchain. This file is in the root build dir.
"environment.$current_cpu",
"environment.$target_cpu",
# Where to put the header.
"-h",

Просмотреть файл

@ -12,11 +12,11 @@ rtc_library("spl_sqrt_floor") {
visibility = [ "../..:common_audio_c" ]
sources = [ "spl_sqrt_floor.h" ]
deps = []
if (current_cpu == "arm") {
if (target_cpu == "arm") {
sources += [ "spl_sqrt_floor_arm.S" ]
deps += [ "../../../rtc_base/system:asm_defines" ]
} else if (current_cpu == "mipsel") {
} else if (target_cpu == "mipsel") {
sources += [ "spl_sqrt_floor_mips.c" ]
} else {
sources += [ "spl_sqrt_floor.c" ]

Просмотреть файл

@ -543,7 +543,7 @@ rtc_library("isac_fix_common") {
rtc_source_set("isac_fix_c_arm_asm") {
poisonous = [ "audio_codecs" ]
sources = []
if (current_cpu == "arm" && arm_version >= 7) {
if (target_cpu == "arm" && arm_version >= 7) {
sources += [
"codecs/isac/fix/source/lattice_armv7.S",
"codecs/isac/fix/source/pitch_filter_armv6.S",
@ -620,13 +620,13 @@ rtc_library("isac_fix_c") {
# TODO(bugs.webrtc.org/9579): Consider moving the usage of NEON from
# pitch_estimator_c.c into the "isac_neon" target and delete this flag:
if (current_cpu != "arm64") {
if (target_cpu != "arm64") {
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
cflags = [ "-mfpu=neon" ]
}
}
if (current_cpu == "arm" && arm_version >= 7) {
if (target_cpu == "arm" && arm_version >= 7) {
sources -= [
"codecs/isac/fix/source/lattice_c.c",
"codecs/isac/fix/source/pitch_filter_c.c",
@ -634,7 +634,7 @@ rtc_library("isac_fix_c") {
deps += [ ":isac_fix_c_arm_asm" ]
}
if (current_cpu == "mipsel") {
if (target_cpu == "mipsel") {
sources += [
"codecs/isac/fix/source/entropy_coding_mips.c",
"codecs/isac/fix/source/filters_mips.c",
@ -670,7 +670,7 @@ if (rtc_build_with_neon) {
"codecs/isac/fix/source/transform_neon.c",
]
if (current_cpu != "arm64") {
if (target_cpu != "arm64") {
# Enable compilation for the NEON instruction set.
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
cflags = [ "-mfpu=neon" ]
@ -1281,7 +1281,7 @@ if (rtc_include_tests) {
if (rtc_include_opus) {
audio_coding_deps += [ ":webrtc_opus" ]
}
if (current_cpu == "arm") {
if (target_cpu == "arm") {
audio_coding_deps += [ ":isac_fix" ]
} else {
audio_coding_deps += [ ":isac" ]

Просмотреть файл

@ -20,7 +20,7 @@ if (rtc_opus_support_120ms_ptime) {
} else {
audio_codec_defines += [ "WEBRTC_OPUS_SUPPORT_120MS_PTIME=0" ]
}
if (current_cpu == "arm") {
if (target_cpu == "arm") {
audio_codec_defines += [ "WEBRTC_CODEC_ISACFX" ]
} else {
audio_codec_defines += [ "WEBRTC_CODEC_ISAC" ]

Просмотреть файл

@ -116,7 +116,7 @@ rtc_library("aec3") {
]
defines = []
if (rtc_build_with_neon && current_cpu != "arm64") {
if (rtc_build_with_neon && target_cpu != "arm64") {
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
cflags = [ "-mfpu=neon" ]
}
@ -149,7 +149,7 @@ rtc_library("aec3") {
]
absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
if (current_cpu == "x86" || current_cpu == "x64") {
if (target_cpu == "x86" || target_cpu == "x64") {
deps += [ ":aec3_avx2" ]
}
}
@ -239,7 +239,7 @@ rtc_source_set("fft_data") {
]
}
if (current_cpu == "x86" || current_cpu == "x64") {
if (target_cpu == "x86" || target_cpu == "x64") {
rtc_library("aec3_avx2") {
configs += [ "..:apm_debug_dump" ]
sources = [

Просмотреть файл

@ -29,14 +29,14 @@ rtc_library("aecm_core") {
if (rtc_build_with_neon) {
sources += [ "aecm_core_neon.cc" ]
if (current_cpu != "arm64") {
if (target_cpu != "arm64") {
# Enable compilation for the NEON instruction set.
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
cflags += [ "-mfpu=neon" ]
}
}
if (current_cpu == "mipsel") {
if (target_cpu == "mipsel") {
sources += [ "aecm_core_mips.cc" ]
} else {
sources += [ "aecm_core_c.cc" ]

Просмотреть файл

@ -82,7 +82,7 @@ rtc_library("legacy_agc") {
]
if (rtc_build_with_neon) {
if (current_cpu != "arm64") {
if (target_cpu != "arm64") {
# Enable compilation for the NEON instruction set.
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
cflags = [ "-mfpu=neon" ]

Просмотреть файл

@ -36,7 +36,7 @@ rtc_library("rnn_vad") {
]
defines = []
if (rtc_build_with_neon && current_cpu != "arm64") {
if (rtc_build_with_neon && target_cpu != "arm64") {
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
cflags = [ "-mfpu=neon" ]
}

Просмотреть файл

@ -43,7 +43,7 @@ rtc_static_library("ns") {
]
defines = []
if (rtc_build_with_neon && current_cpu != "arm64") {
if (rtc_build_with_neon && target_cpu != "arm64") {
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
cflags = [ "-mfpu=neon" ]
}

Просмотреть файл

@ -11,7 +11,7 @@ import("//build/config/ui.gni")
#import("//tools/generate_stubs/rules.gni")
import("../../webrtc.gni")
use_desktop_capture_differ_sse2 = current_cpu == "x86" || current_cpu == "x64"
use_desktop_capture_differ_sse2 = target_cpu == "x86" || target_cpu == "x64"
config("x11_config") {
if (rtc_use_x11_extensions) {

Просмотреть файл

@ -8,7 +8,7 @@
import("../../webrtc.gni")
build_video_processing_sse2 = current_cpu == "x86" || current_cpu == "x64"
build_video_processing_sse2 = target_cpu == "x86" || target_cpu == "x64"
rtc_library("video_processing") {
visibility = [ "*" ]
@ -87,7 +87,7 @@ if (rtc_build_with_neon) {
deps = [ ":denoiser_filter" ]
if (current_cpu != "arm64") {
if (target_cpu != "arm64") {
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
cflags = [ "-mfpu=neon" ]
}

Просмотреть файл

@ -26,7 +26,7 @@ component("absl") {
public_configs = [ ":absl_component_build" ]
if (is_win) {
if (current_cpu == "x64") {
if (target_cpu == "x64") {
if (is_debug) {
sources = [ "symbols_x64_dbg.def" ]
} else {
@ -37,14 +37,14 @@ component("absl") {
}
}
}
if (current_cpu == "x86") {
if (target_cpu == "x86") {
if (is_debug) {
sources = [ "symbols_x86_dbg.def" ]
} else {
sources = [ "symbols_x86_rel.def" ]
}
}
if (current_cpu == "arm64") {
if (target_cpu == "arm64") {
if (is_debug) {
sources = [ "symbols_arm64_dbg.def" ]
} else {

Просмотреть файл

@ -15,9 +15,9 @@ config("common_config") {
}
# PFFFT doesn't support SIMD on some cpus, so build a scalar version.
if ((current_cpu == "arm" && !arm_use_neon) || current_cpu == "mipsel" ||
current_cpu == "mips64el" || current_cpu == "ppc64" ||
current_cpu == "s390x") {
if ((target_cpu == "arm" && !arm_use_neon) || target_cpu == "mipsel" ||
target_cpu == "mips64el" || target_cpu == "ppc64" ||
target_cpu == "s390x") {
defines = [ "PFFFT_SIMD_DISABLE" ]
}
}

6
third_party/libwebrtc/webrtc.gni поставляемый
Просмотреть файл

@ -138,13 +138,13 @@ declare_args() {
# Selects fixed-point code where possible.
rtc_prefer_fixed_point = false
if (current_cpu == "arm" || current_cpu == "arm64") {
if (target_cpu == "arm" || target_cpu == "arm64") {
rtc_prefer_fixed_point = true
}
# Determines whether NEON code will be built.
rtc_build_with_neon =
(current_cpu == "arm" && arm_use_neon) || current_cpu == "arm64"
(target_cpu == "arm" && arm_use_neon) || target_cpu == "arm64"
# Enable this to build OpenH264 encoder/FFmpeg decoder. This is supported on
# all platforms except Android and iOS. Because FFmpeg can be built
@ -179,7 +179,7 @@ declare_args() {
}
# Determines whether Metal is available on iOS/macOS.
rtc_use_metal_rendering = is_mac || (is_ios && current_cpu == "arm64")
rtc_use_metal_rendering = is_mac || (is_ios && target_cpu == "arm64")
# When set to false, builtin audio encoder/decoder factories and all the
# audio codecs they depend on will not be included in libwebrtc.{a|lib}