Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Unified Diff: native_client_sdk/src/build_tools/build_sdk.py

Issue 1493443002: Revert of [NaCl SDK] Remove support for bionic toolchain (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: native_client_sdk/src/build_tools/build_sdk.py
diff --git a/native_client_sdk/src/build_tools/build_sdk.py b/native_client_sdk/src/build_tools/build_sdk.py
index 69243bee2eeef04e5bbce38ac4d0af2171f886ed..a6433fa32c13c974bdc627e11e25b86fef9bd877 100755
--- a/native_client_sdk/src/build_tools/build_sdk.py
+++ b/native_client_sdk/src/build_tools/build_sdk.py
@@ -67,6 +67,7 @@
TOOLCHAIN_PACKAGE_MAP = {
'arm_glibc': ('nacl_arm_glibc', '%(platform)s_arm_glibc', 'arm'),
'x86_glibc': ('nacl_x86_glibc', '%(platform)s_x86_glibc', 'x86'),
+ 'arm_bionic': ('nacl_arm_bionic', '%(platform)s_arm_bionic', 'arm'),
'pnacl': ('pnacl_newlib', '%(platform)s_pnacl', 'pnacl')
}
@@ -84,7 +85,7 @@
def GetToolchainLibc(tcname):
if tcname == 'pnacl':
return 'newlib'
- for libc in ('glibc', 'newlib', 'host'):
+ for libc in ('bionic', 'glibc', 'newlib', 'host'):
if libc in tcname:
return libc
@@ -124,7 +125,10 @@
else:
lib_suffix = ''
- tcdir = 'tc_' + GetToolchainLibc(tcname)
+ if tcname == 'arm_bionic':
+ tcdir = 'tc_newlib'
+ else:
+ tcdir = 'tc_' + GetToolchainLibc(tcname)
if tcname == 'pnacl':
if arch is None:
@@ -163,6 +167,9 @@
def BuildStepDownloadToolchains(toolchains):
buildbot_common.BuildStep('Running package_version.py')
args = [sys.executable, PKGVER, '--mode', 'nacl_core_sdk']
+ if 'arm_bionic' in toolchains:
+ build_platform = '%s_x86' % getos.GetPlatform()
+ args.extend(['--append', os.path.join(build_platform, 'nacl_arm_bionic')])
args.extend(['sync', '--extract'])
buildbot_common.Run(args, cwd=NACL_DIR)
@@ -286,6 +293,9 @@
('native_client/src/untrusted/valgrind/dynamic_annotations.h', 'nacl/'),
('ppapi/nacl_irt/public/irt_ppapi.h', ''),
],
+ 'bionic': [
+ ('ppapi/nacl_irt/public/irt_ppapi.h', ''),
+ ],
}
def InstallFiles(src_root, dest_root, file_list):
@@ -344,6 +354,13 @@
# already provided by the toolchain.
# Mapping from libc to libraries gyp-build trusted libraries
TOOLCHAIN_LIBS = {
+ 'bionic' : [
+ 'libminidump_generator.a',
+ 'libnacl_dyncode.a',
+ 'libnacl_exception.a',
+ 'libnacl_list_mappings.a',
+ 'libppapi.a',
+ ],
'newlib' : [
'libminidump_generator.a',
'libnacl.a',
@@ -435,7 +452,7 @@
xarches = (None, 'ia32', 'x64', 'arm')
elif tc in ('x86_glibc', 'x86_newlib'):
xarches = ('ia32', 'x64')
- elif tc == 'arm_glibc':
+ elif tc in ('arm_glibc', 'arm_bionic'):
xarches = ('arm',)
else:
raise AssertionError('unexpected toolchain value: %s' % tc)
@@ -852,7 +869,12 @@
def main(args):
parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument('--nacl-tree-path',
+ help='Path to native client tree for bionic build.',
+ dest='nacl_tree_path')
parser.add_argument('--qemu', help='Add qemu for ARM.',
+ action='store_true')
+ parser.add_argument('--bionic', help='Add bionic build.',
action='store_true')
parser.add_argument('--tar', help='Force the tar step.',
action='store_true')
@@ -890,6 +912,29 @@
buildbot_common.BuildStep('build_sdk')
+ if options.nacl_tree_path:
+ options.bionic = True
+ toolchain_build = os.path.join(options.nacl_tree_path, 'toolchain_build')
+ print 'WARNING: Building bionic toolchain from NaCl checkout.'
+ print 'This option builds bionic from the sources currently in the'
+ print 'provided NativeClient checkout, and the results instead of '
+ print 'downloading a toolchain from the builder. This may result in a'
+ print 'NaCl SDK that can not run on ToT chrome.'
+ print 'NOTE: To clobber you will need to run toolchain_build_bionic.py'
+ print 'directly from the NativeClient checkout.'
+ print ''
+ response = raw_input("Type 'y' and hit enter to continue.\n")
+ if response != 'y' and response != 'Y':
+ print 'Aborting.'
+ return 1
+
+ # Get head version of NativeClient tree
+ buildbot_common.BuildStep('Build bionic toolchain.')
+ buildbot_common.Run([sys.executable, 'toolchain_build_bionic.py', '-f'],
+ cwd=toolchain_build)
+ else:
+ toolchain_build = None
+
if buildbot_common.IsSDKBuilder():
options.archive = True
# TODO(binji): re-enable app_engine build when the linux builder stops
@@ -902,6 +947,11 @@
# Makefiles; the first toolchain will be the default.
toolchains = ['pnacl', 'x86_glibc', 'arm_glibc', 'clang-newlib', 'host']
+ # Changes for experimental bionic builder
+ if options.bionic:
+ toolchains.append('arm_bionic')
+ options.build_app_engine = False
+
print 'Building: ' + ' '.join(toolchains)
platform = getos.GetPlatform()
@@ -915,7 +965,10 @@
pepper_old = str(chrome_version - 1)
pepperdir = os.path.join(OUT_DIR, 'pepper_' + pepper_ver)
pepperdir_old = os.path.join(OUT_DIR, 'pepper_' + pepper_old)
- tarname = 'naclsdk_%s.tar.bz2' % platform
+ if options.bionic:
+ tarname = 'naclsdk_bionic.tar.bz2'
+ else:
+ tarname = 'naclsdk_%s.tar.bz2' % platform
tarfile = os.path.join(OUT_DIR, tarname)
if options.release:
@@ -940,7 +993,16 @@
BuildStepCleanPepperDirs(pepperdir, pepperdir_old)
BuildStepMakePepperDirs(pepperdir, ['include', 'toolchain', 'tools'])
BuildStepDownloadToolchains(toolchains)
- BuildStepUntarToolchains(pepperdir, toolchains)
+ if options.nacl_tree_path:
+ # Instead of untarring, copy the raw bionic toolchain
+ not_bionic = [i for i in toolchains if i != 'arm_bionic']
+ BuildStepUntarToolchains(pepperdir, not_bionic)
+ tcname = GetToolchainDirName('arm_bionic')
+ srcdir = os.path.join(toolchain_build, 'out', tcname)
+ bionicdir = os.path.join(pepperdir, 'toolchain', tcname)
+ oshelpers.Copy(['-r', srcdir, bionicdir])
+ else:
+ BuildStepUntarToolchains(pepperdir, toolchains)
if platform == 'linux':
buildbot_common.Move(os.path.join(pepperdir, 'toolchain', 'arm_trusted'),
os.path.join(OUT_DIR, 'arm_trusted'))
@@ -982,7 +1044,8 @@
GenerateNotice(pepperdir)
# Verify the SDK contains what we expect.
- BuildStepVerifyFilelist(pepperdir)
+ if not options.bionic:
+ BuildStepVerifyFilelist(pepperdir)
if options.tar:
BuildStepTarBundle(pepper_ver, tarfile)
« no previous file with comments | « native_client_sdk/src/build_tools/build_projects.py ('k') | native_client_sdk/src/build_tools/buildbot_common.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698