diff options
author | digit@chromium.org <digit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-15 20:34:29 +0000 |
---|---|---|
committer | digit@chromium.org <digit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-15 20:34:29 +0000 |
commit | 8f773620cac4539d56c1dc4f0c09076ffefb5bc9 (patch) | |
tree | a5b8999877e325295136f00e07ec82fb57f45958 /build/android/envsetup.sh | |
parent | df630986834eb937ea75be5a62b9b9eee6c8ca32 (diff) | |
download | chromium_src-8f773620cac4539d56c1dc4f0c09076ffefb5bc9.zip chromium_src-8f773620cac4539d56c1dc4f0c09076ffefb5bc9.tar.gz chromium_src-8f773620cac4539d56c1dc4f0c09076ffefb5bc9.tar.bz2 |
android: Print error when trying to build on 32-bit host.
This patch changes build/android/envsetup.sh to detect that the user
is running on a 32-bit host system, and print an error message
in this case, since a full build will fail (linker runs out of memory,
because the generated files are too large).
This can be overriden with the new --try-32 flag, in case someone
really wants to try a build. This would only be useful if one
needs to rebuild a "small" target, not do a complete build.
BUG=
Review URL: https://chromiumcodereview.appspot.com/11366243
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168009 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/android/envsetup.sh')
-rwxr-xr-x | build/android/envsetup.sh | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/build/android/envsetup.sh b/build/android/envsetup.sh index 9d1b7e6..cdde0ce 100755 --- a/build/android/envsetup.sh +++ b/build/android/envsetup.sh @@ -27,14 +27,39 @@ if [[ "${ANDROID_SDK_BUILD}" -eq 1 ]]; then echo "Using SDK build" fi +# Get host architecture, and abort if it is 32-bit, unless --try-32 +# is also used. +host_arch=$(uname -m) +case "${host_arch}" in + x86_64) # pass + ;; + i?86) + if [[ -z "${try_32bit_host_build}" ]]; then + echo "ERROR: Android build requires a 64-bit host build machine." + echo "If you really want to try it on this machine, use the \ +--try-32bit-host flag." + echo "Be warned that this may fail horribly at link time, due \ +very large binaries." + return 1 + else + echo "WARNING: 32-bit host build enabled. Here be dragons!" + host_arch=x86 + fi + ;; + *) + echo "ERROR: Unsupported host architecture (${host_arch})." + echo "Try running this script on a Linux/x86_64 machine instead." + return 1 +esac + host_os=$(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/') case "${host_os}" in "linux") - toolchain_dir="linux-x86_64" + toolchain_dir="linux-${host_arch}" ;; "mac") - toolchain_dir="darwin-x86" + toolchain_dir="darwin-${host_arch}" ;; *) echo "Host platform ${host_os} is not supported" >& 2 |