Skip to content
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

[cryptopp] clang-cl: fix compilation with cryptopp/gzip.h #40679

Merged
merged 6 commits into from
Sep 8, 2024

Conversation

rressi-at-globus
Copy link
Contributor

@rressi-at-globus rressi-at-globus commented Aug 28, 2024

Fixes #37227

When we use library cryptopp from a CMake project, we have compilation issue on Debug with this
simple inclusion directive:

#include <cryptopp/gzip.h>

Occurs with:

  • Triplet: x64-windows
  • llvm: 16.0.6, 18.1.8
  • Microsoft Visual C SDK: 14.36.32532
  • Microsoft Windows SDK: 10.0.20348.0

For references I report here some traces from my toolchain file:

[cmake] -- CMAKE_C_COMPILER: C:/Program Files/LLVM/bin/clang-cl.exe
[cmake] -- CMAKE_C_COMPILER_ID: Clang
[cmake] -- CMAKE_C_STANDARD_INCLUDE_DIRECTORIES: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.36.32532/include
[cmake] -- CMAKE_CXX_COMPILER: C:/Program Files/LLVM/bin/clang-cl.exe
[cmake] -- CMAKE_CXX_COMPILER_ID: Clang
[cmake] -- CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.36.32532/include
[cmake] -- CMAKE_CXX_STANDARD: 20
[cmake] -- CMAKE_LINK: C:/Program Files/LLVM/bin/lld-link.exe
[cmake] -- CMAKE_MT: C:/Program Files (x86)/Windows Kits/10/bin/10.0.20348.0/x64/mt.exe
[cmake] -- CMAKE_RC_COMPILER: C:/Program Files (x86)/Windows Kits/10/bin/10.0.20348.0/x64/rc.exe

/// have to provide a template class member called rebind".
template <class V> struct rebind { typedef AllocatorWithCleanup<V, T_Align16> other; };
-#if (CRYPTOPP_MSC_VERSION >= 1500)
+#if (CRYPTOPP_MSC_VERSION >= 1500) || defined(__clang__)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rressi-at-globus rressi-at-globus marked this pull request as ready for review August 28, 2024 08:40
@Cheney-W
Copy link
Contributor

Please modify the vcpkg.json file as below:

  "name": "cryptopp",
  "version": "8.9.0",
  "port-version": 1,

@Cheney-W Cheney-W added the category:port-bug The issue is with a library, which is something the port should already support label Aug 29, 2024
@Cheney-W Cheney-W marked this pull request as draft August 29, 2024 05:47
rressi-at-globus and others added 2 commits September 2, 2024 19:00
Update git-tree for version 8.9.0
@rressi-at-globus rressi-at-globus marked this pull request as ready for review September 4, 2024 02:09
@Cheney-W
Copy link
Contributor

Cheney-W commented Sep 4, 2024

@Cheney-W Cheney-W marked this pull request as draft September 4, 2024 02:40
@rressi-at-globus rressi-at-globus marked this pull request as ready for review September 5, 2024 17:52
versions/c-/cryptopp.json Outdated Show resolved Hide resolved
@Cheney-W Cheney-W marked this pull request as draft September 6, 2024 02:51
@rressi-at-globus rressi-at-globus marked this pull request as ready for review September 6, 2024 06:38
@Cheney-W Cheney-W added the info:reviewed Pull Request changes follow basic guidelines label Sep 6, 2024
@vicroms vicroms merged commit a01cae2 into microsoft:master Sep 8, 2024
16 checks passed
@rressi-at-globus rressi-at-globus deleted the feature/cryptopp-8.9.0_1 branch October 28, 2024 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[cryptopp] build failure using clang-cl (Windows)
3 participants