Re: [PATCH v2 00/13] Add aarch64-w64-mingw32 target

2024-03-06 Thread LIU Hao
May I suggest you keep the mcf thread model for aarch-w64-mingw32? I requested Martin Storsjö to test it on a physical Windows 11 on ARM machine with Clang and all tests passed. I think it should work once the GCC support is complete. -- Best regards, LIU Hao OpenPGP_signature.asc

Re: Ping: Re: [PATCH] libgcc: fix SEH C++ rethrow semantics [PR113337]

2024-01-30 Thread LIU Hao
I was away last week. LH, care to comment? Changes look fine to me. The change looks good to me, too. I haven't tested it though. According to a similar construction around 'libgcc/unwind.inc:265' it should be that way. -- Best regards, LIU Hao OpenPGP_signature.asc

Re: [PATCH 3/4] libbacktrace: work with aslr on windows

2023-11-21 Thread LIU Hao
them for C++ [1] and GCC defines `NOMINMAX` in 'os_defines.h', so either way it is not necessary. [1] https://github.com/mingw-w64/mingw-w64/blob/3ebb92804e3125d1be8f61bcd42f15a8db15ba1e/mingw-w64-headers/include/minmax.h#L9 -- Best regards, LIU Hao OpenPGP_signature.asc

[PATCH] Do not use caller-saved registers for COMDAT functions

2024-07-15 Thread LIU Hao
-- Best regards, LIU Hao From 6a2f0d3fbd443487bb6dd7bc95ed5403cd572ac1 Mon Sep 17 00:00:00 2001 From: LIU Hao Date: Mon, 15 Jul 2024 16:55:52 +0800 Subject: [PATCH] Do not use caller-saved registers for COMDAT functions A reference to a COMDAT function may be resolved to another definition

Re: [PATCH 1/3] diagnostics: Enable escape sequence processing on windows consoles

2024-05-09 Thread LIU Hao
't `GetConsoleMode()` be called only when `handle` is valid? I think you may initialize `isconsole` to `false`; then only if the handle is valid, should it be set accordingly; and this function just returns `isconsole`. The other two patches look good to me. -- Best regards, LIU Hao Open

Re: [PATCH v2 3/3] pretty-print: Don't translate escape sequences to windows console API

2024-05-12 Thread LIU Hao
support ANSI escape codes, translate + * them as needed. + */ nitpicking: This should probably be + * them as needed. */ CC'ing Jonathan Yong. This series of patches look good to me. -- Best regards, LIU Hao OpenPGP_signature.asc Description: OpenPGP digital signature

Two fixes for pretty-print.c for mingw-w64

2018-08-13 Thread Liu Hao
The two patches attached have addressed two issues in the ANSI escape sequence translator I sent before. Please review, and consider backporting these to gcc-8-branch. commit 5e79ccaa625169fcaca5847feff0ee168cbad83f (HEAD -> makepkg) Author: Liu Hao Date: Tue Aug 14 12:22:08 2018 +0

Re: Two fixes for pretty-print.c for mingw-w64

2018-08-13 Thread Liu Hao
在 2018/8/14 13:54, Liu Hao 写道: The two patches attached have addressed two issues in the ANSI escape sequence translator I sent before.  Please review, and consider backporting these to gcc-8-branch. And here are SVN changelogs for these two patches, in this order: * gcc/pretty

Re: [PR c++/87137] GCC-8 Fix

2018-08-29 Thread Liu Hao
在 2018-08-30 01:36, Nathan Sidwell 写道: But, it would be bad to make that particular ABI fix in a point release, so this patch just reverts the regression I caused.  Sadly, because it requires understanding TEMPLATE_DECL, we can't simply update place_field.  Instead I temporarily stitch out unde

Re: [Mingw-w64-public] Fwd: [patch] Reimplement GNU threads library on native Windows

2019-07-29 Thread Liu Hao
在 2019/7/29 22:43, JonY 写道: > > Any updates? > No. I am still under the impression that using thread handles as `std::thread::id`s: 0) complexifies comparison of thread IDs without obvious benefits, and 1) does not work reliably because handles can be duplicated, and 2) makes `__gthread_self()`

Re: [Mingw-w64-public] Fwd: [patch] Reimplement GNU threads library on native Windows

2019-06-28 Thread Liu Hao
在 2019/6/29 上午12:10, Jacek Caban 写道: > > You don't really need to store the whole __gthr_win32_thr_desc in TLS. > If you stored just the handle, this wouldn't need a destructor. > > The handle to be stored in the TLS ('the Handle' for short hereinafter) should be a real handle, so there are a f

Re: [Mingw-w64-public] Fwd: [patch] Reimplement GNU threads library on native Windows

