diff options
author | torne <torne@chromium.org> | 2015-03-31 04:50:35 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-31 11:51:32 +0000 |
commit | c6fe7a775af41cd98533e89a902b8b67044caa87 (patch) | |
tree | d823a24922f73807350a0b725021fc338ded49b0 /build | |
parent | 887f8c314715f50be9ff08c08c6351a6f4498593 (diff) | |
download | chromium_src-c6fe7a775af41cd98533e89a902b8b67044caa87.zip chromium_src-c6fe7a775af41cd98533e89a902b8b67044caa87.tar.gz chromium_src-c6fe7a775af41cd98533e89a902b8b67044caa87.tar.bz2 |
Remove most android_webview_build conditions from build.
Remove most references to android_webview_build from the build directory
now that we no longer support that build configuration. Fold conditions
into their parents where appropriate. Leave the variable itself defined
to 0 as not all uses in the tree have been removed yet.
A few references are left alone here and will be removed separately in
later changes that will be larger refactorings to eliminate other
variables.
BUG=440793
Review URL: https://codereview.chromium.org/1043913002
Cr-Commit-Position: refs/heads/master@{#323013}
Diffstat (limited to 'build')
-rw-r--r-- | build/android/android_exports.gyp | 43 | ||||
-rw-r--r-- | build/android/android_webview_export_whitelist.lst | 16 | ||||
-rw-r--r-- | build/android/finalize_apk_action.gypi | 12 | ||||
-rw-r--r-- | build/common.gypi | 378 | ||||
-rw-r--r-- | build/config/android/config.gni | 5 | ||||
-rw-r--r-- | build/config/compiler/BUILD.gn | 174 | ||||
-rw-r--r-- | build/config/features.gni | 2 | ||||
-rw-r--r-- | build/config/gcc/gcc_version.gni | 7 | ||||
-rw-r--r-- | build/config/sysroot.gni | 28 | ||||
-rw-r--r-- | build/jar_file_jni_generator.gypi | 10 | ||||
-rw-r--r-- | build/jni_generator.gypi | 10 | ||||
-rw-r--r-- | build/module_args/v8.gni | 3 |
12 files changed, 203 insertions, 485 deletions
diff --git a/build/android/android_exports.gyp b/build/android/android_exports.gyp deleted file mode 100644 index bf3424d..0000000 --- a/build/android/android_exports.gyp +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright 2014 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# This target is only used when android_webview_build==1 - it implements a -# whitelist for exported symbols to minimise the binary size and prevent us -# accidentally exposing things we don't mean to expose. - -{ - 'variables': { - 'android_linker_script%': '<(SHARED_INTERMEDIATE_DIR)/android_webview_export_whitelist.lst', - }, - 'targets': [ - { - 'target_name': 'android_exports', - 'type': 'none', - 'inputs': [ - '<(DEPTH)/build/android/android_webview_export_whitelist.lst', - ], - 'outputs': [ - '<(android_linker_script)', - ], - 'copies': [ - { - 'destination': '<(SHARED_INTERMEDIATE_DIR)', - 'files': [ - '<@(_inputs)', - ], - }, - ], - 'conditions': [ - ['component=="static_library"', { - 'link_settings': { - 'ldflags': [ - # Only export symbols that are specified in version script. - '-Wl,--version-script=<(android_linker_script)', - ], - }, - }], - ], - }, - ], -} diff --git a/build/android/android_webview_export_whitelist.lst b/build/android/android_webview_export_whitelist.lst deleted file mode 100644 index 2a56a75..0000000 --- a/build/android/android_webview_export_whitelist.lst +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright 2014 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# Exports specification for android_webview_build==1, which uses a whitelist to -# enforce only specific symbols being exported. -# Check ld version script manual: -# https://sourceware.org/binutils/docs-2.24/ld/VERSION.html#VERSION - -{ - global: - Java_*_native*; - JNI_OnLoad; - __gcov_*; - local: *; -}; diff --git a/build/android/finalize_apk_action.gypi b/build/android/finalize_apk_action.gypi index 9934c1a..bdf9966 100644 --- a/build/android/finalize_apk_action.gypi +++ b/build/android/finalize_apk_action.gypi @@ -22,16 +22,8 @@ 'keystore_path%': '<(DEPTH)/build/android/ant/chromium-debug.keystore', 'keystore_name%': 'chromiumdebugkey', 'keystore_password%': 'chromium', - 'conditions': [ - # Webview doesn't use zipalign or rezip_apk_jar. - ['android_webview_build==0', { - 'zipalign_path%': '<(android_sdk_tools)/zipalign', - 'rezip_apk_jar_path%': '<(PRODUCT_DIR)/lib.java/rezip_apk.jar' - }, { - 'zipalign_path%': "", - 'rezip_apk_jar_path%': "", - }], - ], + 'zipalign_path%': '<(android_sdk_tools)/zipalign', + 'rezip_apk_jar_path%': '<(PRODUCT_DIR)/lib.java/rezip_apk.jar', }, 'inputs': [ '<(DEPTH)/build/android/gyp/finalize_apk.py', diff --git a/build/common.gypi b/build/common.gypi index f2e2653..6ab6c6b 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -155,10 +155,8 @@ # default. "default" should be used on non-official builds. 'android_channel%': 'default', - # This is set when building the Android WebView inside the Android - # build system, using the 'android' gyp backend. The WebView code is - # still built when this is unset, but builds using the normal chromium - # build system. + # WebView now builds in a normal android build; don't use this. + # TODO(torne): remove this. http://crbug.com/440793 'android_webview_build%': 0, # Set ARM architecture version. @@ -793,8 +791,8 @@ 'native_memory_pressure_signals%': 1, }], - # Enable autofill dialog for Android, Mac and Views-enabled platforms. - ['toolkit_views==1 or (OS=="android" and android_webview_build==0) or OS=="mac"', { + # Enable autofill dialog when not on iOS. + ['OS!="ios"', { 'enable_autofill_dialog%': 1, 'conditions': [ @@ -1023,7 +1021,7 @@ # TODO(rmcilroy): Enable v8_use_external_startup_data on ChromeOS # http://crbug.com/421063 - ['android_webview_build==0 and chromecast==0 and chromeos==0 and OS!="ios"', { + ['chromecast==0 and chromeos==0 and OS!="ios"', { 'v8_use_external_startup_data%': 1, }, { 'v8_use_external_startup_data%': 0, @@ -1574,18 +1572,11 @@ # it takes effect here. ['os_posix==1 and OS!="mac" and OS!="ios" and clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan_vptr==0', { 'conditions': [ - ['OS=="android" and android_webview_build==0', { + ['OS=="android"', { 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)', # We directly set the gcc version since we know what we use. 'gcc_version%': 49, - }], - ['OS=="android" and android_webview_build==1', { - # Android WebView uses a hermetic clang toolchain for host builds. - 'host_gcc_version%': 0, - # Android WebView uses the GCC toolchain from the Android build. - 'gcc_version%': 48, - }], - ['OS!="android"', { + }, { 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)', 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)', }], @@ -2085,11 +2076,6 @@ '-E', 'ANDROID_JAVA_TAGGED_ONLY=true', '--no-output-all-resource-defines', ], - 'conditions': [ - ['<(android_webview_build)==1', { - 'grit_defines': ['-D', 'is_android_webview_build'], - }], - ], }], ['OS=="mac" or OS=="ios"', { 'grit_defines': ['-D', 'scale_factors=2x'], @@ -2310,14 +2296,14 @@ }], # Set default compiler flags depending on ARM version. - ['arm_version==6 and android_webview_build==0', { + ['arm_version==6', { 'arm_arch%': 'armv6', 'arm_tune%': '', 'arm_fpu%': 'vfp', 'arm_float_abi%': 'softfp', 'arm_thumb%': 0, }], - ['arm_version==7 and android_webview_build==0', { + ['arm_version==7', { 'arm_arch%': 'armv7-a', 'arm_tune%': 'generic-armv7-a', 'conditions': [ @@ -2333,24 +2319,13 @@ }], # Set default compiler flags for MIPS floating-point support. - ['target_arch=="mipsel" and android_webview_build==0', { + ['target_arch=="mipsel"', { 'mips_float_abi%': 'hard', }], - ['target_arch=="mipsel" and mips_arch_variant=="r2" and android_webview_build==0', { + ['target_arch=="mipsel" and mips_arch_variant=="r2"', { 'mips_fpu_mode%': 'fp32', }], - ['android_webview_build==1', { - # The WebView build gets its cpu-specific flags from the Android build system. - 'arm_arch%': '', - 'arm_tune%': '', - 'arm_fpu%': '', - 'arm_float_abi%': '', - 'arm_thumb%': 0, - 'mips_float_abi%': '', - 'mips_fpu_mode%': '', - }], - # Enable brlapi by default for chromeos. [ 'chromeos==1', { 'use_brlapi%': 1, @@ -4079,10 +4054,6 @@ 'cflags!': [ '-fstack-protector', # stack protector is always enabled on arm64. ], - }], - # TODO: Remove webview test once webview fully compiles from - # Chromium. crbug.com/440793 - ['OS=="android" and android_webview_build==0', { 'ldflags': [ '-fuse-ld=gold', ], @@ -4095,78 +4066,74 @@ 'target_conditions': [ ['_toolset=="target"', { 'conditions': [ - ['android_webview_build==0', { + ['mips_arch_variant=="r6"', { 'conditions': [ - ['mips_arch_variant=="r6"', { - 'conditions': [ - ['clang==1', { - 'cflags': [ '-target mipsel-linux-gnu', '-march=mips32r6', ], - 'ldflags': [ '-target mipsel-linux-gnu', ], - }, { # clang==0 - 'cflags': ['-mips32r6', '-Wa,-mips32r6', ], - }], - ['clang==0 and OS=="android"', { - 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',], - }], - ], + ['clang==1', { + 'cflags': [ '-target mipsel-linux-gnu', '-march=mips32r6', ], + 'ldflags': [ '-target mipsel-linux-gnu', ], + }, { # clang==0 + 'cflags': ['-mips32r6', '-Wa,-mips32r6', ], }], - ['mips_arch_variant=="r2"', { - 'conditions': [ - ['mips_float_abi=="hard" and mips_fpu_mode!=""', { - 'cflags': ['-m<(mips_fpu_mode)'], - }], - ['clang==1', { - 'conditions': [ - ['OS=="android"', { - 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32r2'], - 'ldflags': [ '-target mipsel-linux-android', ], - }], - ], - }, { # clang==0 - 'cflags': ['-mips32r2', '-Wa,-mips32r2', ], - }], - ], + ['clang==0 and OS=="android"', { + 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',], }], - ['mips_arch_variant=="r1"', { - 'conditions': [ - ['clang==1', { - 'conditions': [ - ['OS=="android"', { - 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32'], - 'ldflags': [ '-target mipsel-linux-android', ], - }], - ], - }, { # clang==0 - 'cflags': ['-mips32', '-Wa,-mips32', ], + ], + }], + ['mips_arch_variant=="r2"', { + 'conditions': [ + ['mips_float_abi=="hard" and mips_fpu_mode!=""', { + 'cflags': ['-m<(mips_fpu_mode)'], + }], + ['clang==1', { + 'conditions': [ + ['OS=="android"', { + 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32r2'], + 'ldflags': [ '-target mipsel-linux-android', ], }], - ], + ], + }, { # clang==0 + 'cflags': ['-mips32r2', '-Wa,-mips32r2', ], }], + ], + }], + ['mips_arch_variant=="r1"', { + 'conditions': [ ['clang==1', { - 'cflags!': [ - # Clang does not support the following options. - '-finline-limit=64', - ], - 'cflags': [ - # TODO(gordanac) Enable integrated-as. - '-no-integrated-as', - '-B<(android_toolchain)', # Else /usr/bin/as gets picked up. - ], - 'ldflags': [ - # Let clang find the ld in the NDK. - '--gcc-toolchain=<(android_toolchain)/..', + 'conditions': [ + ['OS=="android"', { + 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32'], + 'ldflags': [ '-target mipsel-linux-android', ], + }], ], + }, { # clang==0 + 'cflags': ['-mips32', '-Wa,-mips32', ], }], - ['mips_dsp_rev==1', { - 'cflags': ['-mdsp'], - }], - ['mips_dsp_rev==2', { - 'cflags': ['-mdspr2'], - }], + ], + }], + ['clang==1', { + 'cflags!': [ + # Clang does not support the following options. + '-finline-limit=64', ], 'cflags': [ - '-m<(mips_float_abi)-float' + # TODO(gordanac) Enable integrated-as. + '-no-integrated-as', + '-B<(android_toolchain)', # Else /usr/bin/as gets picked up. + ], + 'ldflags': [ + # Let clang find the ld in the NDK. + '--gcc-toolchain=<(android_toolchain)/..', ], }], + ['mips_dsp_rev==1', { + 'cflags': ['-mdsp'], + }], + ['mips_dsp_rev==2', { + 'cflags': ['-mdspr2'], + }], + ], + 'cflags': [ + '-m<(mips_float_abi)-float' ], 'ldflags': [ '-Wl,--no-keep-memory' @@ -4181,17 +4148,13 @@ 'target_conditions': [ ['_toolset=="target"', { 'conditions': [ - ['android_webview_build==0', { - 'conditions': [ - ['mips_arch_variant=="r6"', { - 'cflags': ['-mips64r6', '-Wa,-mips64r6'], - 'ldflags': ['-mips64r6'], - }], - ['mips_arch_variant=="r2"', { - 'cflags': ['-mips64r2', '-Wa,-mips64r2'], - 'ldflags': ['-mips64r2'], - }], - ], + ['mips_arch_variant=="r6"', { + 'cflags': ['-mips64r6', '-Wa,-mips64r6'], + 'ldflags': ['-mips64r6'], + }], + ['mips_arch_variant=="r2"', { + 'cflags': ['-mips64r2', '-Wa,-mips64r2'], + 'ldflags': ['-mips64r2'], }], ], 'cflags_cc': [ @@ -4713,6 +4676,12 @@ '-finline-limit=64', '-Wa,--noexecstack', '<@(release_extra_cflags)', + '--sysroot=<(android_ndk_sysroot)', + # NOTE: The stlport header include paths below are specified in + # cflags rather than include_dirs because they need to come + # after include_dirs. + # The include ordering here is important; change with caution. + '-isystem<(android_stlport_include)', ], 'defines': [ 'ANDROID', @@ -4720,15 +4689,43 @@ 'USE_STLPORT=1', '_STLP_USE_PTR_SPECIALIZATIONS=1', 'CHROME_BUILD_ID="<(chrome_build_id)"', + # The NDK has these things, but doesn't define the constants + # to say that it does. Define them here instead. + 'HAVE_SYS_UIO_H', ], 'ldflags!': [ '-pthread', # Not supported by Android toolchain. ], 'ldflags': [ '-Wl,--no-undefined', + '--sysroot=<(android_ndk_sysroot)', + '-nostdlib', + '-L<(android_stlport_libs_dir)', + # 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=libcommon_audio.a', + '-Wl,--exclude-libs=libcommon_audio_neon.a', + '-Wl,--exclude-libs=libcommon_audio_sse2.a', + '-Wl,--exclude-libs=libiSACFix.a', + '-Wl,--exclude-libs=libisac_neon.a', + '-Wl,--exclude-libs=libopus.a', + '-Wl,--exclude-libs=libvpx.a', + ], + 'libraries': [ + '-l<(android_stlport_library)', + # Manually link the libgcc.a that the cross compiler uses. + '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)', + '-lc', + '-ldl', + '-lm', ], 'conditions': [ - ['component=="static_library" and android_webview_build==0', { + ['component=="static_library"', { 'target_conditions': [ ['use_native_jni_exports==0', { # Use a linker version script to strip JNI exports from @@ -4784,112 +4781,12 @@ '-mllvm -asan-globals=0', ], }], - ['android_webview_build==0', { - 'defines': [ - # The NDK has these things, but doesn't define the constants - # to say that it does. Define them here instead. - 'HAVE_SYS_UIO_H', - ], - 'cflags': [ - '--sysroot=<(android_ndk_sysroot)', - ], - 'ldflags': [ - '--sysroot=<(android_ndk_sysroot)', - '-nostdlib', - # 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=libcommon_audio.a', - '-Wl,--exclude-libs=libcommon_audio_neon.a', - '-Wl,--exclude-libs=libcommon_audio_sse2.a', - '-Wl,--exclude-libs=libiSACFix.a', - '-Wl,--exclude-libs=libisac_neon.a', - '-Wl,--exclude-libs=libopus.a', - '-Wl,--exclude-libs=libvpx.a', - ], - 'libraries': [ - '-l<(android_stlport_library)', - # Manually link the libgcc.a that the cross compiler uses. - '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)', - '-lc', - '-ldl', - '-lm', - ], - }], - ['android_webview_build==1', { - 'cflags': [ - # Android predefines this as 1; undefine it here so Chromium - # can redefine it later to be 2 for chromium code and unset - # for third party code. This works because cflags are added - # before defines. - '-U_FORTIFY_SOURCE', - # Disable any additional warnings enabled by the Android build system but which - # chromium does not build cleanly with (when treating warning as errors). - # Things that are part of -Wextra: - '-Wno-extra', # Enabled by -Wextra, but no specific flag - '-Wno-ignored-qualifiers', - '-Wno-type-limits', - '-Wno-unused-but-set-variable', - ], - 'cflags_cc': [ - # Other things unrelated to -Wextra: - '-Wno-non-virtual-dtor', - '-Wno-sign-promo', - ], - 'libraries': [ - '-ldl', - ], - }], - ['android_webview_build==1', { - 'target_conditions': [ - ['chromium_code==0', { - 'cflags': [ - # There is a class of warning which: - # 1) Android always enables and also treats as errors - # 2) Chromium ignores in third party code - # So we re-enable those warnings when building Android. - '-Wno-address', - '-Wno-format-security', - '-Wno-return-type', - '-Wno-sequence-point', - ], - 'cflags_cc': [ - '-Wno-non-virtual-dtor', - ], - }], - ], - }], ['target_arch == "arm" and order_profiling==0', { 'ldflags': [ # Enable identical code folding to reduce size. '-Wl,--icf=<(gold_icf_level)', ], }], - # NOTE: The stlport header include paths below are specified in - # cflags rather than include_dirs because they need to come - # after include_dirs. Think of them like system headers, but - # don't use '-isystem' because the arm-linux-androideabi-4.4.3 - # toolchain (circa Gingerbread) will exhibit strange errors. - # The include ordering here is important; change with caution. - ['android_webview_build==0', { - 'cflags': [ - '-isystem<(android_stlport_include)', - ], - 'ldflags': [ - '-L<(android_stlport_libs_dir)', - ], - }, { # else: android_webview_build!=0 - 'aosp_build_settings': { - # Specify that we want to statically link stlport from the - # NDK. This will provide all the include and library paths - # automatically at build time, and link the right library. - 'LOCAL_NDK_STL_VARIANT': 'stlport_static', - }, - }], ['target_arch=="ia32"', { # The x86 toolchain currently has problems with stack-protector. 'cflags!': [ @@ -4928,19 +4825,13 @@ ['_type=="shared_library" or _type=="loadable_module"', { 'ldflags': [ '-Wl,-shared,-Bsymbolic', + # crtbegin_so.o should be the last item in ldflags. + '<(android_ndk_lib)/crtbegin_so.o', ], - 'conditions': [ - ['android_webview_build==0', { - 'ldflags': [ - # crtbegin_so.o should be the last item in ldflags. - '<(android_ndk_lib)/crtbegin_so.o', - ], - 'libraries': [ - # crtend_so.o needs to be the last item in libraries. - # Do not add any libraries after this! - '<(android_ndk_lib)/crtend_so.o', - ], - }], + 'libraries': [ + # crtend_so.o needs to be the last item in libraries. + # Do not add any libraries after this! + '<(android_ndk_lib)/crtend_so.o', ], }], ], @@ -5856,45 +5747,6 @@ ], }, }], - # In the android webview build, force host targets to be compiled with clang - # as the hermetic host gcc is very old on some platforms. This is already - # the default on the current development version of AOSP but we force it - # here in case we need to compile against an older release version. We also - # explicitly set it to false for target binaries to avoid causing problems - # for the work to enable clang by default in AOSP. We also force the use of - # libstdc++ on host as peculiarities of the android gyp backend mean that - # using libc++ doesn't work, and Chromium doesn't yet require a more modern - # C++ library. - ['android_webview_build==1', { - 'target_defaults': { - 'target_conditions': [ - ['_toolset=="host"', { - 'aosp_build_settings': { - 'LOCAL_CLANG': 'true', - 'LOCAL_CXX_STL': 'libstdc++', - }, - }, { # else: _toolset != "host" - 'aosp_build_settings': { - 'LOCAL_CLANG': 'false', - }, - }], - ], - }, - }], - # We need a special case to handle the android webview build on mac because - # the host gcc there doesn't accept this flag, but the target gcc may - # require it. - ['gcc_version>=48 and android_webview_build==1 and host_os=="mac"', { - 'target_defaults': { - 'target_conditions': [ - ['_toolset=="host"', { - 'cflags!': [ - '-Wno-unused-local-typedefs', - ], - }], - ], - }, - }], ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) ' 'and OS!="win"', { 'make_global_settings': [ diff --git a/build/config/android/config.gni b/build/config/android/config.gni index 6e8a312..c00e1d0 100644 --- a/build/config/android/config.gni +++ b/build/config/android/config.gni @@ -30,9 +30,8 @@ if (is_android) { android_sdk_version = default_android_sdk_version android_sdk_build_tools_version = default_android_sdk_build_tools_version - # This is set when building the Android WebView inside the Android build - # system, using the 'android' gyp backend. The WebView code is still built - # when this is unset, but builds using the normal chromium build system. + # WebView now builds in a normal android build; don't use this. + # TODO(torne): remove this. http://crbug.com/440793 is_android_webview_build = false android_default_keystore_path = diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index cba7387..27167c6 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -246,93 +246,81 @@ config("compiler") { ] } } else if (current_cpu == "arm") { - # Don't set the compiler flags for the WebView build. These will come - # from the Android build system. - if (!is_android_webview_build) { + cflags += [ + "-march=$arm_arch", + "-mfloat-abi=$arm_float_abi", + ] + if (arm_tune != "") { + cflags += [ "-mtune=$arm_tune" ] + } + if (arm_use_thumb) { + cflags += [ "-mthumb" ] + if (is_android && !is_clang) { # Clang doesn't support this option. + cflags += [ "-mthumb-interwork" ] + } + } + if (!is_clang) { + # Clang doesn't support these flags. cflags += [ - "-march=$arm_arch", - "-mfloat-abi=$arm_float_abi", + # The tree-sra optimization (scalar replacement for + # aggregates enabling subsequent optimizations) leads to + # invalid code generation when using the Android NDK's + # compiler (r5-r7). This can be verified using + # webkit_unit_tests' WTF.Checked_int8_t test. + "-fno-tree-sra", + + # The following option is disabled to improve binary + # size and performance in gcc 4.9. + "-fno-caller-saves", ] - if (arm_tune != "") { - cflags += [ "-mtune=$arm_tune" ] - } - if (arm_use_thumb) { - cflags += [ "-mthumb" ] - if (is_android && !is_clang) { # Clang doesn't support this option. - cflags += [ "-mthumb-interwork" ] - } - } - if (!is_clang) { - # Clang doesn't support these flags. - cflags += [ - # The tree-sra optimization (scalar replacement for - # aggregates enabling subsequent optimizations) leads to - # invalid code generation when using the Android NDK's - # compiler (r5-r7). This can be verified using - # webkit_unit_tests' WTF.Checked_int8_t test. - "-fno-tree-sra", - - # The following option is disabled to improve binary - # size and performance in gcc 4.9. - "-fno-caller-saves", - ] - } } } else if (current_cpu == "mipsel") { - # Don't set the compiler flags for the WebView build. These will come - # from the Android build system. - if (!is_android_webview_build) { - if (mips_arch_variant == "r6") { - cflags += [ + if (mips_arch_variant == "r6") { + cflags += [ + "-mips32r6", + "-Wa,-mips32r6", + ] + if (is_android) { + ldflags += [ "-mips32r6", - "-Wa,-mips32r6", - ] - if (is_android) { - ldflags += [ - "-mips32r6", - "-Wl,-melf32ltsmip", - ] - } - } else if (mips_arch_variant == "r2") { - cflags += [ - "-mips32r2", - "-Wa,-mips32r2", - ] - if (mips_float_abi == "hard" && mips_fpu_mode != "") { - cflags += [ "-m$mips_fpu_mode" ] - } - } else if (mips_arch_variant == "r1") { - cflags += [ - "-mips32", - "-Wa,-mips32", + "-Wl,-melf32ltsmip", ] } - - if (mips_dsp_rev == 1) { - cflags += [ "-mdsp" ] - } else if (mips_dsp_rev == 2) { - cflags += [ "-mdspr2" ] + } else if (mips_arch_variant == "r2") { + cflags += [ + "-mips32r2", + "-Wa,-mips32r2", + ] + if (mips_float_abi == "hard" && mips_fpu_mode != "") { + cflags += [ "-m$mips_fpu_mode" ] } + } else if (mips_arch_variant == "r1") { + cflags += [ + "-mips32", + "-Wa,-mips32", + ] + } - cflags += [ "-m${mips_float_abi}-float" ] + if (mips_dsp_rev == 1) { + cflags += [ "-mdsp" ] + } else if (mips_dsp_rev == 2) { + cflags += [ "-mdspr2" ] } + + cflags += [ "-m${mips_float_abi}-float" ] } else if (current_cpu == "mips64el") { - # Don't set the compiler flags for the WebView build. These will come - # from the Android build system. - if (!is_android_webview_build) { - if (mips_arch_variant == "r6") { - cflags += [ - "-mips64r6", - "-Wa,-mips64r6", - ] - ldflags += [ "-mips64r6" ] - } else if (mips_arch_variant == "r2") { - cflags += [ - "-mips64r2", - "-Wa,-mips64r2", - ] - ldflags += [ "-mips64r2" ] - } + if (mips_arch_variant == "r6") { + cflags += [ + "-mips64r6", + "-Wa,-mips64r6", + ] + ldflags += [ "-mips64r6" ] + } else if (mips_arch_variant == "r2") { + cflags += [ + "-mips64r2", + "-Wa,-mips64r2", + ] + ldflags += [ "-mips64r2" ] } } @@ -433,15 +421,6 @@ config("compiler") { # Clang doesn't support these flags. cflags += [ "-finline-limit=64" ] } - if (is_android_webview_build) { - # Android predefines this as 1; undefine it here so Chromium can redefine - # it later to be 2 for chromium code and unset for third party code. This - # works because cflags are added before defines. - # TODO(brettw) the above comment seems incorrect. We specify defines - # before cflags on our compiler command lines. - cflags += [ "-U_FORTIFY_SOURCE" ] - } - if (is_asan) { # Android build relies on -Wl,--gc-sections removing unreachable code. # ASan instrumentation for globals inhibits this and results in a library @@ -451,11 +430,10 @@ config("compiler") { } defines += [ "ANDROID" ] - if (!is_android_webview_build) { - # The NDK has these things, but doesn't define the constants - # to say that it does. Define them here instead. - defines += [ "HAVE_SYS_UIO_H" ] - } + + # The NDK has these things, but doesn't define the constants + # to say that it does. Define them here instead. + defines += [ "HAVE_SYS_UIO_H" ] # Use gold for Android for most CPU architectures. if (current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm") { @@ -500,7 +478,7 @@ config("compiler") { } config("compiler_arm_fpu") { - if (current_cpu == "arm" && !is_android_webview_build) { + if (current_cpu == "arm") { cflags = [ "-mfpu=$arm_fpu" ] } } @@ -684,20 +662,6 @@ config("no_chromium_code") { "-Wno-deprecated", ] } - - if (is_android_webview_build) { - # There is a class of warning which: - # 1) Android always enables and also treats as errors - # 2) Chromium ignores in third party code - # So we re-enable those warnings when building Android. - cflags += [ - "-Wno-address", - "-Wno-format-security", - "-Wno-return-type", - "-Wno-sequence-point", - ] - cflags_cc += [ "-Wno-non-virtual-dtor" ] - } } # rtti ------------------------------------------------------------------------ diff --git a/build/config/features.gni b/build/config/features.gni index 783e32d..db70755 100644 --- a/build/config/features.gni +++ b/build/config/features.gni @@ -67,7 +67,7 @@ declare_args() { enable_supervised_users = !is_ios - enable_autofill_dialog = !is_ios && !(is_android && is_android_webview_build) + enable_autofill_dialog = !is_ios enable_google_now = !is_ios && !is_android diff --git a/build/config/gcc/gcc_version.gni b/build/config/gcc/gcc_version.gni index f5c1c1a..6741e45 100644 --- a/build/config/gcc/gcc_version.gni +++ b/build/config/gcc/gcc_version.gni @@ -3,12 +3,7 @@ # found in the LICENSE file. if (is_android) { - import("//build/config/android/config.gni") - if (is_android_webview_build) { - gcc_version = 48 - } else { - gcc_version = 49 - } + gcc_version = 49 } else if (current_toolchain == "//build/toolchain/cros:target" || current_toolchain == "//build/toolchain/linux:mipsel") { gcc_version = exec_script("../../compiler_version.py", diff --git a/build/config/sysroot.gni b/build/config/sysroot.gni index 941c77a..057971d 100644 --- a/build/config/sysroot.gni +++ b/build/config/sysroot.gni @@ -15,22 +15,18 @@ if (current_toolchain == default_toolchain && target_sysroot != "") { sysroot = target_sysroot } else if (is_android) { import("//build/config/android/config.gni") - if (!is_android_webview_build) { - if (current_cpu == "x86") { - sysroot = rebase_path("$android_ndk_root/$x86_android_sysroot_subdir") - } else if (current_cpu == "arm") { - sysroot = rebase_path("$android_ndk_root/$arm_android_sysroot_subdir") - } else if (current_cpu == "mipsel") { - sysroot = rebase_path("$android_ndk_root/$mips_android_sysroot_subdir") - } else if (current_cpu == "x64") { - sysroot = rebase_path("$android_ndk_root/$x86_64_android_sysroot_subdir") - } else if (current_cpu == "arm64") { - sysroot = rebase_path("$android_ndk_root/$arm64_android_sysroot_subdir") - } else if (current_cpu == "mips64") { - sysroot = rebase_path("$android_ndk_root/$mips64_android_sysroot_subdir") - } else { - sysroot = "" - } + if (current_cpu == "x86") { + sysroot = rebase_path("$android_ndk_root/$x86_android_sysroot_subdir") + } else if (current_cpu == "arm") { + sysroot = rebase_path("$android_ndk_root/$arm_android_sysroot_subdir") + } else if (current_cpu == "mipsel") { + sysroot = rebase_path("$android_ndk_root/$mips_android_sysroot_subdir") + } else if (current_cpu == "x64") { + sysroot = rebase_path("$android_ndk_root/$x86_64_android_sysroot_subdir") + } else if (current_cpu == "arm64") { + sysroot = rebase_path("$android_ndk_root/$arm64_android_sysroot_subdir") + } else if (current_cpu == "mips64") { + sysroot = rebase_path("$android_ndk_root/$mips64_android_sysroot_subdir") } else { sysroot = "" } diff --git a/build/jar_file_jni_generator.gypi b/build/jar_file_jni_generator.gypi index 6f5d2f1..3d95b28 100644 --- a/build/jar_file_jni_generator.gypi +++ b/build/jar_file_jni_generator.gypi @@ -64,14 +64,4 @@ # This target exports a hard dependency because it generates header # files. 'hard_dependency': 1, - 'conditions': [ - ['android_webview_build==1', { - 'variables': { - 'native_exports%': '--native_exports', - }, - 'dependencies': [ - '<(DEPTH)/build/android/android_exports.gyp:android_exports', - ], - }], - ], } diff --git a/build/jni_generator.gypi b/build/jni_generator.gypi index c2c71e7..7a9e333 100644 --- a/build/jni_generator.gypi +++ b/build/jni_generator.gypi @@ -83,15 +83,5 @@ # This target exports a hard dependency because it generates header # files. 'hard_dependency': 1, - 'conditions': [ - ['android_webview_build==1', { - 'variables': { - 'native_exports%': '--native_exports', - }, - 'dependencies': [ - '<(DEPTH)/build/android/android_exports.gyp:android_exports', - ], - }], - ], } diff --git a/build/module_args/v8.gni b/build/module_args/v8.gni index df6a4a3..db4ee4e 100644 --- a/build/module_args/v8.gni +++ b/build/module_args/v8.gni @@ -9,5 +9,4 @@ if (is_android) { # TODO(sky): nuke this. Temporary while sorting out http://crbug.com/465456. enable_correct_v8_arch = false -v8_use_external_startup_data = - !((is_android && is_android_webview_build) || is_chromeos || is_win) +v8_use_external_startup_data = !(is_chromeos || is_win) |