Fix building only certain architectures when building on windows

On windows, we rename clang.exe to clang-$MAJOR.exe, and later
install clang.exe as a wrapper for the default architecture. But
if only building certain architectures, and the host architecture
isn't one of them, we shouldn't install any unprefixed clang.exe at
all.
This commit is contained in:
Martin Storsjö committed 2019-12-03 23:31:01 +02:00
1 parent 64d39428b6
commit af1099048a
3 files changed
+12 -2

No files matched your search

+2 -1
View File
@@ -29,7 +29,8 @@ export PATH="$PREFIX/bin:$PATH"
: ${CORES:=4} : ${CORES:=4}
: ${ARCHS:=${TOOLCHAIN_ARCHS-i686 x86_64 armv7 aarch64}} : ${ARCHS:=${TOOLCHAIN_ARCHS-i686 x86_64 armv7 aarch64}}
CLANG_VERSION=$(basename "$(dirname "$(dirname "$(dirname "$("$PREFIX/bin/clang" --print-libgcc-file-name -rtlib=compiler-rt)")")")") ANY_ARCH=$(echo $ARCHS | awk '{print $1}')
CLANG_VERSION=$(basename "$(dirname "$(dirname "$(dirname "$("$PREFIX/bin/$ANY_ARCH-w64-mingw32-clang" --print-libgcc-file-name -rtlib=compiler-rt)")")")")
if [ ! -d llvm-project/compiler-rt ] || [ -n "$SYNC" ]; then if [ ! -d llvm-project/compiler-rt ] || [ -n "$SYNC" ]; then
CHECKOUT_ONLY=1 ./build-llvm.sh CHECKOUT_ONLY=1 ./build-llvm.sh
+3 -1
View File
@@ -156,8 +156,10 @@ if [ -n "$SKIP_INCLUDE_TRIPLET_PREFIX" ]; then
done done
fi fi
if [ -n "$EXEEXT" ]; then if [ -n "$EXEEXT" ]; then
if [ -z "$HOST" ]; then if [ -z "$HOST" ] && [ -f clang$EXEEXT ]; then
HOST=$(./clang -dumpmachine | sed 's/-.*//')-w64-mingw32 HOST=$(./clang -dumpmachine | sed 's/-.*//')-w64-mingw32
fi fi
if [ -n "$HOST" ]; then
ln -sf $HOST-widl$EXEEXT widl$EXEEXT ln -sf $HOST-widl$EXEEXT widl$EXEEXT
fi fi
fi
+7
View File
@@ -94,10 +94,17 @@ if [ -n "$EXEEXT" ]; then
if [ -z "$HOST" ]; then if [ -z "$HOST" ]; then
HOST=$(./clang-$CLANG_MAJOR -dumpmachine | sed 's/-.*//')-w64-mingw32 HOST=$(./clang-$CLANG_MAJOR -dumpmachine | sed 's/-.*//')-w64-mingw32
fi fi
HOST_ARCH="${HOST%%-*}"
# Install unprefixed wrappers if $HOST is one of the architectures
# we are installing wrappers for.
case $ARCHS in
*$HOST_ARCH*)
for exec in clang clang++ gcc g++ cc c99 c11 c++ addr2line ar ranlib nm objcopy strings strip windres; do for exec in clang clang++ gcc g++ cc c99 c11 c++ addr2line ar ranlib nm objcopy strings strip windres; do
ln -sf $HOST-$exec$EXEEXT $exec$EXEEXT ln -sf $HOST-$exec$EXEEXT $exec$EXEEXT
done done
for exec in ld objdump dlltool; do for exec in ld objdump dlltool; do
ln -sf $HOST-$exec $exec ln -sf $HOST-$exec $exec
done done
;;
esac
fi fi