[Mingw-w64-public] [PATCH v3] headers/intrin-impl: Fix segment accessors

2024-11-08 Thread LIU Hao
-- Best regards, LIU Hao From 2b3f564d1933acadc3a0b0358591ee30ecebd120 Mon Sep 17 00:00:00 2001 From: LIU Hao Date: Fri, 8 Nov 2024 23:02:15 +0800 Subject: [PATCH] headers/intrin-impl: Fix segment accessors First, these intrins read from and write to thread-local memory. The TEB contains a poi

Re: [Mingw-w64-public] [PATCH v3] headers/intrin-impl: Fix segment accessors

2024-11-08 Thread LIU Hao
在 2024-11-08 23:06, LIU Hao 写道: From 2b3f564d1933acadc3a0b0358591ee30ecebd120 Mon Sep 17 00:00:00 2001 From: LIU Hao Date: Fri, 8 Nov 2024 23:02:15 +0800 Subject: [PATCH] headers/intrin-impl: Fix segment accessors First, these intrins read from and write to thread-local memory. The TEB contain

Re: [Mingw-w64-public] getmainargs changes

2024-11-08 Thread Pali Rohár
On Friday 08 November 2024 19:49:24 Lasse Collin wrote: > Hello! > > I apologize for the hassle. :-( It's a security issue that (I think) is > only half-public, so I didn't want to post to the public mailing list. > Apparently the tiny group of people I discussed this was too small (all > are in t

[Mingw-w64-public] [PATCH v4] headers/intrin-impl: Fix segment accessors

2024-11-08 Thread LIU Hao
Add an explicit `volatile` qualifier for intrinsic functions that write to TEB; do not rely on the implicit volatile semantics, just because they have no output. * If an asm statement reads memory that is not passed with "m", it shall clobber "memory". * If an asm statement writes memory that

[Mingw-w64-public] [PATCH] crt: Rename purecall.c to _set_purecall_handler.c and fix its inclusion

2024-11-08 Thread Pali Rohár
Source file purecall.c provides emulation of function _set_purecall_handler() so rename this file to _set_purecall_handler.c. This file does not provide function named purecall(). Function _set_purecall_handler() is available since msvcr71.dll, so include source file also into msvcr70.dll import l

[Mingw-w64-public] [PATCH] crt: Add _copysignf into all i386 CRT libraries

2024-11-08 Thread Pali Rohár
Function _copysignf is in i386 natively available only in msvcr120 and UCRT. mingw-w64 already provides emulation in crtdll and msvcrt i386 import libraries. Include this emulation also into all other i386 CRT import libraries. Note that function _copysignf is available in all x64 and arm versions

Re: [Mingw-w64-public] [PATCH v2] headers/intrin-impl: Fix segment accessors

2024-11-08 Thread Martin Storsjö
On Thu, 31 Oct 2024, LIU Hao wrote: -- Overall, I'm not familiar enough with nontrivial aspects of x86 assembly to comment reasonably on it - so I guess it's mostly "probably ok, if you say so". However this bit caught my eye: First, these intrins read from and write to thread-local memo

Re: [Mingw-w64-public] [PATCH v2] headers/intrin-impl: Fix segment accessors

2024-11-08 Thread LIU Hao
在 2024-11-08 21:04, Martin Storsjö 写道: Can you elaborate about the reasoning here? Isn't volatile primarily needed if the assembly has some side effect that otherwise can't be modelled - e.g. if the outputs of the inline assembly isn't needed, we still can't skip the whole assembly. I don't qu

Re: [Mingw-w64-public] [PATCH v3 2/2] crt: Fix building of libmsvcrtd.a import library

2024-11-08 Thread Martin Storsjö
On Thu, 24 Oct 2024, Pali Rohár wrote: libmsvcrtd.a is import library for msvcrtd.dll and therefore it cannot include libmsvcrt_extra.a library which object files are compiled with -D__LIBMSVCRT_OS__ which instruct code to access msvcrt.dll library. Add a new static library libmsvcrtd_extra.a w

Re: [Mingw-w64-public] [PATCH v3 2/2] crt: Fix building of libmsvcrtd.a import library

2024-11-08 Thread Pali Rohár
On Friday 08 November 2024 14:55:13 Martin Storsjö wrote: > On Thu, 24 Oct 2024, Pali Rohár wrote: > > > libmsvcrtd.a is import library for msvcrtd.dll and therefore it cannot > > include libmsvcrt_extra.a library which object files are compiled with > > -D__LIBMSVCRT_OS__ which instruct code to a