diff options
| -rw-r--r-- | ports/grpc/00008-fix-duplicate-gettid.patch | 66 | ||||
| -rw-r--r-- | ports/grpc/CONTROL | 2 | ||||
| -rw-r--r-- | ports/grpc/portfile.cmake | 1 |
3 files changed, 68 insertions, 1 deletions
diff --git a/ports/grpc/00008-fix-duplicate-gettid.patch b/ports/grpc/00008-fix-duplicate-gettid.patch new file mode 100644 index 000000000..f093eb432 --- /dev/null +++ b/ports/grpc/00008-fix-duplicate-gettid.patch @@ -0,0 +1,66 @@ +diff --git a/src/core/lib/gpr/log_linux.cc b/src/core/lib/gpr/log_linux.cc +index 561276f..1fef59b 100644 +--- a/src/core/lib/gpr/log_linux.cc ++++ b/src/core/lib/gpr/log_linux.cc +@@ -40,7 +40,7 @@ + #include <time.h> + #include <unistd.h> + +-static long gettid(void) { return syscall(__NR_gettid); } ++static long _intl_gettid(void) { return syscall(__NR_gettid); } + + void gpr_log(const char* file, int line, gpr_log_severity severity, + const char* format, ...) { +@@ -70,7 +70,7 @@ void gpr_default_log(gpr_log_func_args* args) { + gpr_timespec now = gpr_now(GPR_CLOCK_REALTIME); + struct tm tm; + static __thread long tid = 0; +- if (tid == 0) tid = gettid(); ++ if (tid == 0) tid = _intl_gettid(); + + timer = static_cast<time_t>(now.tv_sec); + final_slash = strrchr(args->file, '/'); +diff --git a/src/core/lib/gpr/log_posix.cc b/src/core/lib/gpr/log_posix.cc +index b6edc14..4bd42fd 100644 +--- a/src/core/lib/gpr/log_posix.cc ++++ b/src/core/lib/gpr/log_posix.cc +@@ -31,7 +31,7 @@ + #include <string.h> + #include <time.h> + +-static intptr_t gettid(void) { return (intptr_t)pthread_self(); } ++static intptr_t _intl_gettid(void) { return (intptr_t)pthread_self(); } + + void gpr_log(const char* file, int line, gpr_log_severity severity, + const char* format, ...) { +@@ -86,7 +86,7 @@ void gpr_default_log(gpr_log_func_args* args) { + char* prefix; + gpr_asprintf(&prefix, "%s%s.%09d %7" PRIdPTR " %s:%d]", + gpr_log_severity_string(args->severity), time_buffer, +- (int)(now.tv_nsec), gettid(), display_file, args->line); ++ (int)(now.tv_nsec), _intl_gettid(), display_file, args->line); + + fprintf(stderr, "%-70s %s\n", prefix, args->message); + gpr_free(prefix); +diff --git a/src/core/lib/iomgr/ev_epollex_linux.cc b/src/core/lib/iomgr/ev_epollex_linux.cc +index 08116b3..d48fd8d 100644 +--- a/src/core/lib/iomgr/ev_epollex_linux.cc ++++ b/src/core/lib/iomgr/ev_epollex_linux.cc +@@ -1102,7 +1102,7 @@ static void end_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, + } + + #ifndef NDEBUG +-static long gettid(void) { return syscall(__NR_gettid); } ++static long _intl_gettid(void) { return syscall(__NR_gettid); } + #endif + + /* pollset->mu lock must be held by the caller before calling this. +@@ -1122,7 +1122,7 @@ static grpc_error* pollset_work(grpc_pollset* pollset, + #define WORKER_PTR (&worker) + #endif + #ifndef NDEBUG +- WORKER_PTR->originator = gettid(); ++ WORKER_PTR->originator = _intl_gettid(); + #endif + if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + gpr_log(GPR_INFO, diff --git a/ports/grpc/CONTROL b/ports/grpc/CONTROL index ce9c7c04e..09177e35d 100644 --- a/ports/grpc/CONTROL +++ b/ports/grpc/CONTROL @@ -1,5 +1,5 @@ Source: grpc -Version: 1.23.1 +Version: 1.23.1-1 Build-Depends: zlib, openssl, protobuf, c-ares (!uwp) Homepage: https://github.com/grpc/grpc Description: An RPC library and framework diff --git a/ports/grpc/portfile.cmake b/ports/grpc/portfile.cmake index effb80cd5..c7a5fbe7d 100644 --- a/ports/grpc/portfile.cmake +++ b/ports/grpc/portfile.cmake @@ -24,6 +24,7 @@ vcpkg_from_github( 00005-fix-uwp-error.patch 00006-crypt32.patch 00007-disable_grpcpp_channelz.patch + 00008-fix-duplicate-gettid.patch ) if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") |
