diff --git a/strip-llvm.sh b/strip-llvm.sh index da0f3ae..3427b01 100755 --- a/strip-llvm.sh +++ b/strip-llvm.sh @@ -10,7 +10,7 @@ PREFIX="$1" cd "$PREFIX" cd bin -for i in bugpoint c-index-test clang-* diagtool dsymutil git-clang-format hmaptool llc lli llvm-* obj2yaml opt sancov sanstats scan-build scan-view verify-uselistorder yaml2obj; do +for i in bugpoint c-index-test clang-* diagtool dsymutil git-clang-format hmaptool ld64.lld llc lli llvm-* obj2yaml opt sancov sanstats scan-build scan-view verify-uselistorder wasm-ld yaml2obj libclang.dll LTO.dll *.bat; do basename=$i if [ -n "$EXEEXT" ]; then # Some in the list are expanded globs, some are plain names we list. @@ -41,6 +41,11 @@ for i in bugpoint c-index-test clang-* diagtool dsymutil git-clang-format hmapto ;; llvm-ar|llvm-cvtres|llvm-dlltool|llvm-nm|llvm-objdump|llvm-ranlib|llvm-rc|llvm-readobj|llvm-strings|llvm-pdbutil) ;; + ld64.lld|wasm-ld) + if [ -e $i ]; then + rm $i + fi + ;; *) if [ -f $i ]; then rm $i @@ -51,6 +56,22 @@ for i in bugpoint c-index-test clang-* diagtool dsymutil git-clang-format hmapto ;; esac done +if [ -n "$EXEEXT" ]; then + # Convert these two from symlinks to regular files, so we can remove + # the one they point to. On MSYS, and if packaging built toolchains + # in a zip file, symlinks are converted into copies. + # lld-link isn't used normally, but can be useful for debugging/testing. + for i in ld.lld lld-link; do + if [ -L $i$EXEEXT ]; then + cp $i$EXEEXT tmp + rm $i$EXEEXT + mv tmp $i$EXEEXT + fi + done + rm -f lld$EXEEXT + # Remove superfluous frontends; these aren't really used. + rm -f clang-cpp* clang++* +fi cd .. rm -rf share libexec cd include