Remove unnecessary llvm files at the end
This doesn't help reduce the docker image size since it's done in a separate RUN step than the one that added the files. (compiler-rt and libunwind currently fail to build after stripping the llvm installation though.)
This commit is contained in:
1 parent
60af9e29e1
commit
d3ff718bd1
2 files changed
+40
No files matched your search
@@ -63,3 +63,8 @@ RUN cd test && \
|
||||
$arch-w64-mingw32-clang++ $test.cpp -o $test-$arch.exe || exit 1; \
|
||||
done; \
|
||||
done
|
||||
|
||||
# Strip the final toolchain. (This doesn't reduce the total docker image
|
||||
# size as long as it is in a separate RUN layer though.)
|
||||
COPY strip-llvm.sh .
|
||||
RUN ./strip-llvm.sh $TOOLCHAIN_PREFIX
|
||||
Executable
+35
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo $0 dir
|
||||
exit 1
|
||||
fi
|
||||
PREFIX="$1"
|
||||
cd "$PREFIX"
|
||||
|
||||
cd bin
|
||||
for i in bugpoint c-index-test clang-* dsymutil git-clang-format llc lli llvm-* obj2yaml opt sancov sanstats scan-build scan-view verify-uselistorder yaml2obj; do
|
||||
case $i in
|
||||
*.sh)
|
||||
;;
|
||||
clang++|clang-*.*|clang-cpp)
|
||||
;;
|
||||
llvm-ar|llvm-cvtres|llvm-dlltool|llvm-nm|llvm-objdump|llvm-ranlib|llvm-rc|llvm-readobj|llvm-strings)
|
||||
;;
|
||||
*)
|
||||
if [ -f $i ]; then
|
||||
rm $i
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
cd ..
|
||||
rm -rf share libexec
|
||||
cd include
|
||||
rm -rf clang clang-c lld llvm llvm-c
|
||||
cd ..
|
||||
cd lib
|
||||
rm -rf lib*.a *.so* *.dylib* cmake
|
||||
cd ..
|
||||
Reference in new issue
Block a user