From ce282cdf5d27a7f110c46353843af46d014bdd75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 4 May 2018 20:52:16 +0300 Subject: [PATCH] Use --driver-mode=g++ instead of invoking clang++ This avoids needing the clang++ symlink. On platforms without symlinks (i.e. windows), clang.exe and clang++.exe are two separate but identical executables. This allows getting rid of the latter, saving size. --- wrappers/clang-target-wrapper.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/wrappers/clang-target-wrapper.sh b/wrappers/clang-target-wrapper.sh index f01a3ea..956e8b0 100755 --- a/wrappers/clang-target-wrapper.sh +++ b/wrappers/clang-target-wrapper.sh @@ -3,13 +3,8 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" TARGET="$(basename $0 | sed 's/-[^-]*$//')" EXE=$(basename $0 | sed 's/.*-\([^-]*\)/\1/') case $EXE in -clang*) - ;; -gcc) - EXE=clang - ;; -g++) - EXE=clang++ +clang++|g++) + DRIVER_MODE=--driver-mode=g++ ;; esac ARCH=$(echo $TARGET | sed 's/-.*//') @@ -38,4 +33,4 @@ esac if [ -n "$CCACHE" ]; then CCACHE=ccache fi -$CCACHE $DIR/$EXE -target $TARGET -rtlib=compiler-rt -stdlib=libc++ -fuse-ld=lld $ARCH_FLAGS -Qunused-arguments "$@" +$CCACHE $DIR/clang $DRIVER_MODE -target $TARGET -rtlib=compiler-rt -stdlib=libc++ -fuse-ld=lld $ARCH_FLAGS -Qunused-arguments "$@"