2019-07-02 Thread Liu Hao
在 2019/7/2 下午5:19, Eric Botcazou 写道: >> It seems inappropriate to use handles as thread identifiers (as handles >> imply resource ownership and are not unique identifiers); thread IDs (as >> `DWORD` or `unsigned long`) would be a better alternative. > > This was considered but ultimately rejected,

Re: [Mingw-w64-public] Fwd: [patch] Reimplement GNU threads library on native Windows

2019-07-02 Thread Liu Hao
在 2019/7/2 下午8:00, Jonathan Wakely 写道: > The C++ standard says: > > "The library may reuse the value of a thread::id of a terminated > thread that can no longer be joined." > > So that's not a reason to use a handle. According to MSDN [1] a thread ID is valid 'until the thread has been terminate

Re: [Mingw-w64-public] Fwd: [patch] Reimplement GNU threads library on native Windows

2019-07-03 Thread Liu Hao
在 2019/7/2 下午8:27, Jonathan Wakely 写道: > > What do you mean by "unclosed thread"? If I read it correctly, the MSDN > page > refers to closing a handle (which makes sense), not closing a thread. > Yes, it meant a thread which has terminated but not deleted due to some handles left open. >> This

[PATCH][mingw] Enable colorized diagnostics

2017-09-27 Thread Liu Hao
d this function in a separated target-specific file, which, actually, results in only undefined references, since all target-specific object files precede `libcommon.a` in the final linker command line. * * * * * * * * * * 2017-09-28 Liu Hao * gcc/pretty-print.c [_WIN32] (colorize

Re: [PATCH][mingw] Enable colorized diagnostics

2017-09-27 Thread Liu Hao
On 2017/9/28 4:09, Joseph Myers wrote: On Thu, 28 Sep 2017, Liu Hao wrote: Colorized diagnostics used to be disabled for MinGW targets (on which the macro `_WIN32` is defined), and this patch enables it. I'd hope this is all to do with MinGW host, and nothing to do with the target. O

Re: [PATCH][mingw] Enable colorized diagnostics

2017-09-28 Thread Liu Hao
On 2017/9/28 7:37, JonY wrote: Does it make sense to use a global lock in mingw_ansi_fputs? I was thinking about a named Mutex object. Named Mutexes (as well as Events and Semaphores) can be shared across processes, but there are other considerations: 1. The name of the Mutex should base o

Re: [PATCH][mingw] Enable colorized diagnostics

2017-10-08 Thread Liu Hao
On 2017/9/28 4:09, Joseph Myers wrote: On Thu, 28 Sep 2017, Liu Hao wrote: Colorized diagnostics used to be disabled for MinGW targets (on which the macro `_WIN32` is defined), and this patch enables it. I'd hope this is all to do with MinGW host, and nothing to do with the target.

Re: [PATCH][mingw] Enable colorized diagnostics

2017-10-08 Thread Liu Hao
On 2017/10/8 19:55, Hannes Domani wrote: So why not just enable it on Win10? It is up to you, GCC maintainers. If dropping support for Windows prior to Windows 10 TH2 is an option, I may provide another patch, which I can't test because I primarily work on Windows 7. XD -- Best regards, LH_

Re: [PATCH][mingw] Enable colorized diagnostics

2017-10-08 Thread Liu Hao
On 2017/10/8 20:24, Hannes Domani wrote: Am Sonntag, 8. Oktober 2017, 14:02:48 MESZ hat Liu Hao Folgendes geschrieben: > On 2017/10/8 19:55, Hannes Domani wrote: > > > So why not just enable it on Win10? > > > It is up to you, GCC maintainers. If dropping support fo

Re: [PATCH][mingw] Enable colorized diagnostics

2017-10-09 Thread Liu Hao
On 2017/10/9 19:01, JonY wrote: On 10/08/2017 11:39 AM, Liu Hao wrote: I'm not sure if it should be enabled by default due to the interleaving problem, but seeing as the user has to go out to set GCC_COLORS to use this feature, I suppose it is OK. I will commit soon if there are no

Re: [PATCH][mingw] Enable colorized diagnostics

2017-10-09 Thread Liu Hao
On 2017/10/9 22:16, David Malcolm wrote: I have some concerns about adding non-trivial host-specific code to the diagnostics subsystem. I occasionally make changes to the files you're touching, but I don't have access to the host in question, so I can't test that I don't break things on MinGW.

Re: [PATCH][mingw] Enable colorized diagnostics

2017-10-09 Thread Liu Hao
On 2017/10/10 6:25, Manuel López-Ibáñez wrote: For what is worth, the color output of GCC comes originally from grep, and grep does have code for colorizing in Windows: http://git.savannah.gnu.org/cgit/grep.git/tree/lib and there are significant differences with this patch. For once,   /* $T

Re: [PATCH][mingw] Enable colorized diagnostics

2017-10-10 Thread Liu Hao
On 2017/10/11 5:04, Manuel López-Ibáñez wrote: Ops! You're obviously right. What was I thinking? I still believe that pretty-printer.c is not the right place for all this color-handling code (diagnostic-color.c or libiberty/ may be better places). No and yes. The colors emerge only when those

[PATCH] libstdc++: Hide TLS variables in `std::call_once`

2024-11-29 Thread LIU Hao
-- Best regards, LIU Hao From 78ae9cacdfea8bab4fcc8a18068ad30401eb588d Mon Sep 17 00:00:00 2001 From: LIU Hao Date: Fri, 29 Nov 2024 17:17:01 +0800 Subject: [PATCH] libstdc++: Hide TLS variables in `std::call_once` This is a transitional change for PR80881, because on Windows, thread-local

Re: [PATCH] libstdc++: Hide TLS variables in `std::call_once`

2024-11-29 Thread LIU Hao
#if.. ? Please add full stops (periods) to the ChangeLog entry, to make complete sentences. Is "PR libstdc++/, target/" valid like that? I don't think it is, it should be two separate lines: PR libstdc++/ PR target/ Fixed now. -- Best regard

Re: [PATCH] libstdc++: Hide TLS variables in `std::call_once`

2024-11-29 Thread LIU Hao
在 2024-11-29 23:50, Jonathan Wakely 写道: It looks like your patch is against gcc-14 not trunk, the GLIBCXX_15.1.0 version is already there. Sorry, I mean GLIBCXX_3.4.34 for 15.1.0 Oops that's what I used to test the patch. Reapplied to master now. -- Best regards, LIU Hao

[PATCH] Allow a PCH to be mapped to a different address

2025-04-28 Thread LIU Hao
-Allow-a-PCH-to-be-mapped-to-a-different-addr.patch -- Best regards, LIU Hao From 5239275bb4df0e79bc4b2af57d90c2d10ad44863 Mon Sep 17 00:00:00 2001 From: LIU Hao Date: Wed, 11 May 2022 22:42:53 +0800 Subject: [PATCH] Allow a PCH to be mapped to a different address First, try mapping the PCH

[PATCH] i386: Quote user-defined symbols in assembly in Intel syntax

2025-04-27 Thread LIU Hao
Hello, I'm sending this patch again after GCC 15 has been released. This patch was sent in February and but there were no comments: https://patchwork.sourceware.org/project/gcc/patch/eca6660c-6578-4e39-8aa9-be9fdd013...@126.com/ -- Best regards, LIU Hao

[PATCH] gcc: For Windows x86-32, always attempt to realign stack regardless of SSE

2025-04-27 Thread LIU Hao
, it's always necessary to realign the stack, as what Solaris does. Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=07#c14 Signed-off-by: LIU Hao gcc/ChangeLog: PR target/07 * config/i386/cygming.h (STACK_REALIGN_DEFAULT): Copy from sol2.h. --- gcc/config

Re: [PATCH] Allow a PCH to be mapped to a different address

2025-05-05 Thread LIU Hao
在 2025-4-28 15:05, LIU Hao 写道: This is a response to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14940#c57 The patch was submitted to MSYS2 for testing in 2022-5. No issue reports have been received so far: * https://github.com/msys2/MINGW-packages/blob

Re: [PATCH] i386: Quote user-defined symbols in assembly in Intel syntax

2025-05-05 Thread LIU Hao
在 2025-4-28 14:43, LIU Hao 写道: Hello, I'm sending this patch again after GCC 15 has been released. This patch was sent in February and but there were no comments: https://patchwork.sourceware.org/project/gcc/patch/eca6660c-6578-4e39-8aa9-be9fdd013...@126.com/ Ping. -- Best regards

[PATCH v2] i386/cygming: Decrease default preferred stack boundary for 32-bit targets

2025-05-01 Thread LIU Hao
not always aligned to 16 bytes, but I don't have any system with such a configuration, so can't test that for now. -- Best regards, LIU Hao From 1c101f4903a9be7d56efa8d97be603284f6bd4d4 Mon Sep 17 00:00:00 2001 From: LIU Hao Date: Tue, 29 Apr 2025 10:43:06 +0800 Subject: [PATCH] i3

[PATCH v3] i386/cygming: Decrease default preferred stack boundary for 32-bit targets

2025-05-01 Thread LIU Hao
Remove `STACK_REALIGN_DEFAULT` for this target, because now the default value of `incoming_stack_boundary` equals `MIN_STACK_BOUNDARY` and it doesn't have an effect any more. -- Best regards, LIU Hao From eeb30bf621baa3af1a73e8e91bff297ef478 Mon Sep 17 00:00:00 2001 From: LIU Hao

Re: [PATCH] [PR119765] testsuite: adjust amd64-abi-9.c to check both ms and sysv ABIs

2025-04-15 Thread LIU Hao
sysv abi, the argument should go in esi +/* { dg-final { scan-assembler-times "movl\[\\t \]*\\\$20,\[\\t \[]*%esi" 2 } } */ + + ditto. -- Best regards, LIU Hao OpenPGP_signature.asc Description: OpenPGP digital signature

Re: [PATCH] i386/cygming: Decrease default preferred stack boundary for 32-bit targets

2025-04-29 Thread LIU Hao
在 2025-4-29 13:03, LIU Hao 写道: This fixes a long-standing issue that GCC used to assume 16-byte stack alignment on i686-w64-mingw32, which is not always the case for callbacks from system libraries. CC Zeb Figura This patch looks a bit risky. The overall effect of `__attribute__

[PATCH] i386/cygming: Decrease default preferred stack boundary for 32-bit targets

2025-04-28 Thread LIU Hao
This fixes a long-standing issue that GCC used to assume 16-byte stack alignment on i686-w64-mingw32, which is not always the case for callbacks from system libraries. -- Best regards, LIU Hao From 1b92f8105dbece1694dd3ab398cfb5e3ce2c15d9 Mon Sep 17 00:00:00 2001 From: LIU Hao Date: Tue

Re: [PATCH v3] i386/cygming: Decrease default preferred stack boundary for 32-bit targets

2025-05-03 Thread LIU Hao
在 2025-5-2 01:25, LIU Hao 写道: Remove `STACK_REALIGN_DEFAULT` for this target, because now the default value of `incoming_stack_boundary` equals `MIN_STACK_BOUNDARY` and it doesn't have an effect any more. I suddenly realized the previous patch was for GCC 15 branch. Here's

Re: [PATCH] i386: Implement Thread Local Storage on Windows

2025-05-02 Thread LIU Hao
ly an ABI break for code that uses `__thread`, `_Thread_local` or `thread_local`. Other than that, this patch seems mostly fine. -- Best regards, LIU Hao OpenPGP_signature.asc Description: OpenPGP digital signature

[PATCHv2] i386: Quote user-defined symbols in assembly in Intel syntax

2025-02-21 Thread LIU Hao
Patch v2: The special treatment about + and - seems to be specific to `ASM_OUTPUT_SYMBOL_REF()`. Neither operator is passed to `ASM_OUTPUT_LABELREF()`, so it's not necessary to check for them in `ix86_asm_output_labelref()`. -- Best regards, LIU Hao

[PATCH] i386: Quote user-defined symbols in assembly in Intel syntax

2025-02-20 Thread LIU Hao
model, both patched to use Intel syntax by default. I have also bootstrapped on x86_64-linux-gnu with default AT&T syntax, and verified that it produces expected assembly with `-masm=intel`. -- Best regards, LIU Hao From 07baacbc7de1f5dc5db9e834b030c1b642774a37 Mon Sep 17 00:00:00 2001

[PATCH] gcc/mingw: Align `.refptr.` to 8-byte boundaries for 64-bit targets

2025-03-29 Thread LIU Hao
This is a minor change, bootstrapped on x86_64-w64-mingw32. -- Best regards, LIU Hao From 83c3e90432f9ebc97785d81be7a94066d9923920 Mon Sep 17 00:00:00 2001 From: LIU Hao Date: Sat, 29 Mar 2025 22:47:54 +0800 Subject: [PATCH] gcc/mingw: Align `.refptr.` to 8-byte boundaries for 64-bit targets

Re: [PATCH v3] i386/cygming: Decrease default preferred stack boundary for 32-bit targets

2025-05-10 Thread LIU Hao
在 2025-5-10 20:48, Jonathan Yong 写道: On 5/9/25 4:26 PM, LIU Hao wrote: 在 2025-5-3 20:52, LIU Hao 写道: 在 2025-5-2 01:25, LIU Hao 写道: Remove `STACK_REALIGN_DEFAULT` for this target, because now the default value of `incoming_stack_boundary` equals `MIN_STACK_BOUNDARY` and it doesn't ha

Re: [PATCH v3] i386/cygming: Decrease default preferred stack boundary for 32-bit targets

2025-05-09 Thread LIU Hao
在 2025-5-3 20:52, LIU Hao 写道: 在 2025-5-2 01:25, LIU Hao 写道: Remove `STACK_REALIGN_DEFAULT` for this target, because now the default value of `incoming_stack_boundary` equals `MIN_STACK_BOUNDARY` and it doesn't have an effect any more. I suddenly realized the previous patch was for G

[PATCH] i386: Quote user-defined symbols in assembly in Intel syntax

2025-05-13 Thread LIU Hao
syntax, as some Linux headers contain inline assembly with only AT&T templates. It is however possible to bootstrap GCC on {i686,x86_64}-w64-mingw32. -- Best regards, LIU Hao From d733676c742f9af9b9ab34317433db242128e53d Mon Sep 17 00:00:00 2001 From: LIU Hao Date: Sat, 22 Feb 2025 13

[PATCH] Enable mcf thread model for aarch64-*-mingw*.

2025-05-16 Thread LIU Hao
NWIND_INFO in gcc/config/i386/cygming.h diff --git a/libgcc/config/i386/t-mingw-mcfgthread b/libgcc/config/mingw/t-mingw-mcfgthread similarity index 100% rename from libgcc/config/i386/t-mingw-mcfgthread rename to libgcc/config/mingw/t-mingw-mcfgthread -- 2.49.0 From b48e41b58158d6311906010954c987

Re: [PATCH] i386: Quote user-defined symbols in assembly in Intel syntax

2025-05-19 Thread LIU Hao
在 2025-5-13 17:18, LIU Hao 写道: Hello, Attached is a patch for PR 53929, but is also required by PR 80881. Ping. Also I just notice that Clang also quotes mangled MSVC++ symbols in this way, at least since Clang 3.5, so it's accepted by both GAS and LLVM: (https://gcc.godbolt.

Re: [PATCH] Enable mcf thread model for aarch64-*-mingw*.

2025-05-25 Thread LIU Hao
在 2025-5-16 16:50, LIU Hao 写道: This is a leftover of d6d7afcdbc04adb0ec42a44b2d7e05600945af42. After this change, configuration files of all three thread models are in 'libgcc/config/mingw/'. The patch has been bootstrapped on {x86_64,i686}-w64-mingw32. ARM64 port is still working i

Re: [PATCH] Add MinGW option -mcrtdll= for choosing C RunTime DLL library

2023-06-11 Thread LIU Hao via Gcc-patches
option is for experimental and testing purposes only. -- Best regards, LIU Hao OpenPGP_signature Description: OpenPGP digital signature

Re: [PATCH] Add MinGW option -mcrtdll= for choosing C RunTime DLL library

2023-06-13 Thread LIU Hao via Gcc-patches
在 2023/6/13 14:29, Pali Rohár 写道: Of course, just I'm not sure where to put the new paragraph. At the beginning? Or after the text? What do you think? Maybe just in front of 'This option is available for MinGW targets.' Also you may reword it as you like. -- Best r

[PATCH] gcc: Remove size limit of PCH for *-*-mingw32 hosts

2023-02-16 Thread LIU Hao via Gcc-patches
-- Best regards, LIU Hao From a4d5e161fbaa5b9994077ffb474e2b55c6c3b3cb Mon Sep 17 00:00:00 2001 From: LIU Hao Date: Tue, 10 May 2022 13:19:07 +0800 Subject: [PATCH] gcc: Remove size limit of PCH for *-*-mingw32 hosts PCHs can now be relocated, so the size limit makes no sense any more. This

Attempt to resolve PR83562

2020-10-07 Thread Liu Hao via Gcc-patches
, LH_Mouse From ac325bdcd6e3fa522f8b59d436cd4b3ab663de5c Mon Sep 17 00:00:00 2001 From: Liu Hao Date: Thu, 8 Oct 2020 10:26:13 +0800 Subject: [PATCH] libsupc++: Make the destructor parameter to `__cxa_thread_atexit()` use the `__thiscall` calling convention for i686-w64-mingw32 The mingw-w64 imp

Re: libstdc++: Attempt to resolve PR83562

2020-10-08 Thread Liu Hao via Gcc-patches
在 2020/10/8 22:56, Jason Merrill 写道: > On 10/7/20 10:52 PM, Liu Hao via Gcc-patches wrote: >> [Please CC me as I am not subscribed to this list.] > > Hmm, why isn't the mingw implementation used for all programs?  That would > avoid the bug. > I am afraid the libstdc+

Adding a new thread model to GCC

2022-10-01 Thread LIU Hao via Gcc-patches
ested because I don't know how to bootstrap it. Objective-C is not supported, because threading APIs for libobjc have not been implemented. Please review. If there are any changes that I have to make, let me know. -- Best regards, LIU Hao From c522fa74c791ee8904b5906c6e18908b56071db5 Mon Se

Re: Adding a new thread model to GCC

2022-10-02 Thread LIU Hao via Gcc-patches
在 2022-10-02 04:02, Bernhard Reutner-Fischer 写道: On 1 October 2022 20:34:45 CEST, LIU Hao via Gcc-patches wrote: Greetings. The first patch is necessary because somewhere in libgfortran, `pthread_t` is referenced. If the thread model is not `posix`, it fails to compile. One of several

Re: Adding a new thread model to GCC

2022-10-04 Thread LIU Hao via Gcc-patches
read_self (); ``` so indeed `thread` should be `__gthread_t`. By the way I reported this issue four months ago and haven't received any response so far: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105764 -- Best regards, LIU Hao OpenPGP_signature Description: OpenPGP digital signature

Re: Adding a new thread model to GCC

2022-10-04 Thread LIU Hao via Gcc-patches
(with MSVCRT and UCRT). No errors have been observed so far. Once these patches land in GCC, we can start the work in mingw-w64 basing on `__USING_MCFGTHREAD__`. -- Best regards, LIU Hao From e1ab15fc95ac8180156feed410cacb64a41a9567 Mon Sep 17 00:00:00 2001 From: LIU Hao Date: Fri, 27 May

Re: Adding a new thread model to GCC

2022-10-04 Thread LIU Hao via Gcc-patches
it|[a]ll): y Unable to initialize SMTP properly. Check config and use --smtp-debug. VA LUES: server=smtp.126.com encryption=tls hello=localhost.localdomain port =465 at /usr/lib/git-core/git-send-email line 1684, line 3. ``` -- Best regards, LIU Hao OpenPGP_signature Description: OpenPGP digital signature

Re: Adding a new thread model to GCC

2022-10-10 Thread LIU Hao via Gcc-patches
在 2022-10-04 20:44, LIU Hao 写道: Attached are revised patches. These are exported from trunk. Revised further. The patch for libgfortran has been committed to trunk today, so I include only the other two. * In the second patch, a space character has been inserted after `(int)` for

Re: Adding a new thread model to GCC

2022-10-11 Thread LIU Hao via Gcc-patches
在 2022-10-10 23:56, LIU Hao 写道: 在 2022-10-04 20:44, LIU Hao 写道: Attached are revised patches. These are exported from trunk. Revised further. The patch for libgfortran has been committed to trunk today, so I include only the other two.   * In the second patch, a space character has been

Re: Adding a new thread model to GCC

2022-10-19 Thread LIU Hao via Gcc-patches
READ_NTDLL_SPEC ``` (NTDLL is only necessary when linking against the shared library.) The committed patch inserted MCFGTHREAD after KERNEL32 for simplicity, but if you do think we had better not repeat KERNEL32 twice, I can propose another patch. -- Best regards, LIU Hao OpenPGP_signature Description: OpenPGP digital signature

