From 2f2114eed8de4426bd1bc7d3a3275abb04a10f12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Wed, 26 Apr 2023 14:51:07 +0300 Subject: [PATCH] build-all: Add options for rebuilding runtimes only This allows rebuilding runtimes with e.g. a different default CRT. --- build-all.sh | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/build-all.sh b/build-all.sh index f272be4..68fecec 100755 --- a/build-all.sh +++ b/build-all.sh @@ -61,6 +61,12 @@ while [ $# -gt 0 ]; do --host=*) HOST_ARGS="$HOST_ARGS $1" ;; + --no-tools) + NO_TOOLS=1 + ;; + --wipe-runtimes) + WIPE_RUNTIMES=1 + ;; *) if [ -n "$PREFIX" ]; then echo Unrecognized parameter $1 @@ -72,7 +78,7 @@ while [ $# -gt 0 ]; do shift done if [ -z "$PREFIX" ]; then - echo "$0 [--enable-asserts] [--disable-dylib] [--full-llvm] [--with-python] [--disable-lldb] [--disable-lldb-mi] [--disable-clang-tools-extra] [--host=triple] [--with-default-win32-winnt=0x601] [--with-default-msvcrt=ucrt] [--enable-cfguard|--disable-cfguard] [--no-runtimes] dest" + echo "$0 [--enable-asserts] [--disable-dylib] [--full-llvm] [--with-python] [--disable-lldb] [--disable-lldb-mi] [--disable-clang-tools-extra] [--host=triple] [--with-default-win32-winnt=0x601] [--with-default-msvcrt=ucrt] [--enable-cfguard|--disable-cfguard] [--no-runtimes] [--no-tools] [--wipe-runtimes] dest" exit 1 fi @@ -83,18 +89,28 @@ for dep in git cmake; do fi done -./build-llvm.sh $PREFIX $LLVM_ARGS $HOST_ARGS -if [ -z "$NO_LLDB" ] && [ -z "$NO_LLDB_MI" ]; then - ./build-lldb-mi.sh $PREFIX $HOST_ARGS +if [ -z "$NO_TOOLS" ]; then + ./build-llvm.sh $PREFIX $LLVM_ARGS $HOST_ARGS + if [ -z "$NO_LLDB" ] && [ -z "$NO_LLDB_MI" ]; then + ./build-lldb-mi.sh $PREFIX $HOST_ARGS + fi + if [ -z "$FULL_LLVM" ]; then + ./strip-llvm.sh $PREFIX + fi + ./install-wrappers.sh $PREFIX $HOST_ARGS + ./build-mingw-w64-tools.sh $PREFIX $HOST_ARGS fi -if [ -z "$FULL_LLVM" ]; then - ./strip-llvm.sh $PREFIX -fi -./install-wrappers.sh $PREFIX $HOST_ARGS -./build-mingw-w64-tools.sh $PREFIX $HOST_ARGS if [ -n "$NO_RUNTIMES" ]; then exit 0 fi +if [ -n "$WIPE_RUNTIMES" ]; then + # Remove the runtime code built previously. + # + # This roughly matches the setup as if --no-runtimes had been passed, + # --no-runtimes, except that compiler-rt headers are left installed + # in lib/clang/*/include. + rm -rf $PREFIX/*-w64-mingw32 $PREFIX/lib/clang/*/lib +fi ./build-mingw-w64.sh $PREFIX $MINGW_ARGS $CFGUARD_ARGS ./build-compiler-rt.sh $PREFIX $CFGUARD_ARGS ./build-libcxx.sh $PREFIX $CFGUARD_ARGS