diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py index 7bb024c..bbb713d 100755 --- a/tools/clang/scripts/update.py +++ b/tools/clang/scripts/update.py
@@ -27,7 +27,7 @@ # Do NOT CHANGE this if you don't know what you're doing -- see # https://chromium.googlesource.com/chromium/src/+/master/docs/updating_clang.md # Reverting problematic clang rolls is safe, though. -CLANG_REVISION = '317263' +CLANG_REVISION = '318369' use_head_revision = bool(os.environ.get('LLVM_FORCE_HEAD_REVISION', '0') in ('1', 'YES')) @@ -35,7 +35,7 @@ CLANG_REVISION = 'HEAD' # This is incremented when pushing a new build of Clang at the same revision. -CLANG_SUB_REVISION=3 +CLANG_SUB_REVISION=1 PACKAGE_VERSION = "%s-%s" % (CLANG_REVISION, CLANG_SUB_REVISION) @@ -399,16 +399,18 @@ sys.exit(1) +def GetPlatformUrlPrefix(platform): + if platform == 'win32' or platform == 'cygwin': + return CDS_URL + '/Win/' + if platform == 'darwin': + return CDS_URL + '/Mac/' + assert platform.startswith('linux') + return CDS_URL + '/Linux_x64/' + + def DownloadAndUnpackClangPackage(platform, runtimes_only=False): cds_file = "clang-%s.tgz" % PACKAGE_VERSION - if platform == 'win32' or platform == 'cygwin': - cds_full_url = CDS_URL + '/Win/' + cds_file - elif platform == 'darwin': - cds_full_url = CDS_URL + '/Mac/' + cds_file - else: - assert platform.startswith('linux') - cds_full_url = CDS_URL + '/Linux_x64/' + cds_file - + cds_full_url = GetPlatformUrlPrefix(platform) + cds_file try: path_prefix = None if runtimes_only: @@ -530,6 +532,10 @@ '-DLLVM_USE_CRT_RELEASE=MT', ] + if sys.platform != 'win32': + # libxml2 is required by the Win manifest merging tool used in cross-builds. + base_cmake_args.append('-DLLVM_ENABLE_LIBXML2=FORCE_ON') + if args.bootstrap: print 'Building bootstrap compiler' EnsureDirExists(LLVM_BOOTSTRAP_DIR) @@ -788,23 +794,25 @@ '--api=' + ('21' if target_arch == 'aarch64' else '19'), '--force', '--install-dir=%s' % toolchain_dir, - '--stl=stlport', + '--stl=libc++', '--arch=' + { 'aarch64': 'arm64', 'arm': 'arm', 'i686': 'x86', }[target_arch]]) - # Android NDK r9d copies a broken unwind.h into the toolchain, see - # http://crbug.com/357890 - for f in glob.glob(os.path.join(toolchain_dir, 'include/c++/*/unwind.h')): - os.remove(f) # Build sanitizer runtimes for Android in a separate build tree. build_dir = os.path.join(LLVM_BUILD_DIR, 'android-' + target_arch) if not os.path.exists(build_dir): os.mkdir(os.path.join(build_dir)) os.chdir(build_dir) - cflags = ['--target=%s-linux-androideabi' % target_arch, + target_triple = target_arch + abi_libs = 'c++abi' + if target_arch == 'arm': + target_triple = 'armv7' + abi_libs += ';unwind' + target_triple += '-linux-androideabi' + cflags = ['--target=%s' % target_triple, '--sysroot=%s/sysroot' % toolchain_dir, '-B%s' % toolchain_dir] android_args = base_cmake_args + [ @@ -814,6 +822,9 @@ '-DLLVM_CONFIG_PATH=' + os.path.join(LLVM_BUILD_DIR, 'bin/llvm-config'), '-DCMAKE_C_FLAGS=' + ' '.join(cflags), '-DCMAKE_CXX_FLAGS=' + ' '.join(cflags), + '-DSANITIZER_CXX_ABI=none', + '-DSANITIZER_CXX_ABI_LIBRARY=' + abi_libs, + '-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-u__cxa_demangle', '-DANDROID=1'] RmCmakeCache('.') RunCommand(['cmake'] + android_args + [COMPILER_RT_DIR])