Re: Adding a new thread model to GCC

2022-10-21 Thread LIU Hao via Gcc-patches
x27;t know Windows well enough to determine which is better. I had the same question... I would like to understand what is the difference? Moreover I would like to understand what is the difference with the already added support for the winpthreads library? @LIU Hao, could you explain please?

Re: Adding a new thread model to GCC

2022-10-21 Thread LIU Hao via Gcc-patches
y. There are distributions that have win32 as the default thread model, such as Debian. * I personally need more control for future development, for example, re-implement pthread or adding libcxx support, which doesn't fit in GCC. -- Best regards, LIU Hao OpenPGP_signature Description: OpenPGP digital signature

Re: Adding a new thread model to GCC

2022-10-21 Thread LIU Hao via Gcc-patches
cture, protected by a spin lock. It's just another undocumented syscall. Keyed events are still functional. -- Best regards, LIU Hao OpenPGP_signature Description: OpenPGP digital signature

[PATCH] libgcc: Update 'gthr-mcf.h' to include a dedicated header for libobjc

2022-10-22 Thread LIU Hao via Gcc-patches
This allows building libobjc and enabling Objective-C. Tested against GCC 12 branch on i686-w64-mingw32. -- Best regards, LIU Hao From c05cceb2f3baa96c9381be38717bdf6f1f3adb76 Mon Sep 17 00:00:00 2001 From: LIU Hao Date: Sat, 22 Oct 2022 17:31:46 +0800 Subject: [PATCH] libgcc: Update '

