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

Side by Side Diff: tools/clang/scripts/update.sh

Issue 1263213002: Support Android x86 ASan build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months 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 unified diff | Download patch
« no previous file with comments | « build/config/compiler/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env bash 1 #!/usr/bin/env bash
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 # This script will check out llvm and clang into third_party/llvm and build it. 6 # This script will check out llvm and clang into third_party/llvm and build it.
7 7
8 # Do NOT CHANGE this if you don't know what you're doing -- see 8 # Do NOT CHANGE this if you don't know what you're doing -- see
9 # https://code.google.com/p/chromium/wiki/UpdatingClang 9 # https://code.google.com/p/chromium/wiki/UpdatingClang
10 # Reverting problematic clang rolls is safe, though. 10 # Reverting problematic clang rolls is safe, though.
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 else 673 else
674 tar -c lib/linux | tar -C ${ABS_LLVM_CLANG_LIB_DIR} -xv 674 tar -c lib/linux | tar -C ${ABS_LLVM_CLANG_LIB_DIR} -xv
675 fi 675 fi
676 676
677 popd 677 popd
678 678
679 if [[ -n "${with_android}" ]]; then 679 if [[ -n "${with_android}" ]]; then
680 # Make a standalone Android toolchain. 680 # Make a standalone Android toolchain.
681 ${ANDROID_NDK_DIR}/build/tools/make-standalone-toolchain.sh \ 681 ${ANDROID_NDK_DIR}/build/tools/make-standalone-toolchain.sh \
682 --platform=android-19 \ 682 --platform=android-19 \
683 --install-dir="${LLVM_BUILD_DIR}/android-toolchain" \ 683 --install-dir="${LLVM_BUILD_DIR}/android-toolchain-arm" \
684 --system=linux-x86_64 \ 684 --system=linux-x86_64 \
685 --stl=stlport \ 685 --stl=stlport \
686 --toolchain=arm-linux-androideabi-4.9 686 --toolchain=arm-linux-androideabi-4.9
687 687
688 # Android NDK r9d copies a broken unwind.h into the toolchain, see 688 # Do the same for x86.
689 # http://crbug.com/357890 689 ${ANDROID_NDK_DIR}/build/tools/make-standalone-toolchain.sh \
690 rm -v "${LLVM_BUILD_DIR}"/android-toolchain/include/c++/*/unwind.h 690 --platform=android-19 \
691 --install-dir="${LLVM_BUILD_DIR}/android-toolchain-i686" \
692 --system=linux-x86_64 \
693 --stl=stlport \
694 --toolchain=x86-4.9
691 695
692 # Build ASan runtime for Android in a separate build tree. 696 for target_arch in "arm" "i686"; do
693 mkdir -p ${LLVM_BUILD_DIR}/android 697 # Android NDK r9d copies a broken unwind.h into the toolchain, see
694 pushd ${LLVM_BUILD_DIR}/android 698 # http://crbug.com/357890
695 rm -fv CMakeCache.txt 699 rm -v "${LLVM_BUILD_DIR}"/android-toolchain-${target_arch}/include/c++/*/unw ind.h
696 MACOSX_DEPLOYMENT_TARGET=${deployment_target} cmake -GNinja \
697 -DCMAKE_BUILD_TYPE=Release \
698 -DLLVM_ENABLE_ASSERTIONS=ON \
699 -DLLVM_ENABLE_THREADS=OFF \
700 -DCMAKE_C_COMPILER=${PWD}/../bin/clang \
701 -DCMAKE_CXX_COMPILER=${PWD}/../bin/clang++ \
702 -DLLVM_CONFIG_PATH=${PWD}/../bin/llvm-config \
703 -DCMAKE_C_FLAGS="--target=arm-linux-androideabi --sysroot=${PWD}/../androi d-toolchain/sysroot -B${PWD}/../android-toolchain" \
704 -DCMAKE_CXX_FLAGS="--target=arm-linux-androideabi --sysroot=${PWD}/../andr oid-toolchain/sysroot -B${PWD}/../android-toolchain" \
705 -DANDROID=1 \
706 "${ABS_COMPILER_RT_DIR}"
707 ninja libclang_rt.asan-arm-android.so
708 700
709 # And copy it into the main build tree. 701 # Build ASan runtime for Android in a separate build tree.
710 cp "$(find -name libclang_rt.asan-arm-android.so)" "${ABS_LLVM_CLANG_LIB_DIR}/ lib/linux/" 702 mkdir -p ${LLVM_BUILD_DIR}/android-${target_arch}
711 popd 703 pushd ${LLVM_BUILD_DIR}/android-${target_arch}
704 rm -fv CMakeCache.txt
705 MACOSX_DEPLOYMENT_TARGET=${deployment_target} cmake -GNinja \
706 -DCMAKE_BUILD_TYPE=Release \
707 -DLLVM_ENABLE_ASSERTIONS=ON \
708 -DLLVM_ENABLE_THREADS=OFF \
709 -DCMAKE_C_COMPILER=${PWD}/../bin/clang \
710 -DCMAKE_CXX_COMPILER=${PWD}/../bin/clang++ \
711 -DLLVM_CONFIG_PATH=${PWD}/../bin/llvm-config \
712 -DCMAKE_C_FLAGS="--target=${target_arch}-linux-androideabi --sysroot=${P WD}/../android-toolchain-${target_arch}/sysroot -B${PWD}/../android-toolchain-${ target_arch}" \
713 -DCMAKE_CXX_FLAGS="--target=${target_arch}-linux-androideabi --sysroot=$ {PWD}/../android-toolchain-${target_arch}/sysroot -B${PWD}/../android-toolchain- ${target_arch}" \
714 -DANDROID=1 \
715 "${ABS_COMPILER_RT_DIR}"
716 ninja libclang_rt.asan-${target_arch}-android.so
717
718 # And copy it into the main build tree.
719 cp "$(find -name libclang_rt.asan-${target_arch}-android.so)" "${ABS_LLVM_CL ANG_LIB_DIR}/lib/linux/"
720 popd
721 done
712 fi 722 fi
713 723
714 if [[ -n "$run_tests" || -n "${LLVM_FORCE_HEAD_REVISION:-''}" ]]; then 724 if [[ -n "$run_tests" || -n "${LLVM_FORCE_HEAD_REVISION:-''}" ]]; then
715 # Run Chrome tool tests. 725 # Run Chrome tool tests.
716 ninja -C "${LLVM_BUILD_DIR}" cr-check-all 726 ninja -C "${LLVM_BUILD_DIR}" cr-check-all
717 fi 727 fi
718 if [[ -n "$run_tests" ]]; then 728 if [[ -n "$run_tests" ]]; then
719 # Run the LLVM and Clang tests. 729 # Run the LLVM and Clang tests.
720 ninja -C "${LLVM_BUILD_DIR}" check-all 730 ninja -C "${LLVM_BUILD_DIR}" check-all
721 fi 731 fi
722 732
723 # After everything is done, log success for this revision. 733 # After everything is done, log success for this revision.
724 echo "${PACKAGE_VERSION}" > "${STAMP_FILE}" 734 echo "${PACKAGE_VERSION}" > "${STAMP_FILE}"
OLDNEW
« no previous file with comments | « build/config/compiler/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698