wrappers: link with the Windows Store specific runtime for UWP
This commit is contained in:
1 parent
a270bc3cad
commit
cd73ed8308
4 files changed
+27
-3
No files matched your search
+22
-2
@@ -10,7 +10,23 @@ PREFIX="$1"
|
|||||||
export PATH=$PREFIX/bin:$PATH
|
export PATH=$PREFIX/bin:$PATH
|
||||||
|
|
||||||
: ${ARCHS:=${TOOLCHAIN_ARCHS-i686 x86_64 armv7 aarch64}}
|
: ${ARCHS:=${TOOLCHAIN_ARCHS-i686 x86_64 armv7 aarch64}}
|
||||||
: ${TARGET_OSES:=${TOOLCHAIN_TARGET_OSES-mingw32 mingw32uwp}}
|
|
||||||
|
cd test
|
||||||
|
|
||||||
|
DEFAULT_OSES="mingw32 mingw32uwp"
|
||||||
|
cat<<EOF > is-ucrt.c
|
||||||
|
#include <_mingw.h>
|
||||||
|
#if __MSVCRT_VERSION__ < 0x1400
|
||||||
|
#error not ucrt
|
||||||
|
#endif
|
||||||
|
EOF
|
||||||
|
ANY_ARCH=$(echo $ARCHS | awk '{print $1}')
|
||||||
|
if ! $ANY_ARCH-w64-mingw32-gcc -E is-ucrt.c > /dev/null 2>&1; then
|
||||||
|
# If the default CRT isn't UCRT, we can't build for mingw32uwp.
|
||||||
|
DEFAULT_OSES="mingw32"
|
||||||
|
fi
|
||||||
|
|
||||||
|
: ${TARGET_OSES:=${TOOLCHAIN_TARGET_OSES-$DEFAULT_OSES}}
|
||||||
|
|
||||||
if [ -z "$RUN_X86" ]; then
|
if [ -z "$RUN_X86" ]; then
|
||||||
case $(uname) in
|
case $(uname) in
|
||||||
@@ -27,7 +43,6 @@ if [ -z "$RUN_X86" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
cd test
|
|
||||||
TESTS_C="hello hello-tls crt-test setjmp"
|
TESTS_C="hello hello-tls crt-test setjmp"
|
||||||
TESTS_C_DLL="autoimport-lib"
|
TESTS_C_DLL="autoimport-lib"
|
||||||
TESTS_C_LINK_DLL="autoimport-main"
|
TESTS_C_LINK_DLL="autoimport-main"
|
||||||
@@ -143,6 +158,11 @@ for arch in $ARCHS; do
|
|||||||
if [ "$arch" = "i686" ]; then
|
if [ "$arch" = "i686" ]; then
|
||||||
compiler_rt_arch=i386
|
compiler_rt_arch=i386
|
||||||
fi
|
fi
|
||||||
|
if [ "$target_os" != "mingw32" ]; then
|
||||||
|
# The Windows Store specific CRT DLL is usually not available
|
||||||
|
# outside of such contexts, so skip trying to run those tests.
|
||||||
|
continue
|
||||||
|
fi
|
||||||
for i in libc++ libunwind libssp-0 libclang_rt.asan_dynamic-$compiler_rt_arch; do
|
for i in libc++ libunwind libssp-0 libclang_rt.asan_dynamic-$compiler_rt_arch; do
|
||||||
if [ -f $PREFIX/$arch-w64-mingw32/bin/$i.dll ]; then
|
if [ -f $PREFIX/$arch-w64-mingw32/bin/$i.dll ]; then
|
||||||
cp $PREFIX/$arch-w64-mingw32/bin/$i.dll $TEST_DIR
|
cp $PREFIX/$arch-w64-mingw32/bin/$i.dll $TEST_DIR
|
||||||
|
|||||||
@@ -305,6 +305,8 @@ int _tmain(int argc, TCHAR* argv[]) {
|
|||||||
exec_argv[arg++] = _T("-DUNICODE");
|
exec_argv[arg++] = _T("-DUNICODE");
|
||||||
// add the minimum runtime to use for UWP targets
|
// add the minimum runtime to use for UWP targets
|
||||||
exec_argv[arg++] = _T("-Wl,-lmincore");
|
exec_argv[arg++] = _T("-Wl,-lmincore");
|
||||||
|
// This requires that the default crt is ucrt.
|
||||||
|
exec_argv[arg++] = _T("-Wl,-lvcruntime140_app");
|
||||||
}
|
}
|
||||||
|
|
||||||
exec_argv[arg++] = _T("-target");
|
exec_argv[arg++] = _T("-target");
|
||||||
|
|||||||
@@ -63,6 +63,8 @@ mingw32uwp)
|
|||||||
FLAGS="$FLAGS -DUNICODE"
|
FLAGS="$FLAGS -DUNICODE"
|
||||||
# add the minimum runtime to use for UWP targets
|
# add the minimum runtime to use for UWP targets
|
||||||
FLAGS="$FLAGS -Wl,-lmincore"
|
FLAGS="$FLAGS -Wl,-lmincore"
|
||||||
|
# This requires that the default crt is ucrt.
|
||||||
|
FLAGS="$FLAGS -Wl,-lvcruntime140_app"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ esac
|
|||||||
FLAGS="-m $M"
|
FLAGS="-m $M"
|
||||||
case $TARGET_OS in
|
case $TARGET_OS in
|
||||||
mingw32uwp)
|
mingw32uwp)
|
||||||
FLAGS="$FLAGS -lmincore"
|
FLAGS="$FLAGS -lmincore -lvcruntime140_app"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
ld.lld $FLAGS "$@"
|
ld.lld $FLAGS "$@"
|
||||||
Reference in new issue
Block a user