Re: Adding a new thread model to GCC

2022-10-23 Thread LIU Hao via Gcc-patches
OSIX and ISO C specifies them as such, while all Windows APIs take relative durations as a 32-bit integer of milliseconds, which can also easily get overflown. -- Best regards, LIU Hao OpenPGP_signature Description: OpenPGP digital signature

[PATCH] Remove size limit of PCH

2022-05-10 Thread LIU Hao via Gcc-patches
7; program, and seen no problems so far. After eighteen years this has eventually been settled. (sigh) -- Best regards, LIU Hao From c084ab275f47cc27621e664d1c63e177525cf321 Mon Sep 17 00:00:00 2001 From: LIU Hao Date: Tue, 10 May 2022 13:19:07 +0800 Subject: [PATCH] Remove size limit of PCH

Re: [PATCH] Remove size limit of PCH

2022-05-10 Thread LIU Hao via Gcc-patches
在 2022-05-10 20:00, Xi Ruoyao 写道: On Tue, 2022-05-10 at 19:35 +0800, LIU Hao via Gcc-patches wrote: Subject: [PATCH] Remove size limit of PCH Make it "Remove size limit of PCH [PR14940]", so once it's committed a message will show up in bugzilla. Here is the revised patc

Re: [PATCH] Remove size limit of PCH

