From a270bc3cadce336167c191b96058c497f0e4447d Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Tue, 12 Mar 2019 12:35:49 +0100 Subject: [PATCH] wrappers: force linking with mincore for UWP targets it's not needed for regular win32 so shouldn't be either for these targets --- wrappers/clang-target-wrapper.c | 2 ++ wrappers/clang-target-wrapper.sh | 2 ++ wrappers/ld-wrapper.sh | 9 ++++++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/wrappers/clang-target-wrapper.c b/wrappers/clang-target-wrapper.c index ee673b2..7088f4b 100644 --- a/wrappers/clang-target-wrapper.c +++ b/wrappers/clang-target-wrapper.c @@ -303,6 +303,8 @@ int _tmain(int argc, TCHAR* argv[]) { exec_argv[arg++] = _T("-DWINAPI_FAMILY=WINAPI_FAMILY_APP"); // the Windows Store API only supports Windows Unicode (some rare ANSI ones are available) exec_argv[arg++] = _T("-DUNICODE"); + // add the minimum runtime to use for UWP targets + exec_argv[arg++] = _T("-Wl,-lmincore"); } exec_argv[arg++] = _T("-target"); diff --git a/wrappers/clang-target-wrapper.sh b/wrappers/clang-target-wrapper.sh index f4dc702..13328fd 100755 --- a/wrappers/clang-target-wrapper.sh +++ b/wrappers/clang-target-wrapper.sh @@ -61,6 +61,8 @@ mingw32uwp) FLAGS="$FLAGS -DWINAPI_FAMILY=WINAPI_FAMILY_APP" # the Windows Store API only supports Windows Unicode (some rare ANSI ones are available) FLAGS="$FLAGS -DUNICODE" + # add the minimum runtime to use for UWP targets + FLAGS="$FLAGS -Wl,-lmincore" ;; esac diff --git a/wrappers/ld-wrapper.sh b/wrappers/ld-wrapper.sh index e2616b4..b65a5fd 100755 --- a/wrappers/ld-wrapper.sh +++ b/wrappers/ld-wrapper.sh @@ -26,10 +26,17 @@ if [ "$TARGET" = "$BASENAME" ]; then TARGET=$DEFAULT_TARGET fi ARCH="${TARGET%%-*}" +TARGET_OS="${TARGET##*-}" case $ARCH in i686) M=i386pe ;; x86_64) M=i386pep ;; armv7) M=thumb2pe ;; aarch64) M=arm64pe ;; esac -ld.lld -m $M "$@" +FLAGS="-m $M" +case $TARGET_OS in +mingw32uwp) + FLAGS="$FLAGS -lmincore" + ;; +esac +ld.lld $FLAGS "$@"