Revert 147986 - [Android] Add remaining build/common.gypi changes from...

Revert 147986 - [Android] Add remaining build/common.gypi changes from downstream and strip NOTIMPLEMENTED()s from official builds.

Includes:
1) Allowing overridding of android_ndk_sysroot (addition of "%" in
variable name).
2) Disable NOTIMPLEMENTED output for official builds (see base/logging.h)
3) Add clang build configurations
4) Remove unnecessary cflags from regular build.
5) Include crtbegin_so.o and crtend_so.so for _type=="loadable_module"
which is needed for ppapi_tests.

BUG=137569


Review URL: https://chromiumcodereview.appspot.com/10808042

TBR=yfriedman@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10816039

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148147 0039d316-1c4b-4281-b951-d872f2087c98
parent 94f48cb8
......@@ -949,13 +949,9 @@ inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
// 5 -- LOG(ERROR) at runtime, only once per call-site
#ifndef NOTIMPLEMENTED_POLICY
#if defined(OS_ANDROID) && defined(OFFICIAL_BUILD)
#define NOTIMPLEMENTED_POLICY 0
#else
// Select default policy: LOG(ERROR)
#define NOTIMPLEMENTED_POLICY 4
#endif
#endif
#if defined(COMPILER_GCC)
// On Linux, with GCC, we can use __PRETTY_FUNCTION__ to get the demangled name
......
......@@ -910,7 +910,7 @@
'android_build_type%': 0,
},
'android_ndk_root%': '<(android_ndk_root)',
'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-9/arch-<(target_arch)',
'android_ndk_sysroot': '<(android_ndk_root)/platforms/android-9/arch-<(target_arch)',
'android_build_type%': '<(android_build_type)',
'android_app_abi%': '<(android_app_abi)',
},
......@@ -976,10 +976,12 @@
# Always use the system zlib.
'use_system_zlib%': 1,
# Configure crash reporting and build options based on release type.
'conditions': [
# Determine whether or not to use breakpad crash reporting for native
# code. Java code stacktraces will be collected by GoogleFeedback when
# chrome is installed by either market or bazaar where the installer
# package is automatically set to AndroidFeedback.
['buildtype=="Official"', {
# Only report crash dumps for Official builds.
'linux_breakpad%': 1,
}, {
'linux_breakpad%': 0,
......@@ -2196,27 +2198,13 @@
'cflags': [
'-march=armv7-a',
'-mtune=cortex-a8',
'-mfloat-abi=<(arm_float_abi)',
],
'conditions': [
['arm_neon==1', {
'cflags': [ '-mfpu=neon', ],
}, {
'cflags': [ '-mfpu=<(arm_fpu)', ],
}],
['clang==1', {
'cflags': [ '-mfloat-abi=soft', ],
'cflags!': [
# -mfpu handling in Clang is broken.
'-mfpu=neon',
'-mfpu=<(arm_fpu)',
# Clang does not support the following options.
'-mthumb-interwork',
'-finline-limit=64',
'-fno-tree-sra',
'-Wno-psabi',
],
}, {
'cflags': [ '-mfloat-abi=softfp', ],
}]
],
}],
......@@ -2234,13 +2222,6 @@
'-fno-tree-sra',
'-Wno-psabi',
],
'cflags_cc': [
# TODO(beverloo): WebKit warns about using the "nullptr"
# identifier in NullPtr.h, which actually is valid usage.
# We should remove this flag once we know why the warning
# suddenly shows up on JellyBean. (crbug/138166)
'-Wno-c++0x-compat',
],
# Android now supports .relro sections properly.
# NOTE: While these flags enable the generation of .relro
# sections, the generated libraries can still be loaded on
......@@ -2542,6 +2523,7 @@
'-pthread', # Not supported by Android toolchain.
],
'cflags': [
'-U__linux__', # Don't allow toolchain to claim -D__linux__
'-ffunction-sections',
'-funwind-tables',
'-g',
......@@ -2549,13 +2531,19 @@
'-fno-short-enums',
'-finline-limit=64',
'-Wa,--noexecstack',
'-Wno-error=non-virtual-dtor', # TODO(michaelbai): Fix warnings.
'<@(release_extra_cflags)',
# Note: This include is in cflags to ensure that it comes after
# all of the includes.
'-I<(android_ndk_include)',
],
'defines': [
'ANDROID',
'__GNU_SOURCE=1', # Necessary for clone()
'USE_STLPORT=1',
'_STLP_USE_PTR_SPECIALIZATIONS=1',
'HAVE_SYS_UIO_H',
'ANDROID_BINSIZE_HACK', # Enable temporary hacks to reduce binsize.
],
'ldflags!': [
'-pthread', # Not supported by Android toolchain.
......@@ -2579,34 +2567,9 @@
['android_upstream_bringup==1', {
'defines': ['ANDROID_UPSTREAM_BRINGUP=1',],
}],
['asan==1', {
'ldflags!': [
# On Android, we link ASan runtime explicitly and
# don't need -faddress-sanitizer in link flags.
'-faddress-sanitizer',
],
'libraries': [
'<(android_lib)/libasan_preload.so',
],
'cflags': [
# Clang relies on -Wl,--gc-sections removing unreachable code.
# ASan instrumentation for globals inhibits this and results
# in a library with unresolvable relocations.
# TODO(eugenis): find a way to reenable this.
'-mllvm -asan-globals=0',
# Asan uses a zero-based sandbox on Android. The following
# option can be removed once Clang is updated past r157318
'-mllvm -asan-mapping-offset-log=0',
],
}],
['android_build_type==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)',
'HAVE_OFF64_T',
],
'ldflags': [
'--sysroot=<(android_ndk_sysroot)',
......@@ -2677,22 +2640,8 @@
# Do not add any libraries after this!
'<(android_ndk_lib)/crtend_android.o',
],
'conditions': [
['asan==1', {
'libraries': [
'<(android_static_lib)/libasan_intermediates/libasan.a',
],
'cflags': [
'-fPIE',
],
'ldflags': [
'-Wl,-u,__asan_preinit',
'-pie',
],
}],
],
}],
['_type=="shared_library" or _type=="loadable_module"', {
['_type=="shared_library"', {
'ldflags': [
'-Wl,-shared,-Bsymbolic',
# crtbegin_so.o should be the last item in ldflags.
......@@ -3327,17 +3276,6 @@
['OS=="android" and "<(GENERATOR)"!="ninja"', {
# Hardcode the compiler names in the Makefile so that
# it won't depend on the environment at make time.
'conditions': [
['clang==1', {
'make_global_settings': [
['CC', '<!(/bin/echo -n $CROSS_CC)'],
['CXX', '<!(/bin/echo -n $CROSS_CXX)'],
['LINK', '<!(/bin/echo -n $CROSS_LINK)'],
['CC.host', '<!(/bin/echo -n $HOST_CC)'],
['CXX.host', '<!(/bin/echo -n $HOST_CXX)'],
['LINK.host', '<!(/bin/echo -n $HOST_LINK)'],
],
}, {
'make_global_settings': [
['CC', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${ANDROID_TOOLCHAIN}/*-gcc)'],
['CXX', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${ANDROID_TOOLCHAIN}/*-g++)'],
......@@ -3346,9 +3284,6 @@
['CXX.host', '<!(which g++)'],
['LINK.host', '<!(which g++)'],
],
},
],
],
}],
],
'xcode_settings': {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment