Enable ARM/linux cross compile to use clang.

BUG=395832
NOTRY=true

Review URL: https://codereview.chromium.org/408393002

git-svn-id: http://src.chromium.org/svn/trunk/src/build@290261 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
sbc@chromium.org 2014-08-18 15:41:07 +00:00
Родитель accf653d46
Коммит 5ce31b993d
2 изменённых файлов: 53 добавлений и 10 удалений

Просмотреть файл

@ -3708,6 +3708,8 @@
['target_arch=="arm"', {
'target_conditions': [
['_toolset=="target"', {
'conditions': [
['clang==0', {
'cflags_cc': [
# The codesourcery arm-2009q3 toolchain warns at that the ABI
# has changed whenever it encounters a varargs function. This
@ -3715,12 +3717,30 @@
# clutter legitimate warnings.
'-Wno-abi',
],
'conditions': [
}],
['clang==1 and arm_arch!=""', {
'cflags': [
'-target arm-linux-gnueabihf',
# TODO(sbc): Remove this once the warning in libvpx is fixed:
# https://code.google.com/p/webm/issues/detail?id=829
'-Wno-absolute-value',
],
'ldflags': [
'-target arm-linux-gnueabihf',
],
}],
['arm_arch!=""', {
'cflags': [
'-march=<(arm_arch)',
],
}],
['clang==1', {
'cflags': [
# We need to disable clang's builtin assember as it can't
# handle a several of asm files.
'-no-integrated-as',
],
}],
['arm_tune!=""', {
'cflags': [
'-mtune=<(arm_tune)',

Просмотреть файл

@ -25,6 +25,10 @@ Steps to rebuild the arm sysroot image:
nativeclient-archive2/toolchain/$NACL_REV/sysroot-arm-trusted.tgz
"""
# TODO(sbc): merge this script into:
# chrome/installer/linux/sysroot_scripts/install-debian.wheezy.sysroot.py
import hashlib
import os
import shutil
import subprocess
@ -33,9 +37,23 @@ import sys
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
URL_PREFIX = 'https://storage.googleapis.com'
URL_PATH = 'nativeclient-archive2/toolchain'
REVISION = 13035
TARBALL = 'sysroot-arm-trusted.tgz'
URL_PATH = 'chrome-linux-sysroot/toolchain'
REVISION = 285950
TARBALL = 'debian_wheezy_arm_sysroot.tgz'
TARBALL_SHA1SUM = 'fc2f54db168887c5190c4c6686c869bedf668b4e'
def get_sha1(filename):
sha1 = hashlib.sha1()
with open(filename, 'rb') as f:
while True:
# Read in 1mb chunks, so it doesn't all have to be loaded into memory.
chunk = f.read(1024*1024)
if not chunk:
break
sha1.update(chunk)
return sha1.hexdigest()
def main(args):
if '--linux-only' in args:
@ -70,6 +88,11 @@ def main(args):
else:
curl.append('--silent')
subprocess.check_call(curl)
sha1sum = get_sha1(tarball)
if sha1sum != TARBALL_SHA1SUM:
print 'Tarball sha1sum is wrong.'
print 'Expected %s, actual: %s' % (TARBALL_SHA1SUM, sha1sum)
return 1
subprocess.check_call(['tar', 'xf', tarball, '-C', sysroot])
os.remove(tarball)