| Index: build/config/compiler/BUILD.gn
|
| diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
|
| index 8cb4088b1695e821e905963147ea100eab7481dc..164b97d26260f3e238834c36ffad1e9e53037f5c 100644
|
| --- a/build/config/compiler/BUILD.gn
|
| +++ b/build/config/compiler/BUILD.gn
|
| @@ -3,10 +3,10 @@
|
| # found in the LICENSE file.
|
|
|
| import("//build/config/android/config.gni")
|
| -if (current_cpu == "arm") {
|
| +if (cpu_arch == "arm") {
|
| import("//build/config/arm.gni")
|
| }
|
| -if (current_cpu == "mipsel" || current_cpu == "mips64el") {
|
| +if (cpu_arch == "mipsel" || cpu_arch == "mips64el") {
|
| import("//build/config/mips.gni")
|
| }
|
| if (is_posix) {
|
| @@ -24,7 +24,7 @@ declare_args() {
|
| # These are not multi-arch so cannot be used except on x86 and x86-64 (the
|
| # only two architectures that are currently checked in). Turn this off when
|
| # you are using a custom toolchain and need to control -B in cflags.
|
| - linux_use_bundled_binutils = is_linux && current_cpu == "x64"
|
| + linux_use_bundled_binutils = is_linux && cpu_arch == "x64"
|
|
|
| # Compile in such a way as to enable profiling of the generated code. For
|
| # example, don't omit the frame pointer and leave in symbols.
|
| @@ -39,7 +39,7 @@ declare_args() {
|
|
|
| # Use gold for linking on 64-bit Linux only (on 32-bit it runs out of
|
| # address space, and it doesn't support cross-compiling).
|
| - use_gold = is_linux && current_cpu == "x64"
|
| + use_gold = is_linux && cpu_arch == "x64"
|
|
|
| # use_debug_fission: whether to use split DWARF debug info
|
| # files. This can reduce link time significantly, but is incompatible
|
| @@ -121,7 +121,7 @@ config("compiler") {
|
| }
|
|
|
| # Linker warnings.
|
| - if (!(is_chromeos && current_cpu == "arm") && !is_mac) {
|
| + if (!(is_chromeos && cpu_arch == "arm") && !is_mac) {
|
| # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
|
| ldflags += [ "-Wl,--fatal-warnings" ]
|
| }
|
| @@ -172,12 +172,12 @@ config("compiler") {
|
| common_mac_flags = []
|
|
|
| # CPU architecture.
|
| - if (current_cpu == "x64") {
|
| + if (cpu_arch == "x64") {
|
| common_mac_flags += [
|
| "-arch",
|
| "x86_64",
|
| ]
|
| - } else if (current_cpu == "x86") {
|
| + } else if (cpu_arch == "x86") {
|
| common_mac_flags += [
|
| "-arch",
|
| "i386",
|
| @@ -222,13 +222,13 @@ config("compiler") {
|
|
|
| # 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 (cpu_arch == "x64") {
|
| cflags += [
|
| "-m64",
|
| "-march=x86-64",
|
| ]
|
| ldflags += [ "-m64" ]
|
| - } else if (current_cpu == "x86") {
|
| + } else if (cpu_arch == "x86") {
|
| cflags += [ "-m32" ]
|
| ldflags += [ "-m32" ]
|
| if (is_clang) {
|
| @@ -242,7 +242,7 @@ config("compiler") {
|
| "-mstackrealign",
|
| ]
|
| }
|
| - } else if (current_cpu == "arm") {
|
| + } else if (cpu_arch == "arm") {
|
| # Don't set the compiler flags for the WebView build. These will come
|
| # from the Android build system.
|
| if (!is_android_webview_build) {
|
| @@ -275,7 +275,7 @@ config("compiler") {
|
| ]
|
| }
|
| }
|
| - } else if (current_cpu == "mipsel") {
|
| + } else if (cpu_arch == "mipsel") {
|
| # Don't set the compiler flags for the WebView build. These will come
|
| # from the Android build system.
|
| if (!is_android_webview_build) {
|
| @@ -302,7 +302,7 @@ config("compiler") {
|
| ]
|
| }
|
| }
|
| - } else if (current_cpu == "mips64el") {
|
| + } else if (cpu_arch == "mips64el") {
|
| # Don't set the compiler flags for the WebView build. These will come
|
| # from the Android build system.
|
| if (!is_android_webview_build) {
|
| @@ -437,7 +437,7 @@ config("compiler") {
|
| }
|
|
|
| # Use gold for Android for most CPU architectures.
|
| - if (current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm") {
|
| + if (cpu_arch == "x86" || cpu_arch == "x64" || cpu_arch == "arm") {
|
| ldflags += [ "-fuse-ld=gold" ]
|
| if (is_clang) {
|
| # Let clang find the ld.gold in the NDK.
|
| @@ -449,17 +449,10 @@ config("compiler") {
|
| ldflags += [
|
| "-Wl,--no-undefined",
|
|
|
| - # Don't allow visible symbols from libgcc or stlport to be
|
| - # re-exported.
|
| - "-Wl,--exclude-libs=libgcc.a",
|
| - "-Wl,--exclude-libs=libstlport_static.a",
|
| -
|
| - # Don't allow visible symbols from libraries that contain
|
| - # assembly code with symbols that aren't hidden properly.
|
| - # http://crbug.com/448386
|
| - "-Wl,--exclude-libs=libvpx_assembly_arm.a",
|
| + # Don't export symbols from statically linked libraries.
|
| + "-Wl,--exclude-libs=ALL",
|
| ]
|
| - if (current_cpu == "arm") {
|
| + if (cpu_arch == "arm") {
|
| ldflags += [
|
| # Enable identical code folding to reduce size.
|
| "-Wl,--icf=safe",
|
| @@ -467,10 +460,10 @@ config("compiler") {
|
| }
|
|
|
| if (is_clang) {
|
| - if (current_cpu == "arm") {
|
| + if (cpu_arch == "arm") {
|
| cflags += [ "-target arm-linux-androideabi" ]
|
| ldflags += [ "-target arm-linux-androideabi" ]
|
| - } else if (current_cpu == "x86") {
|
| + } else if (cpu_arch == "x86") {
|
| cflags += [ "-target x86-linux-androideabi" ]
|
| ldflags += [ "-target x86-linux-androideabi" ]
|
| }
|
| @@ -479,7 +472,7 @@ config("compiler") {
|
| }
|
|
|
| config("compiler_arm_fpu") {
|
| - if (current_cpu == "arm" && !is_android_webview_build) {
|
| + if (cpu_arch == "arm" && !is_android_webview_build) {
|
| cflags = [ "-mfpu=$arm_fpu" ]
|
| }
|
| }
|
| @@ -577,7 +570,7 @@ config("runtime_library") {
|
| libs += [ "stlport_static" ]
|
| }
|
|
|
| - if (current_cpu == "mipsel") {
|
| + if (cpu_arch == "mipsel") {
|
| libs += [
|
| # ld linker is used for mips Android, and ld does not accept library
|
| # absolute path prefixed by "-l"; Since libgcc does not exist in mips
|
| @@ -844,7 +837,7 @@ config("default_warnings") {
|
|
|
| # Suppress warnings about ABI changes on ARM (Clang doesn't give this
|
| # warning).
|
| - if (current_cpu == "arm" && !is_clang) {
|
| + if (cpu_arch == "arm" && !is_clang) {
|
| cflags += [ "-Wno-psabi" ]
|
| }
|
|
|
| @@ -888,20 +881,6 @@ config("wexit_time_destructors") {
|
| }
|
| }
|
|
|
| -# On Windows compiling on x64, VC will issue a warning when converting
|
| -# size_t to int because it will truncate the value. Our code should not have
|
| -# these warnings and one should use a static_cast or a checked_cast for the
|
| -# conversion depending on the case. However, a lot of code still needs to be
|
| -# fixed. Apply this config to such targets to disable the warning.
|
| -#
|
| -# Note that this can be applied regardless of platform and architecture to
|
| -# clean up the call sites. This will only apply the flag when necessary.
|
| -config("no_size_t_to_int_warning") {
|
| - if (is_win && current_cpu == "x64") {
|
| - cflags = [ "/wd4267" ]
|
| - }
|
| -}
|
| -
|
| # Optimization -----------------------------------------------------------------
|
| #
|
| # Note that BUILDCONFIG.gn sets up a variable "default_optimization_config"
|
|
|