2022-05-11 Thread LIU Hao via Gcc-patches
rks in GCC, thus I'm gonna propose a patch to MSYS2 and see how it works. This can be committed to GCC later, after having been tested through many packages. -- Best regards, LIU Hao OpenPGP_signature Description: OpenPGP digital signature

Re: Fwd: libstdc++: Attempt to resolve PR83562

2020-11-06 Thread Liu Hao via Gcc-patches
Ping? 在 2020/10/29 下午3:56, Liu Hao 写道: > I forward it here for comments. > > Basing on the behavior of both GCC and Clang, `__cxa_thread_atexit` is used > to register the > destructor of thread_local objects directly, suggesting the first parameter > should have `__this

Re: [PATCH][RFC] Make mingw-w64 printf/scanf attribute alias to ms_printf/ms_scanf only for C89

2020-11-12 Thread Liu Hao via Gcc-patches
a few minutes ago. It's not gonna finish very soon so I send this patch for your comments. -- Best regards, LH_Mouse From 1d61adae0695e7067e35f36e607a754a7cf12796 Mon Sep 17 00:00:00 2001 From: Liu Hao Date: Thu, 12 Nov 2020 22:20:29 +0800 Subject: [PATCH] gcc: Add `ll` and `L` length modif

Re: [PATCH][RFC] Make mingw-w64 printf/scanf attribute alias to ms_printf/ms_scanf only for C89

2020-11-12 Thread Liu Hao via Gcc-patches
在 2020/11/12 23:12, Liu Hao 写道: > > My humble opinion is that people should have gotten used to the `ll` > specifier so I propose a > different patch that enables it unconditionally. As Jonathan Yong pointed > out, GCC is impossible to The previous patch missed a `double_name` f

Re: [PATCH][RFC] Make mingw-w64 printf/scanf attribute alias to ms_printf/ms_scanf only for C89

2020-11-12 Thread Liu Hao via Gcc-patches
3d967e6523b87507 Mon Sep 17 00:00:00 2001 From: Liu Hao Date: Thu, 12 Nov 2020 22:20:29 +0800 Subject: [PATCH] gcc: Add `ll` and `L` length modifiers for `ms_printf` Previous code abuse `FMT_LEN_L` for the `I` modifier. As `L` is a valid modifier for `f`, `e`, `g`, etc. and `I` has the same semant

Re: [PATCH][RFC] Make mingw-w64 printf/scanf attribute alias to ms_printf/ms_scanf only for C89

2020-11-13 Thread Liu Hao via Gcc-patches
在 2020/11/14 上午8:12, Joseph Myers 写道: > On Fri, 13 Nov 2020, Liu Hao via Gcc-patches wrote: > >> 在 2020/11/13 2:46, Joseph Myers 写道: >>> I'd expect these patches to include updates to the gcc.dg/format/ms_*.c >>> tests to reflect the changed semantics

Re: [PATCH][RFC] Make mingw-w64 printf/scanf attribute alias to ms_printf/ms_scanf only for C89

2020-11-14 Thread Liu Hao via Gcc-patches
ength modifier'. This was caused by mistaken array indices in `TARGET_OVERRIDES_FORMAT_INIT`. -- Best regards, LH_Mouse From f73d5dcdc61a5da1a4265b144739067b4ec40ec2 Mon Sep 17 00:00:00 2001 From: Liu Hao Date: Thu, 12 Nov 2020 22:20:29 +0800 Subject: [PATCH] gcc: Add `ll` and `L` length mod

[PATCH] Always define `WIN32_LEAN_AND_MEAN` before

2023-01-06 Thread LIU Hao via Gcc-patches
nd JIT, on {i868,x86_64}-w64-mingw32; but it contains changes to Ada, libgo, libgomp and libvtv, which I don't usually build and test. -- Best regards, LIU Hao From 6600e2b135bd06b2aad77e538b47a480c8deebdd Mon Sep 17 00:00:00 2001 From: LIU Hao Date: Fri, 6 Jan 2023 23:18:15 +0800 S

[PATCH] Ensure `-lmsvcrt` precede `-lkernel32`

2020-05-29 Thread Liu Hao via Gcc-patches
This is necessary as libmsvcrt.a is not a pure import library, but also contains some functions that invoke others in KERNEL32.DLL. * config/i386/mingw32.h: Insert -lkernel32 after -lmsvcrt --- gcc/config/i386/mingw32.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/g

Re: [PATCH] Ensure `-lmsvcrt` precede `-lkernel32`

2020-05-29 Thread Liu Hao via Gcc-patches
在 2020/5/29 22:01, Liu Hao 写道: > This is necessary as libmsvcrt.a is not a pure import library, but > also contains some functions that invoke others in KERNEL32.DLL. > > * config/i386/mingw32.h: Insert -lkernel32 after -lmsvcrt > --- > gcc/config/i386/mingw32.h | 2 +- &g

Re: libstdc++: Attempt to resolve PR83562

2020-10-27 Thread Liu Hao via Gcc-patches
在 2020/10/8 22:56, Jason Merrill 写道: > > Hmm, why isn't the mingw implementation used for all programs?  That would > avoid the bug. > There was a little further discussion about this [1]. TL;DR: The mingw-w64 function is linked statically and subject to issues about order of destruction. Re

Fwd: libstdc++: Attempt to resolve PR83562

2020-10-29 Thread Liu Hao via Gcc-patches
oject/blob/97b351a827677ebbedc10bfbce8ef8844c246553/libcxxabi/src/cxa_thread_atexit.cpp#L22 转发的消息 主题: Re: libstdc++: Attempt to resolve PR83562 日期: Tue, 27 Oct 2020 22:38:29 +0800 发件人: Liu Hao 收件人: Jason Merrill , GCC Patches 在 2020/10/8 22:56, Jason Merrill 写道: > > Hmm, why isn't the ming

Re: why does gccgit require pthread?

2022-11-06 Thread LIU Hao via Gcc-patches
lto,c++,fortran,objc,obj-c++` and with the `mcf` thread model; no errors observed. The built `libgccjit-0.dll` does not have imports from winpthread any more. Please review. -- Best regards, LIU Hao From ceb65f21b5ac23ce218efee82f40f641ebe44361 Mon Sep 17 00:00:00 2001 From: LIU Hao Date: Mon,

