From 866d47cced06fb17fe2aecf06ad5478a18395f24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Sat, 21 Apr 2018 15:57:27 +0300 Subject: [PATCH] wrappers: Pick up the Clang config file implicitly Clang only picks up config files implicitly using the normalized triple form, so use file names with "-windows-gnu" instead of "-mingw32". In theory, we could also want to pick up the config file implicitly by having "-" be a symlink directly to the clang executable. That works for regular mingw32 targets, but for the mingw32uwp target, there's no distinction in the normalized triple, so both would end up using the same "-windows-gnu" config files. So as long as we want to support the mingw32uwp prefixed tools, we need to use a wrapper. --- install-wrappers.sh | 2 +- .../{aarch64-w64-mingw32.cfg => aarch64-w64-windows-gnu.cfg} | 0 wrappers/{armv7-w64-mingw32.cfg => armv7-w64-windows-gnu.cfg} | 0 wrappers/clang-target-wrapper.c | 4 ++-- wrappers/clang-target-wrapper.sh | 2 +- wrappers/{i686-w64-mingw32.cfg => i686-w64-windows-gnu.cfg} | 0 .../{x86_64-w64-mingw32.cfg => x86_64-w64-windows-gnu.cfg} | 0 7 files changed, 4 insertions(+), 4 deletions(-) rename wrappers/{aarch64-w64-mingw32.cfg => aarch64-w64-windows-gnu.cfg} (100%) rename wrappers/{armv7-w64-mingw32.cfg => armv7-w64-windows-gnu.cfg} (100%) rename wrappers/{i686-w64-mingw32.cfg => i686-w64-windows-gnu.cfg} (100%) rename wrappers/{x86_64-w64-mingw32.cfg => x86_64-w64-windows-gnu.cfg} (100%) diff --git a/install-wrappers.sh b/install-wrappers.sh index 98ce917..35145ea 100755 --- a/install-wrappers.sh +++ b/install-wrappers.sh @@ -124,7 +124,7 @@ fi mkdir -p "$PREFIX/bin" cp wrappers/*-wrapper.sh "$PREFIX/bin" for arch in $ARCHS; do - cp wrappers/$arch-w64-mingw32.cfg $PREFIX/bin + cp wrappers/$arch-w64-windows-gnu.cfg $PREFIX/bin done if [ -n "$HOST" ] && [ -n "$EXEEXT" ]; then # TODO: If building natively on msys, pick up the default HOST value from there. diff --git a/wrappers/aarch64-w64-mingw32.cfg b/wrappers/aarch64-w64-windows-gnu.cfg similarity index 100% rename from wrappers/aarch64-w64-mingw32.cfg rename to wrappers/aarch64-w64-windows-gnu.cfg diff --git a/wrappers/armv7-w64-mingw32.cfg b/wrappers/armv7-w64-windows-gnu.cfg similarity index 100% rename from wrappers/armv7-w64-mingw32.cfg rename to wrappers/armv7-w64-windows-gnu.cfg diff --git a/wrappers/clang-target-wrapper.c b/wrappers/clang-target-wrapper.c index 9421ab0..0eba6ab 100644 --- a/wrappers/clang-target-wrapper.c +++ b/wrappers/clang-target-wrapper.c @@ -78,8 +78,8 @@ int _tmain(int argc, TCHAR* argv[]) { exec_argv[arg++] = _T("-D_UCRT"); } - exec_argv[arg++] = _T("--config"); - exec_argv[arg++] = concat(arch, _T("-w64-mingw32.cfg")); + exec_argv[arg++] = _T("-target"); + exec_argv[arg++] = target; exec_argv[arg++] = _T("--end-no-unused-arguments"); for (int i = 1; i < argc; i++) diff --git a/wrappers/clang-target-wrapper.sh b/wrappers/clang-target-wrapper.sh index ed45a22..42e8578 100755 --- a/wrappers/clang-target-wrapper.sh +++ b/wrappers/clang-target-wrapper.sh @@ -92,7 +92,7 @@ mingw32uwp) ;; esac -FLAGS="$FLAGS --config $ARCH-w64-mingw32.cfg" +FLAGS="$FLAGS -target $TARGET" FLAGS="$FLAGS --end-no-unused-arguments" $CCACHE "$CLANG" $FLAGS "$@" $LINKER_FLAGS diff --git a/wrappers/i686-w64-mingw32.cfg b/wrappers/i686-w64-windows-gnu.cfg similarity index 100% rename from wrappers/i686-w64-mingw32.cfg rename to wrappers/i686-w64-windows-gnu.cfg diff --git a/wrappers/x86_64-w64-mingw32.cfg b/wrappers/x86_64-w64-windows-gnu.cfg similarity index 100% rename from wrappers/x86_64-w64-mingw32.cfg rename to wrappers/x86_64-w64-windows-gnu.cfg