-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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
Unable to build v29.3 with clang-cl #19975
Comments
Thanks for the report! Unfortunately clang-cl is best effort support (not part of the official Google C++ support matrix), but we do intend for this to work. I believe the first issue has already been corrected at tip of main. The second issue looks more odd, and the proposed fix is unlikely to be the right one (it is explicitly commented that its for a case exactly like this to intentionally fall back to the clang path instead of the msvc one). Can you paste more of the error message to see what the right fix might be? |
Yes it has. These are the errors about constinit with current main:
I am not sure if it is meant to use the clang path for clang-cl on windows. It could simple always use the MSVC path. |
We could relax the requirement there. We have clients using clang for windows that would see dynamic initialization there as a regression, so having the It is unfortunate that it doesn't give more details as to why it "does not have a constant initializer". Maybe we can change that first branch as:
That way we drop the |
They are not constant (at least due to /DYNAMICBASE being the default). Currently having problems building Release since I run into:
I declared |
What version of protobuf and what language are you using?
Version: v29.3
Language: C++
What operating system (Linux, Windows, ...) and version?
Windows 11
What runtime / compiler are you using (e.g., python version or gcc version)
clang-cl 19.1.6
What did you do?
Setup toolchain with clang-cl
Build protobuf (via vcpkg)
What did you expect to see
Successful build
What did you see instead?
Anything else we should know about your project / environment
One solution:
PROTOBUF_EXPORT
fromDynamicMapField
since it lives ininternal
namespace any way and should probably not exportednext error after that is:
Removing
&& !defined(__clang__)
fromprotobuf/src/google/protobuf/port_def.inc
Line 418 in 4214ee7
fixes the build
The text was updated successfully, but these errors were encountered: