On Wed, 29 Nov 2023, Antonin Décimo wrote:
Signed-off-by: Antonin Décimo <[email protected]> --- mingw-w64-libraries/winpthreads/src/thread.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)diff --git a/mingw-w64-libraries/winpthreads/src/thread.c b/mingw-w64-libraries/winpthreads/src/thread.c index 7c5e75f91..16b13b07c 100644 --- a/mingw-w64-libraries/winpthreads/src/thread.c +++ b/mingw-w64-libraries/winpthreads/src/thread.c @@ -508,11 +508,25 @@ __dyn_tls_pthread (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved) /* TLS-runtime section variable. */ #ifdef _MSC_VER -#pragma section(".CRT$XLF", shared) +# ifdef _WIN64 +/* .CRT section is merged with .rdata on x64 so it must be constant data. */
This patch assumes that _WIN64 is enough to determine between x86 and x64, but does the distinction also hold up for ARM and ARM64? As current public MSVC releases support all these 4 architectures, I would suggest checking what the situation is wrt these on all 4 architectures before adding ifdefs like this.
(In many cases, it's just x86 which is the odd one out, and x64, ARM and ARM64 all do things in the same, more modern way.)
// Martin _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
