wrappers: Skip the clang-scan-deps wrapper script on Unix

The wrapper script no longer has any purpose on Unix.

Just do a plain symlink to the clang-scan-deps tool.

On Windows, the wrapper executable still is used to inject a
default -target option, if the executable name doesn't contain
a triple.
This commit is contained in:
Martin Storsjö committed 2024-11-06 11:40:31 +02:00
1 parent ff505bf06a
commit 63691c69bc
2 files changed
+3 -66

No files matched your search

+3 -1
View File
@@ -142,8 +142,10 @@ if [ -n "$EXEEXT" ]; then
# when invoked from outside of MSYS.
CTW_SUFFIX=$EXEEXT
CTW_LINK_SUFFIX=$EXEEXT
CSDW=clang-scan-deps-wrapper$EXEEXT
else
CTW_SUFFIX=.sh
CSDW=clang-scan-deps
fi
cd "$PREFIX/bin"
for arch in $ARCHS; do
@@ -151,7 +153,7 @@ for arch in $ARCHS; do
for exec in clang clang++ gcc g++ c++ as; do
ln -sf clang-target-wrapper$CTW_SUFFIX $arch-w64-$target_os-$exec$CTW_LINK_SUFFIX
done
ln -sf clang-scan-deps-wrapper$CTW_SUFFIX $arch-w64-$target_os-clang-scan-deps$CTW_LINK_SUFFIX
ln -sf $CSDW $arch-w64-$target_os-clang-scan-deps$CTW_LINK_SUFFIX
for exec in addr2line ar ranlib nm objcopy readelf size strings strip llvm-ar llvm-ranlib; do
if [ -n "$EXEEXT" ]; then
link_target=llvm-wrapper
-65
View File
@@ -1,65 +0,0 @@
#!/bin/bash
#
# Copyright (c) 2024 Martin Storsjo
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
get_dir() {
target="$1"
while [ -L "$target" ]; do
cd "$(dirname "$target")"
target="$(readlink "$(basename "$target")")"
done
cd "$(dirname "$target")"
pwd
}
DIR="$(get_dir "$0")"
# If changing this wrapper, change clang-scan-deps-wrapper.c accordingly.
EXE="$DIR/clang-scan-deps"
FLAGS=()
while [ $# -gt 0 ]; do
if [ -n "$got_flags" ]; then
CMD_EXE="$1"
FLAGS+=("$1")
shift
break
elif [ "$1" = "--" ]; then
got_flags=1
FLAGS+=("$1")
else
FLAGS+=("$1")
fi
shift
done
if [ -n "$CMD_EXE" ]; then
CMD_BASENAME="$(basename "$CMD_EXE")"
CMD_BASENAME="${CMD_BASENAME%.*}"
CMD_TARGET="${CMD_BASENAME%-*}"
CMD_EXE_SUFFIX="${CMD_BASENAME##*-}"
if [ "$CMD_TARGET" != "$CMD_BASENAME" ]; then
case $CMD_EXE_SUFFIX in
clang|clang++|gcc|g++|c++|as|cc|c99|c11)
IS_CLANG=1
;;
esac
fi
fi
if [ -n "$IS_CLANG" ]; then
"$EXE" "${FLAGS[@]}" "$@"
else
"$EXE" "${FLAGS[@]}" "$@"
fi