wrappers: Add a wrapper for running llvm binutils replacements

This saves a lot of diskspace, when symlinks are turned into full
copies of the tools on windows, as the symlinks only point to a small
wrapper instead of to the full tool.
This commit is contained in:
Martin Storsjö committed 2019-05-06 11:05:25 +03:00
1 parent 750ab50433
commit c3aeb78576
5 files changed
+60 -20

No files matched your search

+7 -1
View File
@@ -40,6 +40,7 @@ if [ -n "$HOST" ]; then
fi
$CC wrappers/clang-target-wrapper.c -o $PREFIX/bin/clang-target-wrapper$EXEEXT -O2 -Wl,-s $WRAPPER_FLAGS
$CC wrappers/windres-wrapper.c -o $PREFIX/bin/windres-wrapper$EXEEXT -O2 -Wl,-s $WRAPPER_FLAGS
$CC wrappers/llvm-wrapper.c -o $PREFIX/bin/llvm-wrapper$EXEEXT -O2 -Wl,-s $WRAPPER_FLAGS
if [ -n "$EXEEXT" ]; then
# For Windows, we should prefer the executable wrapper, which also works
# when invoked from outside of MSYS.
@@ -55,7 +56,12 @@ for arch in $ARCHS; do
ln -sf clang-target-wrapper$CTW_SUFFIX $arch-w64-$target_os-$exec$CTW_LINK_SUFFIX
done
for exec in ar ranlib nm objcopy strings strip; do
ln -sf llvm-$exec$EXEEXT $arch-w64-$target_os-$exec$EXEEXT || true
if [ -n "$HOST" ]; then
link_target=llvm-wrapper
else
link_target=llvm-$exec
fi
ln -sf $link_target$EXEEXT $arch-w64-$target_os-$exec$EXEEXT || true
done
for exec in windres; do
ln -sf $exec-wrapper$EXEEXT $arch-w64-$target_os-$exec$EXEEXT