Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NFC] Simplify clang build script. #11923

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 11 additions & 17 deletions infra/base-images/base-clang/checkout_build_install_llvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,22 +91,6 @@ function clone_with_retries {
}
clone_with_retries https://github.com/llvm/llvm-project.git $LLVM_SRC

PROJECTS_TO_BUILD="clang;lld"
function cmake_llvm {
extra_args="$@"
cmake -G "Ninja" \
-DLIBCXX_ENABLE_SHARED=OFF \
-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \
-DLIBCXXABI_ENABLE_SHARED=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi" \
-DLLVM_TARGETS_TO_BUILD="$TARGET_TO_BUILD" \
-DLLVM_ENABLE_PROJECTS="$PROJECTS_TO_BUILD" \
-DLLVM_BINUTILS_INCDIR="/usr/include/" \
$extra_args \
$LLVM_SRC/llvm
}

set +e
git -C $LLVM_SRC merge-base --is-ancestor $OUR_LLVM_REVISION $LLVM_REVISION
IS_OUR_REVISION_ANCESTOR_RETCODE=$?
Expand Down Expand Up @@ -137,7 +121,17 @@ mkdir -p $WORK/llvm-stage2 $WORK/llvm-stage1
python3 $SRC/chromium_tools/clang/scripts/update.py --output-dir $WORK/llvm-stage1

cd $WORK/llvm-stage2
cmake_llvm
cmake -G "Ninja" \
-DLIBCXX_ENABLE_SHARED=OFF \
-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \
-DLIBCXXABI_ENABLE_SHARED=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi" \
-DLLVM_TARGETS_TO_BUILD="$TARGET_TO_BUILD" \
-DLLVM_ENABLE_PROJECTS="clang;lld" \
-DLLVM_BINUTILS_INCDIR="/usr/include/" \
$LLVM_SRC/llvm

ninja -j $NPROC
ninja install
rm -rf $WORK/llvm-stage1 $WORK/llvm-stage2
Expand Down