New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for mcf thread model #659
Conversation
What's the error? While building libstdc++, its configure script checks for existence of However
There may be conflicts. I think we can apply them on trunk, then cherry-pick them to the v11 branch, then re-format-patch them.
If we link GCC against the unpatched CRT, then no special action is necessary. GCC is single-threaded, so it doesn't matter what CRT itself is linked against; only GCC libraries (libgcc, libstdc++, libobjc, libgfortran, etc.) matter. If we want to link GCC against the patched CRT which references
We may take the comments from https://www.mingw-w64.org/downloads/#gcc-with-the-mcf-thread-model but it's a bit out of date. I shall update it a little a few moments later. |
I got a bunch of undeclared identifier errors like this:
/* Dummy header, which gets overridden, if winpthread library gets installed. */ I have no idea why a dummy header is installed.
Sounds like this patch is useful for the win32 thread model as well.
I think we at least want to support the latest release branch (v11), so let's do that before merging this PR.
What about the prerequisites like zlib, libiconv, gmp, mpfr, etc? They are built before CRT. |
Ah I see. The patch only move the implementation of Therefore the patch should be considered incomplete, as 'pthread_time.h' from winpthreads should be installed by hand before building the CRT.
I suggest you check 'c++config.h' in the
Those can be rebuilt with the new GCC. however I don't rebuild them. |
I'm considering to try |
CI finally ran successfully, so I checked
We always pass |
The result looks correct. Was it the case that winpthreads was not installed before building GCC? Failure to reference Anyway I have filed a PR to MSYS2: msys2/MINGW-packages#18667 |
We always install winpthreads before building gcc. Also, regardless of the target thread model, we use gcc with the posix thread model as host toolchains by default. |
Build and install mcfgthread library when the mcf thread model is selected.
I see. Here is a test program: The C++ standard requires that all
which violates the standard (the destructor of With the
|
Found the original issue for the This report says 'several projects fail to build because
With winpthreads, |
I just tried building with sjlj exception handling and gcc fails to build during stage 2:
@lhmouse Are mcf and sjlj incompatible? If so, I'll add a test in the build script to reject that configuration. |
In theory, no. I used to build GCC with SJLJ exception model many years ago and there was no build issue. |
I see. Since sjlj is rarely used these days, I'll leave it as is until someone complains. |
merged. thank you guys! |
WIP. I think it's easier for us to discuss the issues when we have actual code.
I couldn't buildThis patch seems unnecessary.9004-crt-Copy-clock-and-nanosleep-from-winpthreads.patch
so I commented it out.The CRT patches only apply toFixed.trunk
and not v11.How do we bootstrap the first toolchain?Apparently we don't have to.Closes #658.