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
+19 -9

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
+4 -2
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
ln -sf $HOST-widl$EXEEXT widl$EXEEXT if [ -n "$HOST" ]; then
ln -sf $HOST-widl$EXEEXT widl$EXEEXT
fi
fi fi
+13 -6
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
for exec in clang clang++ gcc g++ cc c99 c11 c++ addr2line ar ranlib nm objcopy strings strip windres; do HOST_ARCH="${HOST%%-*}"
ln -sf $HOST-$exec$EXEEXT $exec$EXEEXT # Install unprefixed wrappers if $HOST is one of the architectures
done # we are installing wrappers for.
for exec in ld objdump dlltool; do case $ARCHS in
ln -sf $HOST-$exec $exec *$HOST_ARCH*)
done 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
done
for exec in ld objdump dlltool; do
ln -sf $HOST-$exec $exec
done
;;
esac
fi fi