summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsimonb <simonb@chromium.org>2014-10-06 07:36:01 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-06 14:36:16 +0000
commit4749549c06525071692f777fc6a1fa5a9ad7f877 (patch)
treeb7f85a8b65dc33d69f48ded25354b07896b999f7
parenta5d32a2fac874ad135c75361dff17fa00813c76e (diff)
downloadchromium_src-4749549c06525071692f777fc6a1fa5a9ad7f877.zip
chromium_src-4749549c06525071692f777fc6a1fa5a9ad7f877.tar.gz
chromium_src-4749549c06525071692f777fc6a1fa5a9ad7f877.tar.bz2
Move version branding to before relocation packing.
Objcopy knows nothing about the dynamic tags that point to packed relocation data. If objcopy is run after relocation packing, and if it moves the .android.rel.dyn section, these dynamic tags become invalid and the crazy linker cannot load the library: E/chromium_android_linker( 9584): Open: Could not open libchrome.2180.0.so: Bad packed relocations ident, expected APR1 or APA1 Currently, version branding happens at the end of building libchrome.so, and after relocation packing. Re-order so that relocation packing again comes after all other strip and/or objcopy operations. BUG=417510 Review URL: https://codereview.chromium.org/621263003 Cr-Commit-Position: refs/heads/master@{#298236}
-rwxr-xr-xbuild/android/gyp/insert_chromium_version.py4
-rw-r--r--build/android/insert_chromium_version.gypi4
-rw-r--r--build/java_apk.gypi32
3 files changed, 20 insertions, 20 deletions
diff --git a/build/android/gyp/insert_chromium_version.py b/build/android/gyp/insert_chromium_version.py
index f858225..171f9d4 100755
--- a/build/android/gyp/insert_chromium_version.py
+++ b/build/android/gyp/insert_chromium_version.py
@@ -38,7 +38,7 @@ def main(args):
parser.add_option('--android-objcopy',
help='Path to the toolchain\'s objcopy binary')
- parser.add_option('--libraries-source-dir',
+ parser.add_option('--stripped-libraries-dir',
help='Directory of native libraries')
parser.add_option('--libraries',
help='List of libraries')
@@ -50,7 +50,7 @@ def main(args):
libraries = build_utils.ParseGypList(options.libraries)
for library in libraries:
- library_path = os.path.join(options.libraries_source_dir, library)
+ library_path = os.path.join(options.stripped_libraries_dir, library)
InsertChromiumVersion(options.android_objcopy,
library_path,
diff --git a/build/android/insert_chromium_version.gypi b/build/android/insert_chromium_version.gypi
index 158a227..a6ff908 100644
--- a/build/android/insert_chromium_version.gypi
+++ b/build/android/insert_chromium_version.gypi
@@ -11,7 +11,7 @@
# 'actions': [
# 'variables': {
# 'ordered_libraries_file': 'file generated by write_ordered_libraries'
-# 'libraries_source_dir': 'the directory contains native libraries'
+# 'stripped_libraries_dir': 'the directory contains native libraries'
# 'input_paths': 'files to be added to the list of inputs'
# 'stamp': 'file to touch when the action is complete'
# 'version_string': 'chromium version string to be inserted'
@@ -37,7 +37,7 @@
'action': [
'python', '<(DEPTH)/build/android/gyp/insert_chromium_version.py',
'--android-objcopy=<(android_objcopy)',
- '--libraries-source-dir=<(libraries_source_dir)',
+ '--stripped-libraries-dir=<(stripped_libraries_dir)',
'--libraries=@FileArg(<(ordered_libraries_file):libraries)',
'--version-string=<(version_string)',
'--stamp=<(stamp)',
diff --git a/build/java_apk.gypi b/build/java_apk.gypi
index fbc5a3a..1b90a1b 100644
--- a/build/java_apk.gypi
+++ b/build/java_apk.gypi
@@ -342,6 +342,19 @@
'includes': ['../build/android/strip_native_libraries.gypi'],
},
{
+ 'action_name': 'insert_chromium_version',
+ 'variables': {
+ 'ordered_libraries_file%': '<(ordered_libraries_file)',
+ 'stripped_libraries_dir%': '<(stripped_libraries_dir)',
+ 'version_string': '<(native_lib_version_name)',
+ 'input_paths': [
+ '<(strip_stamp)',
+ ],
+ 'stamp': '<(version_stamp)'
+ },
+ 'includes': ['../build/android/insert_chromium_version.gypi'],
+ },
+ {
'action_name': 'pack_arm_relocations',
'variables': {
'conditions': [
@@ -358,26 +371,13 @@
'stripped_libraries_dir%': '<(stripped_libraries_dir)',
'packed_libraries_dir': '<(libraries_source_dir)',
'input_paths': [
- '<(strip_stamp)',
+ '<(version_stamp)'
],
'stamp': '<(pack_arm_relocations_stamp)',
},
'includes': ['../build/android/pack_arm_relocations.gypi'],
},
{
- 'action_name': 'insert_chromium_version',
- 'variables': {
- 'ordered_libraries_file%': '<(ordered_libraries_file)',
- 'libraries_source_dir%': '<(libraries_source_dir)',
- 'version_string': '<(native_lib_version_name)',
- 'input_paths': [
- '<(pack_arm_relocations_stamp)',
- ],
- 'stamp': '<(version_stamp)'
- },
- 'includes': ['../build/android/insert_chromium_version.gypi'],
- },
- {
'variables': {
'input_libraries': [
'<@(additional_bundled_libs)',
@@ -476,7 +476,7 @@
'inputs': [
'<(ordered_libraries_file)',
'<(strip_additional_stamp)',
- '<(version_stamp)',
+ '<(pack_arm_relocations_stamp)',
],
'input_apk_path': '<(unsigned_apk_path)',
'output_apk_path': '<(unsigned_standalone_apk_path)',
@@ -493,7 +493,7 @@
'libraries_source_dir': '<(apk_package_native_libs_dir)/<(android_app_abi)',
'package_input_paths': [
'<(strip_additional_stamp)',
- '<(version_stamp)',
+ '<(pack_arm_relocations_stamp)',
],
},
}],