- Revision
- 119077
- Author
- pe...@chromium.org
- Date
- 2012-05-31 02:22:45 -0700 (Thu, 31 May 2012)
Log Message
[Chromium] Automatically install 64-bit linker for Android
https://bugs.webkit.org/show_bug.cgi?id=79780
Reviewed by Adam Barth.
Source/WebKit/chromium:
Change the Android-specific dependencies to inherit their revision from
Chromium's DEPS file, like many other dependencies do, solving the
versioning problem that we're running in to right now. These are listed
in Chromium's main DEPS file starting Chromium r139529.
* DEPS:
Tools:
Change the update-webkit-chromium script to check whether the 64-bit
linker needs to be installed as part of the update process. The actual
code for doing these checks and "installing" it has been added to the
webkitdirs.pm script.
The linker itself is part of the third_party/aosp repository, which
will be pulled in through the DEPS change.
* Scripts/update-webkit-chromium:
* Scripts/webkitdirs.pm:
(chromiumInstall64BitAndroidLinkerIfNeeded):
(chromiumReplaceAndroidLinkerIfNeeded):
Modified Paths
Diff
Modified: trunk/Source/WebKit/chromium/ChangeLog (119076 => 119077)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-05-31 09:02:02 UTC (rev 119076)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-05-31 09:22:45 UTC (rev 119077)
@@ -1,3 +1,17 @@
+2012-05-30 Peter Beverloo <pe...@chromium.org>
+
+ [Chromium] Automatically install 64-bit linker for Android
+ https://bugs.webkit.org/show_bug.cgi?id=79780
+
+ Reviewed by Adam Barth.
+
+ Change the Android-specific dependencies to inherit their revision from
+ Chromium's DEPS file, like many other dependencies do, solving the
+ versioning problem that we're running in to right now. These are listed
+ in Chromium's main DEPS file starting Chromium r139529.
+
+ * DEPS:
+
2012-05-31 Yoshifumi Inoue <yo...@chromium.org>
Build fix for Chromium Linux (Tests) after r119073.
Modified: trunk/Source/WebKit/chromium/DEPS (119076 => 119077)
--- trunk/Source/WebKit/chromium/DEPS 2012-05-31 09:02:02 UTC (rev 119076)
+++ trunk/Source/WebKit/chromium/DEPS 2012-05-31 09:22:45 UTC (rev 119077)
@@ -167,10 +167,12 @@
From('chromium_deps', 'src/third_party/openssl'),
},
'android': {
+ 'tools/android':
+ Var('chromium_svn') + '/tools/android@' + Var('chromium_rev'),
'third_party/freetype':
- 'https://git.chromium.org/chromium/src/third_party/freetype.git',
- 'tools/android':
- Var('chromium_svn')+'/tools/android@'+Var('chromium_rev'),
+ From('chromium_deps', 'src/third_party/freetype'),
+ 'third_party/aosp':
+ From('chromium_deps', 'src/third_party/aosp'),
},
}
Modified: trunk/Tools/ChangeLog (119076 => 119077)
--- trunk/Tools/ChangeLog 2012-05-31 09:02:02 UTC (rev 119076)
+++ trunk/Tools/ChangeLog 2012-05-31 09:22:45 UTC (rev 119077)
@@ -1,3 +1,23 @@
+2012-05-30 Peter Beverloo <pe...@chromium.org>
+
+ [Chromium] Automatically install 64-bit linker for Android
+ https://bugs.webkit.org/show_bug.cgi?id=79780
+
+ Reviewed by Adam Barth.
+
+ Change the update-webkit-chromium script to check whether the 64-bit
+ linker needs to be installed as part of the update process. The actual
+ code for doing these checks and "installing" it has been added to the
+ webkitdirs.pm script.
+
+ The linker itself is part of the third_party/aosp repository, which
+ will be pulled in through the DEPS change.
+
+ * Scripts/update-webkit-chromium:
+ * Scripts/webkitdirs.pm:
+ (chromiumInstall64BitAndroidLinkerIfNeeded):
+ (chromiumReplaceAndroidLinkerIfNeeded):
+
2012-05-30 Stephanie Lewis <sle...@apple.com>
https://bugs.webkit.org/show_bug.cgi?id=87803
Modified: trunk/Tools/Scripts/update-webkit-chromium (119076 => 119077)
--- trunk/Tools/Scripts/update-webkit-chromium 2012-05-31 09:02:02 UTC (rev 119076)
+++ trunk/Tools/Scripts/update-webkit-chromium 2012-05-31 09:22:45 UTC (rev 119077)
@@ -55,7 +55,7 @@
# If .gclient configuration file doesn't exist, create it.
print "Configuring gclient...\n";
system($gclientPath,
- "config",
+ "config",
"--spec=solutions=[{'name':'./','url':None}]") == 0 or die $!;
}
@@ -72,7 +72,13 @@
die "Couldn't extract the Android NDK." if $result;
}
- $ENV{ANDROID_NDK_ROOT} = sourceDir() . "/Source/WebKit/chromium/android-ndk-r7b";
+ my $androidNdkRoot = sourceDir() . "/Source/WebKit/chromium/android-ndk-r7b";
+
+ # Attempt to replace the NDK's linker with a 64-bit version if the host
+ # OS is Linux. This will significantly speed up link times.
+ chromiumInstall64BitAndroidLinkerIfNeeded($androidNdkRoot) if isLinux();
+
+ $ENV{ANDROID_NDK_ROOT} = $androidNdkRoot;
$ENV{WEBKIT_ANDROID_BUILD} = 1;
}
Modified: trunk/Tools/Scripts/webkitdirs.pm (119076 => 119077)
--- trunk/Tools/Scripts/webkitdirs.pm 2012-05-31 09:02:02 UTC (rev 119076)
+++ trunk/Tools/Scripts/webkitdirs.pm 2012-05-31 09:22:45 UTC (rev 119077)
@@ -2494,6 +2494,49 @@
return $result;
}
+sub chromiumInstall64BitAndroidLinkerIfNeeded
+{
+ my ($androidNdkRoot) = @_;
+
+ # Resolve the toolchain version through glob().
+ my $linkerDirPrefix = glob("$androidNdkRoot/toolchains/arm-linux-androideabi-*/prebuilt/linux-x86");
+
+ my $linkerDirname1 = "$linkerDirPrefix/bin";
+ my $linkerBasename1 = "arm-linux-androideabi-ld";
+ my $linkerDirname2 = "$linkerDirPrefix/arm-linux-androideabi/bin";
+ my $linkerBasename2 = "ld";
+ my $newLinker = "arm-linux-androideabi-ld.e4df3e0a5bb640ccfa2f30ee67fe9b3146b152d6";
+
+ # Do not continue if the new linker is not (yet) available.
+ if (! -e "third_party/aosp/$newLinker") {
+ return;
+ }
+
+ chromiumReplaceAndroidLinkerIfNeeded($linkerDirname1, $linkerBasename1, $newLinker);
+ chromiumReplaceAndroidLinkerIfNeeded($linkerDirname2, $linkerBasename2, $newLinker);
+}
+
+sub chromiumReplaceAndroidLinkerIfNeeded
+{
+ my ($linkerDirname, $linkerBasename, $newLinker) = @_;
+
+ # If the destination directory does not exist, or the linker has already
+ # been installed, replacing it will not be necessary.
+ if (! -d "$linkerDirname" || -e "$linkerDirname/$newLinker") {
+ return;
+ }
+
+ print "Installing 64-bit Android linker in $linkerDirname..\n";
+ system("cp", "third_party/aosp/$newLinker", "$linkerDirname/$newLinker");
+ system("mv", "$linkerDirname/$linkerBasename", "$linkerDirname/$linkerBasename.orig");
+ system("ln", "-s", "$newLinker", "$linkerDirname/$linkerBasename");
+
+ if (! -e "$linkerDirname/$newLinker") {
+ print "Unable to copy the linker.\n";
+ exit 1;
+ }
+}
+
sub appleApplicationSupportPath
{
open INSTALL_DIR, "</proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Apple\ Inc./Apple\ Application\ Support/InstallDir";