Desktop Chrome OS: Build with precise sysroot
Build and link against the Ubuntu Precise amd64 sysroot on Desktop Chrome OS instead of always using the system libraries. BUG=638394 Committed: https://crrev.com/c575bbcd130b38994e36b0a97bfe5ceea954a643 Review-Url: https://codereview.chromium.org/2272273002 Cr-Original-Commit-Position: refs/heads/master@{#414564} Cr-Commit-Position: refs/heads/master@{#414862}
This commit is contained in:

committed by
Commit bot

parent
d3b1599cda
commit
ec70bbffc5
1
.gitignore
vendored
1
.gitignore
vendored
@ -74,6 +74,7 @@ vs-chromium-project.txt
|
||||
/build/x64/
|
||||
/build/linux/bin/eu-strip
|
||||
/build/linux/debian_*-sysroot/
|
||||
/build/linux/ubuntu_*-sysroot/
|
||||
/build/mac_files
|
||||
/buildtools
|
||||
# The Chrome OS build creates a /c symlink due to http://crbug.com/54866.
|
||||
|
@ -44,22 +44,31 @@ if (is_linux && target_sysroot_dir != "") {
|
||||
} else {
|
||||
sysroot = ""
|
||||
}
|
||||
} else if (is_linux && !is_chromeos && use_sysroot) {
|
||||
} else if (is_linux && use_sysroot) {
|
||||
# By default build against a sysroot image downloaded from Cloud Storage
|
||||
# during gclient runhooks.
|
||||
if (current_cpu == "x64") {
|
||||
sysroot = "//build/linux/debian_wheezy_amd64-sysroot"
|
||||
} else if (current_cpu == "x86") {
|
||||
sysroot = "//build/linux/debian_wheezy_i386-sysroot"
|
||||
} else if (current_cpu == "mipsel") {
|
||||
sysroot = "//build/linux/debian_wheezy_mips-sysroot"
|
||||
} else if (current_cpu == "arm") {
|
||||
sysroot = "//build/linux/debian_wheezy_arm-sysroot"
|
||||
} else if (current_cpu == "arm64") {
|
||||
sysroot = "//build/linux/debian_jessie_arm64-sysroot"
|
||||
if (is_chromeos) {
|
||||
# Regular ChromeOS builds use custom sysroots, but desktop ChromeOS (where
|
||||
# we're building linux desktop binaries but using the ChromeOS UI and
|
||||
# functionality where possible) needs to run on the buliders, which are
|
||||
# running precise. The precise build has a different set of dependencies
|
||||
# from the wheezy build, so we cannot use the wheezy sysroot.
|
||||
sysroot = "//build/linux/ubuntu_precise_amd64-sysroot"
|
||||
} else {
|
||||
# Any other builds don't use a sysroot.
|
||||
sysroot = ""
|
||||
if (current_cpu == "x64") {
|
||||
sysroot = "//build/linux/debian_wheezy_amd64-sysroot"
|
||||
} else if (current_cpu == "x86") {
|
||||
sysroot = "//build/linux/debian_wheezy_i386-sysroot"
|
||||
} else if (current_cpu == "mipsel") {
|
||||
sysroot = "//build/linux/debian_wheezy_mips-sysroot"
|
||||
} else if (current_cpu == "arm") {
|
||||
sysroot = "//build/linux/debian_wheezy_arm-sysroot"
|
||||
} else if (current_cpu == "arm64") {
|
||||
sysroot = "//build/linux/debian_jessie_arm64-sysroot"
|
||||
} else {
|
||||
# Any other builds don't use a sysroot.
|
||||
sysroot = ""
|
||||
}
|
||||
}
|
||||
|
||||
if (sysroot != "") {
|
||||
|
@ -35,26 +35,45 @@ import gyp_environment
|
||||
|
||||
URL_PREFIX = 'https://commondatastorage.googleapis.com'
|
||||
URL_PATH = 'chrome-linux-sysroot/toolchain'
|
||||
REVISION_AMD64 = '24f935a3d8cdfcdfbabd23928a42304b1ffc52ba'
|
||||
REVISION_ARM = '24f935a3d8cdfcdfbabd23928a42304b1ffc52ba'
|
||||
REVISION_ARM64 = '24f935a3d8cdfcdfbabd23928a42304b1ffc52ba'
|
||||
REVISION_I386 = '24f935a3d8cdfcdfbabd23928a42304b1ffc52ba'
|
||||
REVISION_MIPS = '24f935a3d8cdfcdfbabd23928a42304b1ffc52ba'
|
||||
TARBALL_AMD64 = 'debian_wheezy_amd64_sysroot.tgz'
|
||||
TARBALL_ARM = 'debian_wheezy_arm_sysroot.tgz'
|
||||
TARBALL_ARM64 = 'debian_jessie_arm64_sysroot.tgz'
|
||||
TARBALL_I386 = 'debian_wheezy_i386_sysroot.tgz'
|
||||
TARBALL_MIPS = 'debian_wheezy_mips_sysroot.tgz'
|
||||
TARBALL_AMD64_SHA1SUM = 'a7f3df28b02799fbd7675c2ab24f1924c104c0ee'
|
||||
TARBALL_ARM_SHA1SUM = '2df01b8173a363977daf04e176b8c7dba5b0b933'
|
||||
TARBALL_ARM64_SHA1SUM = 'df9270e00c258e6cd80f8172b1bfa39aafc4756f'
|
||||
TARBALL_I386_SHA1SUM = 'e2c7131fa5f711de28c37fd9442e77d32abfb3ff'
|
||||
TARBALL_MIPS_SHA1SUM = '22fe7b45b144691aeb515083025f0fceb131d724'
|
||||
SYSROOT_DIR_AMD64 = 'debian_wheezy_amd64-sysroot'
|
||||
SYSROOT_DIR_ARM = 'debian_wheezy_arm-sysroot'
|
||||
SYSROOT_DIR_ARM64 = 'debian_jessie_arm64-sysroot'
|
||||
SYSROOT_DIR_I386 = 'debian_wheezy_i386-sysroot'
|
||||
SYSROOT_DIR_MIPS = 'debian_wheezy_mips-sysroot'
|
||||
|
||||
SYSROOTS = {
|
||||
('Wheezy', 'amd64'): {
|
||||
'Revision' : '24f935a3d8cdfcdfbabd23928a42304b1ffc52ba',
|
||||
'Tarball' : 'debian_wheezy_amd64_sysroot.tgz',
|
||||
'Sha1Sum' : 'a7f3df28b02799fbd7675c2ab24f1924c104c0ee',
|
||||
'SysrootDir' : 'debian_wheezy_amd64-sysroot'
|
||||
},
|
||||
('Wheezy', 'arm'): {
|
||||
'Revision' : '24f935a3d8cdfcdfbabd23928a42304b1ffc52ba',
|
||||
'Tarball' : 'debian_wheezy_arm_sysroot.tgz',
|
||||
'Sha1Sum' : '2df01b8173a363977daf04e176b8c7dba5b0b933',
|
||||
'SysrootDir' : 'debian_wheezy_arm-sysroot'
|
||||
},
|
||||
('Wheezy', 'i386'): {
|
||||
'Revision' : '24f935a3d8cdfcdfbabd23928a42304b1ffc52ba',
|
||||
'Tarball' : 'debian_wheezy_i386_sysroot.tgz',
|
||||
'Sha1Sum' : 'e2c7131fa5f711de28c37fd9442e77d32abfb3ff',
|
||||
'SysrootDir' : 'debian_wheezy_i386-sysroot'
|
||||
},
|
||||
('Wheezy', 'mips'): {
|
||||
'Revision' : '24f935a3d8cdfcdfbabd23928a42304b1ffc52ba',
|
||||
'Tarball' : 'debian_wheezy_mips_sysroot.tgz',
|
||||
'Sha1Sum' : '22fe7b45b144691aeb515083025f0fceb131d724',
|
||||
'SysrootDir' : 'debian_wheezy_mips-sysroot'
|
||||
},
|
||||
('Jessie', 'arm64'): {
|
||||
'Revision' : '24f935a3d8cdfcdfbabd23928a42304b1ffc52ba',
|
||||
'Tarball' : 'debian_jessie_arm64_sysroot.tgz',
|
||||
'Sha1Sum' : 'df9270e00c258e6cd80f8172b1bfa39aafc4756f',
|
||||
'SysrootDir' : 'debian_jessie_arm64-sysroot'
|
||||
},
|
||||
('Precise', 'amd64'): {
|
||||
'Revision' : '24f935a3d8cdfcdfbabd23928a42304b1ffc52ba',
|
||||
'Tarball' : 'ubuntu_precise_amd64_sysroot.tgz',
|
||||
'Sha1Sum' : '67985675e64e1d3cf6574088f36f89092ae9e86b',
|
||||
'SysrootDir' : 'ubuntu_precise_amd64-sysroot'
|
||||
}
|
||||
}
|
||||
|
||||
valid_archs = ('arm', 'arm64', 'i386', 'amd64', 'mips')
|
||||
|
||||
@ -85,6 +104,8 @@ def DetectHostArch():
|
||||
return 'i386'
|
||||
elif detected_host_arch == 'arm':
|
||||
return 'arm'
|
||||
elif detected_host_arch == 'arm64':
|
||||
return 'arm64'
|
||||
elif detected_host_arch == 'mips':
|
||||
return 'mips'
|
||||
|
||||
@ -122,12 +143,23 @@ def InstallDefaultSysroots():
|
||||
This includes at least the sysroot for host architecture, and the 32-bit
|
||||
sysroot for building the v8 snapshot image. It can also include the cross
|
||||
compile sysroot for ARM/MIPS if cross compiling environment can be detected.
|
||||
|
||||
Another reason we're installing this by default is so that developers can
|
||||
compile and run on our supported platforms without having to worry about
|
||||
flipping things back and forth and whether the sysroots have been downloaded
|
||||
or not.
|
||||
"""
|
||||
host_arch = DetectHostArch()
|
||||
InstallSysroot(host_arch)
|
||||
InstallDefaultSysrootForArch(host_arch)
|
||||
|
||||
if host_arch == 'amd64':
|
||||
InstallSysroot('i386')
|
||||
InstallDefaultSysrootForArch('i386')
|
||||
|
||||
# Desktop Chromium OS builds require the precise sysroot.
|
||||
# TODO(thomasanderson): only download this when the GN arg target_os
|
||||
# == 'chromeos', when the functionality to perform the check becomes
|
||||
# available.
|
||||
InstallSysroot('Precise', 'amd64')
|
||||
|
||||
# Finally, if we can detect a non-standard target_arch such as ARM or
|
||||
# MIPS, then install the sysroot too.
|
||||
@ -135,7 +167,7 @@ def InstallDefaultSysroots():
|
||||
# architecture.
|
||||
target_arch = DetectTargetArch()
|
||||
if target_arch and target_arch not in (host_arch, 'i386'):
|
||||
InstallSysroot(target_arch)
|
||||
InstallDefaultSysrootForArch(target_arch)
|
||||
|
||||
|
||||
def main(args):
|
||||
@ -155,45 +187,37 @@ def main(args):
|
||||
if not options.arch:
|
||||
print 'You much specify either --arch or --running-as-hook'
|
||||
return 1
|
||||
InstallSysroot(options.arch)
|
||||
InstallDefaultSysrootForArch(options.arch)
|
||||
|
||||
return 0
|
||||
|
||||
def InstallDefaultSysrootForArch(target_arch):
|
||||
if target_arch == 'amd64':
|
||||
InstallSysroot('Wheezy', 'amd64')
|
||||
elif target_arch == 'arm':
|
||||
InstallSysroot('Wheezy', 'arm')
|
||||
elif target_arch == 'arm64':
|
||||
InstallSysroot('Jessie', 'arm64')
|
||||
elif target_arch == 'i386':
|
||||
InstallSysroot('Wheezy', 'i386')
|
||||
elif target_arch == 'mips':
|
||||
InstallSysroot('Wheezy', 'mips')
|
||||
else:
|
||||
raise Error('Unknown architecture: %s' % target_arch)
|
||||
|
||||
def InstallSysroot(target_arch):
|
||||
def InstallSysroot(target_platform, target_arch):
|
||||
# The sysroot directory should match the one specified in build/common.gypi.
|
||||
# TODO(thestig) Consider putting this else where to avoid having to recreate
|
||||
# it on every build.
|
||||
linux_dir = os.path.dirname(SCRIPT_DIR)
|
||||
debian_release = 'Wheezy'
|
||||
if target_arch == 'amd64':
|
||||
sysroot = os.path.join(linux_dir, SYSROOT_DIR_AMD64)
|
||||
tarball_filename = TARBALL_AMD64
|
||||
tarball_sha1sum = TARBALL_AMD64_SHA1SUM
|
||||
revision = REVISION_AMD64
|
||||
elif target_arch == 'arm':
|
||||
sysroot = os.path.join(linux_dir, SYSROOT_DIR_ARM)
|
||||
tarball_filename = TARBALL_ARM
|
||||
tarball_sha1sum = TARBALL_ARM_SHA1SUM
|
||||
revision = REVISION_ARM
|
||||
elif target_arch == 'arm64':
|
||||
debian_release = 'Jessie'
|
||||
sysroot = os.path.join(linux_dir, SYSROOT_DIR_ARM64)
|
||||
tarball_filename = TARBALL_ARM64
|
||||
tarball_sha1sum = TARBALL_ARM64_SHA1SUM
|
||||
revision = REVISION_ARM64
|
||||
elif target_arch == 'i386':
|
||||
sysroot = os.path.join(linux_dir, SYSROOT_DIR_I386)
|
||||
tarball_filename = TARBALL_I386
|
||||
tarball_sha1sum = TARBALL_I386_SHA1SUM
|
||||
revision = REVISION_I386
|
||||
elif target_arch == 'mips':
|
||||
sysroot = os.path.join(linux_dir, SYSROOT_DIR_MIPS)
|
||||
tarball_filename = TARBALL_MIPS
|
||||
tarball_sha1sum = TARBALL_MIPS_SHA1SUM
|
||||
revision = REVISION_MIPS
|
||||
else:
|
||||
raise Error('Unknown architecture: %s' % target_arch)
|
||||
|
||||
if (target_platform, target_arch) not in SYSROOTS:
|
||||
raise Error('No sysroot for: %s %s' % (target_platform, target_arch))
|
||||
sysroot_dict = SYSROOTS[(target_platform, target_arch)]
|
||||
revision = sysroot_dict['Revision']
|
||||
tarball_filename = sysroot_dict['Tarball']
|
||||
tarball_sha1sum = sysroot_dict['Sha1Sum']
|
||||
sysroot = os.path.join(linux_dir, sysroot_dict['SysrootDir'])
|
||||
|
||||
url = '%s/%s/%s/%s' % (URL_PREFIX, URL_PATH, revision, tarball_filename)
|
||||
|
||||
@ -202,11 +226,11 @@ def InstallSysroot(target_arch):
|
||||
with open(stamp) as s:
|
||||
if s.read() == url:
|
||||
print 'Debian %s %s root image already up to date: %s' % \
|
||||
(debian_release, target_arch, sysroot)
|
||||
(target_platform, target_arch, sysroot)
|
||||
return
|
||||
|
||||
print 'Installing Debian %s %s root image: %s' % \
|
||||
(debian_release, target_arch, sysroot)
|
||||
(target_platform, target_arch, sysroot)
|
||||
if os.path.isdir(sysroot):
|
||||
shutil.rmtree(sysroot)
|
||||
os.mkdir(sysroot)
|
||||
|
@ -658,6 +658,7 @@ EXCLUDED_PATHS = [
|
||||
'build/linux/debian_wheezy_arm-sysroot',
|
||||
'build/linux/debian_wheezy_i386-sysroot',
|
||||
'build/linux/debian_wheezy_mips-sysroot',
|
||||
'build/linux/ubuntu_precise_amd64-sysroot',
|
||||
]
|
||||
|
||||
|
||||
|
@ -74,6 +74,7 @@ def FindFiles(input_api, root_dir, start_paths_list, excluded_dirs_list):
|
||||
path_join('build', 'linux', 'debian_wheezy_arm-sysroot'),
|
||||
path_join('build', 'linux', 'debian_wheezy_mips-sysroot'),
|
||||
path_join('build', 'linux', 'debian_wheezy_i386-sysroot'),
|
||||
path_join('build', 'linux', 'ubuntu_precise_amd64-sysroot'),
|
||||
# Old location (TODO(sbc): Remove this once it no longer exists on any bots)
|
||||
path_join('chrome', 'installer', 'linux', 'debian_wheezy_arm-sysroot'),
|
||||
# Data is not part of open source chromium, but are included on some bots.
|
||||
|
Reference in New Issue
Block a user