Re: why does gccgit require pthread?

2022-11-06 Thread LIU Hao via Gcc-patches
e not used inside GCC and the include of mutex should be done early. Well I am not familiar with such behavior. Feel free to amend the patch, until it looks good to you. I hope we can check this in before GCC 13 RC. -- Best regards, LIU Hao OpenPGP_signature Description: OpenPGP digital signature

Re: why does gccgit require pthread?

2022-11-07 Thread LIU Hao via Gcc-patches
ccess to GCC repo, and it takes a couple of hours for me to bootstrap GCC just for this tiny change. -- Best regards, LIU Hao OpenPGP_signature Description: OpenPGP digital signature

Re: why does gccgit require pthread?

2022-11-14 Thread LIU Hao via Gcc-patches
在 2022/11/12 02:27, Jonathan Wakely 写道: A clean build fixed that. This patch bootstraps and passes testing on x86_64-pc-linux-gnu (CentOS 8 Stream). OK for trunk? What should we do if no one has been approving this patch? -- Best regards, LIU Hao OpenPGP_signature Description: OpenPGP

Re: [PATCH 3/4] libbacktrace: work with aslr on windows

2023-01-21 Thread LIU Hao via Gcc-patches
lling wide APIs explicitly, such overhead can be avoided. -- Best regards, LIU Hao OpenPGP_signature Description: OpenPGP digital signature

[PATCH] libgfortran: Use `__gthread_t` instead of `pthread_t`

2022-05-27 Thread LIU Hao via Gcc-patches
The attached patch addresses a build issue when is not included. Please review. -- Best regards, LIU Hao From 7b573e4cdb7c3b666baac4c38046c64a01b6dcb5 Mon Sep 17 00:00:00 2001 From: LIU Hao Date: Fri, 27 May 2022 23:12:48 +0800 Subject: [PATCH] libgfortran: Use `__gthread_t` instead of

Re: why does gcc jit require pthread?

2022-11-19 Thread LIU Hao via Gcc-patches
. Thanks, I've pushed it to trunk now. Thank you for taking care of it! -- Best regards, LIU Hao OpenPGP_signature Description: OpenPGP digital signature