Clean up more for windows builds in strip-llvm.sh

On windows, symlinks might be changed into regular copies, so we keep
as few extra symlinks as possible.
This commit is contained in:
Martin Storsjö committed 2018-10-02 21:34:54 +03:00
1 parent 47392c5a90
commit 8f15532652
1 file changed
+22 -1
+22 -1
View File
@@ -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