mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-14 22:58:00 +08:00
[protobuf] Add Compiler Condition to use inline assembly optimizations with ARM64 (#40173)
This commit is contained in:
parent
4f597750e8
commit
b43e7adc6f
22
ports/protobuf/fix-arm64-msvc.patch
Normal file
22
ports/protobuf/fix-arm64-msvc.patch
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
diff --git a/src/google/protobuf/parse_context.h b/src/google/protobuf/parse_context.h
|
||||||
|
index df12ee1ab..3eb2e56c7 100644
|
||||||
|
--- a/src/google/protobuf/parse_context.h
|
||||||
|
+++ b/src/google/protobuf/parse_context.h
|
||||||
|
@@ -653,7 +653,7 @@ inline const char* VarintParseSlow(const char* p, uint32_t res, uint64_t* out) {
|
||||||
|
return tmp.first;
|
||||||
|
}
|
||||||
|
|
||||||
|
-#ifdef __aarch64__
|
||||||
|
+#if defined(__aarch64__) && !defined(_MSC_VER)
|
||||||
|
// Generally, speaking, the ARM-optimized Varint decode algorithm is to extract
|
||||||
|
// and concatenate all potentially valid data bits, compute the actual length
|
||||||
|
// of the Varint, and mask off the data bits which are not actually part of the
|
||||||
|
@@ -883,7 +883,7 @@ static const char* VarintParseSlowArm(const char* p, uint64_t* out,
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
PROTOBUF_NODISCARD const char* VarintParse(const char* p, T* out) {
|
||||||
|
-#if defined(__aarch64__) && defined(PROTOBUF_LITTLE_ENDIAN)
|
||||||
|
+#if defined(__aarch64__) && defined(PROTOBUF_LITTLE_ENDIAN) && !defined(_MSC_VER)
|
||||||
|
// This optimization is not supported in big endian mode
|
||||||
|
uint64_t first8;
|
||||||
|
std::memcpy(&first8, p, sizeof(first8));
|
@ -8,6 +8,7 @@ vcpkg_from_github(
|
|||||||
fix-static-build.patch
|
fix-static-build.patch
|
||||||
fix-default-proto-file-path.patch
|
fix-default-proto-file-path.patch
|
||||||
fix-utf8-range.patch
|
fix-utf8-range.patch
|
||||||
|
fix-arm64-msvc.patch
|
||||||
)
|
)
|
||||||
|
|
||||||
string(COMPARE EQUAL "${TARGET_TRIPLET}" "${HOST_TRIPLET}" protobuf_BUILD_PROTOC_BINARIES)
|
string(COMPARE EQUAL "${TARGET_TRIPLET}" "${HOST_TRIPLET}" protobuf_BUILD_PROTOC_BINARIES)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "protobuf",
|
"name": "protobuf",
|
||||||
"version": "4.25.1",
|
"version": "4.25.1",
|
||||||
|
"port-version": 1,
|
||||||
"description": "Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data.",
|
"description": "Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data.",
|
||||||
"homepage": "https://github.com/protocolbuffers/protobuf",
|
"homepage": "https://github.com/protocolbuffers/protobuf",
|
||||||
"license": "BSD-3-Clause",
|
"license": "BSD-3-Clause",
|
||||||
|
@ -7086,7 +7086,7 @@
|
|||||||
},
|
},
|
||||||
"protobuf": {
|
"protobuf": {
|
||||||
"baseline": "4.25.1",
|
"baseline": "4.25.1",
|
||||||
"port-version": 0
|
"port-version": 1
|
||||||
},
|
},
|
||||||
"protobuf-c": {
|
"protobuf-c": {
|
||||||
"baseline": "1.5.0",
|
"baseline": "1.5.0",
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"versions": [
|
"versions": [
|
||||||
|
{
|
||||||
|
"git-tree": "5479e9c75e5ed6401d10163a0fa8f281dcf33f0f",
|
||||||
|
"version": "4.25.1",
|
||||||
|
"port-version": 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"git-tree": "278ba5370a8c59bbb60650d6ad91ae1eab0fadad",
|
"git-tree": "278ba5370a8c59bbb60650d6ad91ae1eab0fadad",
|
||||||
"version": "4.25.1",
|
"version": "4.25.1",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user