Skip to content

Commit

Permalink
[ngtcp2] Fix __popcnt intrinsics on arm64.
Browse files Browse the repository at this point in the history
  • Loading branch information
BillyONeal committed Sep 16, 2024
1 parent 0ac82df commit 929b25b
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
13 changes: 13 additions & 0 deletions ports/ngtcp2/popcnt_intrinsic.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/lib/ngtcp2_ringbuf.c b/lib/ngtcp2_ringbuf.c
index c381c23..73d9230 100644
--- a/lib/ngtcp2_ringbuf.c
+++ b/lib/ngtcp2_ringbuf.c
@@ -32,7 +32,7 @@
#include "ngtcp2_macro.h"

#if defined(_MSC_VER) && !defined(__clang__) && \
- (defined(_M_ARM) || defined(_M_ARM64))
+ (defined(_M_ARM) || (defined(_M_ARM64) && _MSC_VER < 1941))
static unsigned int __popcnt(unsigned int x) {
unsigned int c = 0;
for (; x; ++c) {
9 changes: 5 additions & 4 deletions ports/ngtcp2/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@ vcpkg_from_github(
SHA512 891a7339122f60b1796bb24d29ab75d0316717c2a64a45bade805242b70cb8713abc7642cdf0ec646ab9e80085d65117f0ea9b1e671d76bcd54038b0ea9bc868
HEAD_REF main
PATCHES
openssl_required.patch
openssl_required.patch
popcnt_intrinsic.patch # https://github.com/ngtcp2/ngtcp2/pull/1351
)

string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ENABLE_STATIC_LIB)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ENABLE_SHARED_LIB)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
wolfssl ENABLE_WOLFSSL
gnutls ENABLE_GNUTLS
libressl ENABLE_OPENSSL
wolfssl ENABLE_WOLFSSL
gnutls ENABLE_GNUTLS
libressl ENABLE_OPENSSL
)

vcpkg_cmake_configure(
Expand Down
1 change: 1 addition & 0 deletions ports/ngtcp2/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "ngtcp2",
"version": "1.7.0",
"port-version": 1,
"description": "ngtcp2 project is an effort to implement RFC9000 QUIC protocol.",
"homepage": "https://github.com/ngtcp2/ngtcp2",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6286,7 +6286,7 @@
},
"ngtcp2": {
"baseline": "1.7.0",
"port-version": 0
"port-version": 1
},
"nifly": {
"baseline": "1.0.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/n-/ngtcp2.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "b0694dae4b89a7212beb478571821e45c3715335",
"version": "1.7.0",
"port-version": 1
},
{
"git-tree": "909f14f6bf7e0e65f72114fed6c3deb990755ba6",
"version": "1.7.0",
Expand Down

0 comments on commit 929b25b

Please sign in to comment.