Commit 3946c4b1 authored by Konstantin Pavlov's avatar Konstantin Pavlov

Merge branch 'master' into 'master'

64bits builds

This changes allow our 64bits builds to pass the WACK

See merge request !2
parents 16b0096c e3dc5ae3
......@@ -12,8 +12,6 @@ ENV TOOLCHAIN_PREFIX=/opt/gcc-$TARGET_TUPLE
ENV MINGW_PREFIX=$TOOLCHAIN_PREFIX/$TARGET_TUPLE
ENV PATH=$TOOLCHAIN_PREFIX/bin:$PATH
COPY beginthread.patch .
RUN mkdir /build && cd /build && \
mkdir $TOOLCHAIN_PREFIX && \
mkdir $MINGW_PREFIX && \
......@@ -23,7 +21,6 @@ RUN mkdir /build && cd /build && \
git config --global user.name "VideoLAN Buildbot" && \
git config --global user.email buildbot@videolan.org && \
git clone --depth=1 git://git.code.sf.net/p/mingw-w64/mingw-w64 && \
cd mingw-w64 git am ../beginthread.patch && cd .. && \
tar xf gcc-5.3.0.tar.bz2 && \
tar xf binutils-2.26.tar.bz2 && \
cd binutils-2.26 && mkdir build && cd build && \
......@@ -51,7 +48,6 @@ RUN mkdir /build && cd /build && \
make -j4 all-gcc && \
make install-gcc && \
cd /build/mingw-w64/mingw-w64-crt && \
autoreconf -vif && \
mkdir build && cd build && \
../configure --prefix=$MINGW_PREFIX \
--host=$TARGET_TUPLE && \
......
From 6dd2dfd3ca775c9fb67770ba254aefdd311eaead Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr>
Date: Wed, 13 Apr 2016 14:46:54 +0200
Subject: [PATCH] _begin/endthread(ex) are not allowed on winrt
Provide a redirection from _beginthreadex -> CreateThread _endthread ->
ExitThread, as the documentation recommends.
---
mingw-w64-libraries/winstorecompat/Makefile.am | 1 +
.../winstorecompat/src/beginthread.c | 54 ++++++++++++++++++++++
2 files changed, 55 insertions(+)
create mode 100644 mingw-w64-libraries/winstorecompat/src/beginthread.c
diff --git a/mingw-w64-libraries/winstorecompat/Makefile.am b/mingw-w64-libraries/winstorecompat/Makefile.am
index dee6f20..332cae5 100644
--- a/mingw-w64-libraries/winstorecompat/Makefile.am
+++ b/mingw-w64-libraries/winstorecompat/Makefile.am
@@ -6,6 +6,7 @@ lib_LIBRARIES = libwinstorecompat.a
libwinstorecompat_a_SOURCES = \
src/_wassert.c \
+ src/beginthread.c \
src/GetModuleHandle.c \
src/CreateEventW.c \
src/CreateMutexW.c \
diff --git a/mingw-w64-libraries/winstorecompat/src/beginthread.c b/mingw-w64-libraries/winstorecompat/src/beginthread.c
new file mode 100644
index 0000000..bae4a6a
--- /dev/null
+++ b/mingw-w64-libraries/winstorecompat/src/beginthread.c
@@ -0,0 +1,54 @@
+/*
+ Copyright (c) 2016 mingw-w64 project
+
+ Contributing authors: Hugo Beauzée-Luyssen
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+*/
+
+#define _WIN32_WINNT 0x501
+
+#define _beginthreadex ___beginthreadex
+#define _endthreadex ___endthreadex
+#include <windef.h>
+#include <winbase.h>
+#include <processthreadsapi.h>
+#undef _endthreadex
+#undef _beginthreadex
+
+uintptr_t __cdecl _beginthreadex(void *_Security, unsigned _StackSize,
+ unsigned (__stdcall *_StartAddress) (void *),
+ void *_ArgList,unsigned _InitFlag,unsigned *_ThrdAddr)
+{
+ return (uintptr_t)CreateThread(_Security, _StackSize, (LPTHREAD_START_ROUTINE)_StartAddress,
+ _ArgList, _InitFlag, (LPDWORD)_ThrdAddr);
+}
+
+void __cdecl _endthreadex(unsigned _Retval)
+{
+ ExitThread(_Retval);
+}
+
+#ifndef _WIN64
+uintptr_t (__cdecl *__MINGW_IMP_SYMBOL(_beginthreadex))(void*, unsigned, unsigned (__stdcall *)(void *), void *,unsigned, unsigned*) asm("__imp___beginthreadex") = _beginthreadex;
+void (__cdecl *__MINGW_IMP_SYMBOL(_endthreadex))(unsigned) asm("__imp___endthreadex") = _endthreadex;
+#else
+void (__cdecl *__MINGW_IMP_SYMBOL(_beginthreadex))(void*, unsigned, unsigned (__stdcall *)(void *), void *,unsigned, unsigned*) asm("__imp__beginthreadex") = _beginthreadex;
+void (__cdecl *__MINGW_IMP_SYMBOL(_endthreadex))(unsigned) asm("__imp__endthreadex") = _endthreadex;
+#endif
--
2.8.0.rc3
......@@ -12,7 +12,7 @@ ENV TOOLCHAIN_PREFIX=/opt/gcc-$TARGET_TUPLE
ENV MINGW_PREFIX=$TOOLCHAIN_PREFIX/$TARGET_TUPLE
ENV PATH=$TOOLCHAIN_PREFIX/bin:$PATH
COPY beginthread.patch .
COPY no-rtl-func.patch .
RUN mkdir /build && cd /build && \
mkdir $TOOLCHAIN_PREFIX && \
......@@ -23,7 +23,7 @@ RUN mkdir /build && cd /build && \
git config --global user.name "VideoLAN Buildbot" && \
git config --global user.email buildbot@videolan.org && \
git clone --depth=1 git://git.code.sf.net/p/mingw-w64/mingw-w64 && \
cd mingw-w64 git am ../beginthread.patch && cd .. && \
cd mingw-w64 && git am ../../no-rtl-func.patch && cd .. && \
tar xf gcc-5.3.0.tar.bz2 && \
tar xf binutils-2.26.tar.bz2 && \
cd binutils-2.26 && mkdir build && cd build && \
......@@ -47,11 +47,11 @@ RUN mkdir /build && cd /build && \
--target=$TARGET_TUPLE \
--enable-languages=c,c++ \
--disable-shared \
--disable-multilib && \
--disable-multilib \
--enable-sjlj-exceptions && \
make -j4 all-gcc && \
make install-gcc && \
cd /build/mingw-w64/mingw-w64-crt && \
autoreconf -vif && \
mkdir build && cd build && \
../configure --prefix=$MINGW_PREFIX \
--host=$TARGET_TUPLE && \
......
From 6dd2dfd3ca775c9fb67770ba254aefdd311eaead Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr>
Date: Wed, 13 Apr 2016 14:46:54 +0200
Subject: [PATCH] _begin/endthread(ex) are not allowed on winrt
Provide a redirection from _beginthreadex -> CreateThread _endthread ->
ExitThread, as the documentation recommends.
---
mingw-w64-libraries/winstorecompat/Makefile.am | 1 +
.../winstorecompat/src/beginthread.c | 54 ++++++++++++++++++++++
2 files changed, 55 insertions(+)
create mode 100644 mingw-w64-libraries/winstorecompat/src/beginthread.c
diff --git a/mingw-w64-libraries/winstorecompat/Makefile.am b/mingw-w64-libraries/winstorecompat/Makefile.am
index dee6f20..332cae5 100644
--- a/mingw-w64-libraries/winstorecompat/Makefile.am
+++ b/mingw-w64-libraries/winstorecompat/Makefile.am
@@ -6,6 +6,7 @@ lib_LIBRARIES = libwinstorecompat.a
libwinstorecompat_a_SOURCES = \
src/_wassert.c \
+ src/beginthread.c \
src/GetModuleHandle.c \
src/CreateEventW.c \
src/CreateMutexW.c \
diff --git a/mingw-w64-libraries/winstorecompat/src/beginthread.c b/mingw-w64-libraries/winstorecompat/src/beginthread.c
new file mode 100644
index 0000000..bae4a6a
--- /dev/null
+++ b/mingw-w64-libraries/winstorecompat/src/beginthread.c
@@ -0,0 +1,54 @@
+/*
+ Copyright (c) 2016 mingw-w64 project
+
+ Contributing authors: Hugo Beauzée-Luyssen
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+*/
+
+#define _WIN32_WINNT 0x501
+
+#define _beginthreadex ___beginthreadex
+#define _endthreadex ___endthreadex
+#include <windef.h>
+#include <winbase.h>
+#include <processthreadsapi.h>
+#undef _endthreadex
+#undef _beginthreadex
+
+uintptr_t __cdecl _beginthreadex(void *_Security, unsigned _StackSize,
+ unsigned (__stdcall *_StartAddress) (void *),
+ void *_ArgList,unsigned _InitFlag,unsigned *_ThrdAddr)
+{
+ return (uintptr_t)CreateThread(_Security, _StackSize, (LPTHREAD_START_ROUTINE)_StartAddress,
+ _ArgList, _InitFlag, (LPDWORD)_ThrdAddr);
+}
+
+void __cdecl _endthreadex(unsigned _Retval)
+{
+ ExitThread(_Retval);
+}
+
+#ifndef _WIN64
+uintptr_t (__cdecl *__MINGW_IMP_SYMBOL(_beginthreadex))(void*, unsigned, unsigned (__stdcall *)(void *), void *,unsigned, unsigned*) asm("__imp___beginthreadex") = _beginthreadex;
+void (__cdecl *__MINGW_IMP_SYMBOL(_endthreadex))(unsigned) asm("__imp___endthreadex") = _endthreadex;
+#else
+void (__cdecl *__MINGW_IMP_SYMBOL(_beginthreadex))(void*, unsigned, unsigned (__stdcall *)(void *), void *,unsigned, unsigned*) asm("__imp__beginthreadex") = _beginthreadex;
+void (__cdecl *__MINGW_IMP_SYMBOL(_endthreadex))(unsigned) asm("__imp__endthreadex") = _endthreadex;
+#endif
--
2.8.0.rc3
From 65b26e230dff7c58c38cb9a42f6f963fbc252ee9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr>
Date: Thu, 21 Apr 2016 16:07:59 +0200
Subject: [PATCH] UGLY HACK: Don't use Rtl* function on win64 when building for
winrt
---
mingw-w64-crt/crt/crt_handler.c | 2 +-
mingw-w64-crt/crt/crtdll.c | 2 +-
mingw-w64-crt/crt/crtexe.c | 2 +-
mingw-w64-crt/crt/gs_support.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/mingw-w64-crt/crt/crt_handler.c b/mingw-w64-crt/crt/crt_handler.c
index a1b51ce..8a7983b 100644
--- a/mingw-w64-crt/crt/crt_handler.c
+++ b/mingw-w64-crt/crt/crt_handler.c
@@ -40,7 +40,7 @@ PBYTE _GetPEImageBase (void);
int __mingw_init_ehandler (void);
extern void _fpreset (void);
-#if defined(_WIN64) && !defined(_MSC_VER)
+#if defined(_WIN64_NOPE_NOPE_NOPE) && !defined(_MSC_VER)
EXCEPTION_DISPOSITION __mingw_SEH_error_handler(struct _EXCEPTION_RECORD *, void *, struct _CONTEXT *, void *);
#define MAX_PDATA_ENTRIES 32
diff --git a/mingw-w64-crt/crt/crtdll.c b/mingw-w64-crt/crt/crtdll.c
index 07a1840..026da7a 100644
--- a/mingw-w64-crt/crt/crtdll.c
+++ b/mingw-w64-crt/crt/crtdll.c
@@ -164,7 +164,7 @@ DllMainCRTStartup (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
if (dwReason == DLL_PROCESS_ATTACH)
{
__security_init_cookie ();
-#ifdef _WIN64
+#ifdef _WIN64_NOPE_NOPE_NOPE
__mingw_init_ehandler ();
#endif
}
diff --git a/mingw-w64-crt/crt/crtexe.c b/mingw-w64-crt/crt/crtexe.c
index ae37e0f..3be64bb 100644
--- a/mingw-w64-crt/crt/crtexe.c
+++ b/mingw-w64-crt/crt/crtexe.c
@@ -279,7 +279,7 @@ __tmainCRTStartup (void)
_pei386_runtime_relocator ();
__mingw_oldexcpt_handler = SetUnhandledExceptionFilter (_gnu_exception_handler);
-#ifdef _WIN64
+#ifdef _WIN64_NOPE_NOPE_NOPE
__mingw_init_ehandler ();
#endif
_set_invalid_parameter_handler (__mingw_invalidParameterHandler);
diff --git a/mingw-w64-crt/crt/gs_support.c b/mingw-w64-crt/crt/gs_support.c
index dbd95d5..4207fff 100644
--- a/mingw-w64-crt/crt/gs_support.c
+++ b/mingw-w64-crt/crt/gs_support.c
@@ -103,7 +103,7 @@ __declspec(noreturn) void __cdecl
__report_gsfailure (ULONG_PTR StackCookie)
{
volatile UINT_PTR cookie[2] __MINGW_ATTRIB_UNUSED;
-#ifdef _WIN64
+#ifdef _WIN64_NOPE_NOPE_NOPE
ULONG64 controlPC, imgBase, establisherFrame;
PRUNTIME_FUNCTION fctEntry;
PVOID hndData;
--
2.8.0.rc3
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment