diff options
author | peter@chromium.org <peter@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-16 13:52:04 +0000 |
---|---|---|
committer | peter@chromium.org <peter@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-16 13:52:04 +0000 |
commit | c0f76313bfdf49191ec71528809dd1a4b73f42ba (patch) | |
tree | be00ad529cb2b4d7a9cfec9245fbe56e5bcea799 | |
parent | 2713a5228b2612abbd176ae0ae6be1c8311917dc (diff) | |
download | chromium_src-c0f76313bfdf49191ec71528809dd1a4b73f42ba.zip chromium_src-c0f76313bfdf49191ec71528809dd1a4b73f42ba.tar.gz chromium_src-c0f76313bfdf49191ec71528809dd1a4b73f42ba.tar.bz2 |
Remove the dependency on the STRIP env variable for Android
Android builds currently rely on the STRIP environment variable to be available
during build time, rather than just at project generation time. It shouldn't.
BUG=142642
Review URL: https://chromiumcodereview.appspot.com/10832295
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151886 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-x | build/android/envsetup_functions.sh | 1 | ||||
-rw-r--r-- | build/apk_test.gypi | 1 | ||||
-rw-r--r-- | build/common.gypi | 11 | ||||
-rw-r--r-- | content/content_shell.gypi | 2 | ||||
-rwxr-xr-x | testing/android/generate_native_test.py | 16 | ||||
-rw-r--r-- | tools/android/device_stats_monitor/device_stats_monitor.gyp | 2 | ||||
-rw-r--r-- | tools/android/fake_dns/fake_dns.gyp | 2 | ||||
-rw-r--r-- | tools/android/forwarder/forwarder.gyp | 2 |
8 files changed, 26 insertions, 11 deletions
diff --git a/build/android/envsetup_functions.sh b/build/android/envsetup_functions.sh index 128d78f..bf8ca0c 100755 --- a/build/android/envsetup_functions.sh +++ b/build/android/envsetup_functions.sh @@ -54,6 +54,7 @@ common_vars_defines() { # Must be after CHROME_SRC is set. export PATH=$PATH:${CHROME_SRC}/build/android + # TODO(beverloo): Remove these once all consumers updated to --strip-binary. export OBJCOPY=$(echo ${ANDROID_TOOLCHAIN}/*-objcopy) export STRIP=$(echo ${ANDROID_TOOLCHAIN}/*-strip) diff --git a/build/apk_test.gypi b/build/apk_test.gypi index 60e7443..942e286 100644 --- a/build/apk_test.gypi +++ b/build/apk_test.gypi @@ -46,6 +46,7 @@ '">@(input_jars_paths)"', '--output', '<(PRODUCT_DIR)/<(test_suite_name)_apk', + '--strip-binary=<(android_strip)', '--app_abi', '<(android_app_abi)', '--sdk-build=<(sdk_build)', diff --git a/build/common.gypi b/build/common.gypi index c97d85e..c8a521d 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -927,6 +927,9 @@ 'android_ndk_lib': '<(android_ndk_sysroot)/usr/lib', 'android_app_abi%': '<(android_app_abi)', + # Location of the "strip" binary, used by both gyp and scripts. + 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)', + # Provides an absolute path to PRODUCT_DIR (e.g. out/Release). Used # to specify the output directory for Ant in the Android build. 'ant_build_out': '`cd <(PRODUCT_DIR) && pwd -P`', @@ -2575,7 +2578,7 @@ 'libraries': [ '-l<(android_stlport_library)', # Manually link the libgcc.a that the cross compiler uses. - '<!(${ANDROID_TOOLCHAIN}/*-gcc -print-libgcc-file-name)', + '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)', '-lc', '-ldl', '-lstdc++', @@ -3327,9 +3330,9 @@ # Hardcode the compiler names in the Makefile so that # it won't depend on the environment at make time. 'make_global_settings': [ - ['CC', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${ANDROID_TOOLCHAIN}/*-gcc)'], - ['CXX', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${ANDROID_TOOLCHAIN}/*-g++)'], - ['LINK', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${ANDROID_TOOLCHAIN}/*-gcc)'], + ['CC', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <(android_toolchain)/*-gcc)'], + ['CXX', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <(android_toolchain)/*-g++)'], + ['LINK', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <(android_toolchain)/*-gcc)'], ['CC.host', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <!(which gcc))'], ['CXX.host', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <!(which g++))'], ['LINK.host', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <!(which g++))'], diff --git a/content/content_shell.gypi b/content/content_shell.gypi index 2fe401d..ec5be71 100644 --- a/content/content_shell.gypi +++ b/content/content_shell.gypi @@ -615,7 +615,7 @@ 'inputs': ['<(SHARED_LIB_DIR)/libcontent_shell_content_view.so'], 'outputs': ['<(PRODUCT_DIR)/content_shell/libs/<(android_app_abi)/libcontent_shell_content_view.so'], 'action': [ - '<!(/bin/echo -n $STRIP)', + '<(android_strip)', '--strip-unneeded', # All symbols not needed for relocation. '<@(_inputs)', '-o', diff --git a/testing/android/generate_native_test.py b/testing/android/generate_native_test.py index c100380..aff4f70 100755 --- a/testing/android/generate_native_test.py +++ b/testing/android/generate_native_test.py @@ -52,9 +52,11 @@ class NativeTestApkGenerator(object): 'native_test_apk.xml', 'res/values/strings.xml'] - def __init__(self, native_library, jars, output_directory, target_abi): + def __init__(self, native_library, jars, strip_binary, output_directory, + target_abi): self._native_library = native_library self._jars = jars + self._strip_binary = strip_binary self._output_directory = os.path.abspath(output_directory) self._target_abi = target_abi self._root_name = None @@ -116,9 +118,9 @@ class NativeTestApkGenerator(object): os.makedirs(destdir) dest = os.path.join(destdir, os.path.basename(self._native_library)) logging.warn('strip %s --> %s', self._native_library, dest) - strip = os.environ['STRIP'] cmd_helper.RunCmd( - [strip, '--strip-unneeded', self._native_library, '-o', dest]) + [self._strip_binary, '--strip-unneeded', self._native_library, '-o', + dest]) if self._jars: destdir = os.path.join(self._output_directory, 'java/libs') if not os.path.exists(destdir): @@ -180,6 +182,8 @@ def main(argv): help='Output directory for generated files.') parser.add_option('--app_abi', default='armeabi', help='ABI for native shared library') + parser.add_option('--strip-binary', + help='Binary to use for stripping the native libraries.') parser.add_option('--sdk-build', type='int', default=1, help='Unless set to 0, build the generated apk with ant. ' 'Otherwise assume compiling within the Android ' @@ -198,6 +202,11 @@ def main(argv): if options.verbose: logging.basicConfig(level=logging.DEBUG, format=' %(message)s') + if not options.strip_binary: + options.strip_binary = os.getenv('STRIP') + if not options.strip_binary: + raise Exception('No tool for stripping the libraries has been supplied') + # Remove all quotes from the jars string jar_list = [] if options.jars: @@ -205,6 +214,7 @@ def main(argv): ntag = NativeTestApkGenerator(native_library=options.native_library, jars=jar_list, + strip_binary=options.strip_binary, output_directory=options.output, target_abi=options.app_abi) ntag.CreateBundle(options.sdk_build) diff --git a/tools/android/device_stats_monitor/device_stats_monitor.gyp b/tools/android/device_stats_monitor/device_stats_monitor.gyp index 3f422f9..f9bd9e8 100644 --- a/tools/android/device_stats_monitor/device_stats_monitor.gyp +++ b/tools/android/device_stats_monitor/device_stats_monitor.gyp @@ -16,7 +16,7 @@ 'inputs': ['<(PRODUCT_DIR)/device_stats_monitor_symbols'], 'outputs': ['<(PRODUCT_DIR)/device_stats_monitor'], 'action': [ - '<!(/bin/echo -n $STRIP)', + '<(android_strip)', '--strip-unneeded', '<@(_inputs)', '-o', diff --git a/tools/android/fake_dns/fake_dns.gyp b/tools/android/fake_dns/fake_dns.gyp index 7b685a1..0edacfa 100644 --- a/tools/android/fake_dns/fake_dns.gyp +++ b/tools/android/fake_dns/fake_dns.gyp @@ -16,7 +16,7 @@ 'inputs': ['<(PRODUCT_DIR)/fake_dns_symbols'], 'outputs': ['<(PRODUCT_DIR)/fake_dns'], 'action': [ - '<!(/bin/echo -n $STRIP)', + '<(android_strip)', '--strip-unneeded', '<@(_inputs)', '-o', diff --git a/tools/android/forwarder/forwarder.gyp b/tools/android/forwarder/forwarder.gyp index 971230c..1df518b 100644 --- a/tools/android/forwarder/forwarder.gyp +++ b/tools/android/forwarder/forwarder.gyp @@ -16,7 +16,7 @@ 'inputs': ['<(PRODUCT_DIR)/forwarder_symbols'], 'outputs': ['<(PRODUCT_DIR)/forwarder'], 'action': [ - '<!(/bin/echo -n $STRIP)', + '<(android_strip)', '--strip-unneeded', '<@(_inputs)', '-o', |