-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Avoid conflict between mingw-std-threads and Clang's own #85208
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
I agree with using the same mingw-std-threads implementation on all toolchains.
I think I've messed up the condition. Will force-push in a minute. |
cb0579b
to
68fa1da
Compare
The new condition makes sense to me, but the patch file seems out of sync. |
99bd090
to
6aea7e1
Compare
Please let me know how it looks now. I can't trust my eyes today anymore. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Tested with llvm-mingw Clang on Windows and seems to now build and run after some quick test, fixes the build errors I mentioned on RocketChat. One extra change is needed to fix building with int errnum = errno; |
6aea7e1
to
205066a
Compare
@bitsawer Thanks lots for testing! Suggestion applied. |
Thanks! |
Since mingw-std-threads would inject its symbols into
std
if it thinks there's no other implementation around while using a MinGW compiler (#if (__cplusplus < 201703L) || (defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS))
, it will break LLVM-MinGW builds. The reason is that LLVM-MinGW provides implementations but doesn't define_GLIBCXX_HAS_GTHREADS
.This PR rewrites the patch to change the check to
(#if defined(__MINGW32__ ) && !(defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__))
#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__)
).Another option would have been just not to use mingw-std-threads at all on LLVM-MinGW, but I see value in using the same implemention in both MinGW-style compilers. Other opinions welcome.