Skip to content
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 34 additions & 34 deletions ports/grpc/00005-fix-uwp-error.patch
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
diff --git a/src/core/lib/slice/slice.cc b/src/core/lib/slice/slice.cc
index 0dacbfef3e..0743a1b003 100644
--- a/src/core/lib/slice/slice.cc
+++ b/src/core/lib/slice/slice.cc
@@ -234,6 +234,7 @@ grpc_slice grpc_slice_from_moved_buffer(grpc_core::UniquePtr<char> p,
size_t len) {
uint8_t* ptr = reinterpret_cast<uint8_t*>(p.get());
grpc_slice slice;
+ memset(&slice, 0, sizeof(grpc_slice));
if (len <= sizeof(slice.data.inlined.bytes)) {
slice.refcount = nullptr;
slice.data.inlined.length = len;
@@ -253,7 +254,7 @@ grpc_slice grpc_slice_from_moved_string(grpc_core::UniquePtr<char> p) {
}
grpc_slice grpc_slice_from_cpp_string(std::string str) {
- grpc_slice slice;
+ grpc_slice slice = { 0 };
if (str.size() <= sizeof(slice.data.inlined.bytes)) {
slice.refcount = nullptr;
slice.data.inlined.length = str.size();
diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc
index c94551545d..3fd9797316 100644
--- a/src/core/lib/surface/server.cc
+++ b/src/core/lib/surface/server.cc
@@ -878,7 +878,7 @@ grpc_call_error Server::QueueRequestedCall(size_t cq_idx, RequestedCall* rc) {
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Server Shutdown"));
return GRPC_CALL_OK;
}
- RequestMatcherInterface* rm;
+ RequestMatcherInterface* rm = nullptr;
switch (rc->type) {
case RequestedCall::Type::BATCH_CALL:
rm = unregistered_request_matcher_.get();
diff --git a/src/core/lib/slice/slice.cc b/src/core/lib/slice/slice.cc
Comment thread
JonLiu1993 marked this conversation as resolved.
Outdated
index 0dacbfef3e..0743a1b003 100644
--- a/src/core/lib/slice/slice.cc
+++ b/src/core/lib/slice/slice.cc
@@ -234,6 +234,7 @@ grpc_slice grpc_slice_from_moved_buffer(grpc_core::UniquePtr<char> p,
size_t len) {
uint8_t* ptr = reinterpret_cast<uint8_t*>(p.get());
grpc_slice slice;
+ memset(&slice, 0, sizeof(grpc_slice));
if (len <= sizeof(slice.data.inlined.bytes)) {
slice.refcount = nullptr;
slice.data.inlined.length = len;
@@ -253,7 +254,7 @@ grpc_slice grpc_slice_from_moved_string(grpc_core::UniquePtr<char> p) {
}

grpc_slice grpc_slice_from_cpp_string(std::string str) {
- grpc_slice slice;
+ grpc_slice slice = { 0 };
if (str.size() <= sizeof(slice.data.inlined.bytes)) {
slice.refcount = nullptr;
slice.data.inlined.length = str.size();
diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc
index c94551545d..3fd9797316 100644
--- a/src/core/lib/surface/server.cc
+++ b/src/core/lib/surface/server.cc
@@ -878,7 +878,7 @@ grpc_call_error Server::QueueRequestedCall(size_t cq_idx, RequestedCall* rc) {
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Server Shutdown"));
return GRPC_CALL_OK;
}
- RequestMatcherInterface* rm;
+ RequestMatcherInterface* rm = nullptr;
switch (rc->type) {
case RequestedCall::Type::BATCH_CALL:
rm = unregistered_request_matcher_.get();
164 changes: 78 additions & 86 deletions ports/grpc/00009-use-system-upb.patch
Original file line number Diff line number Diff line change
@@ -1,86 +1,78 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c87e35a..24b619f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -84,6 +84,9 @@ set_property(CACHE gRPC_SSL_PROVIDER PROPERTY STRINGS "module" "package")
set(gRPC_PROTOBUF_PROVIDER "module" CACHE STRING "Provider of protobuf library")
set_property(CACHE gRPC_PROTOBUF_PROVIDER PROPERTY STRINGS "module" "package")

+set(gRPC_UPB_PROVIDER "module" CACHE STRING "Provider of upb library")
+set_property(CACHE gRPC_UPB_PROVIDER PROPERTY STRINGS "module" "package")
+
set(gRPC_PROTOBUF_PACKAGE_TYPE "" CACHE STRING "Algorithm for searching protobuf package")
set_property(CACHE gRPC_PROTOBUF_PACKAGE_TYPE PROPERTY STRINGS "CONFIG" "MODULE")

@@ -2079,7 +2082,6 @@ target_link_libraries(grpc
gpr
${_gRPC_SSL_LIBRARIES}
address_sorting
- upb
)
if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC)
target_link_libraries(grpc "-framework CoreFoundation")
@@ -2624,7 +2626,6 @@ target_link_libraries(grpc_unsecure
absl::statusor
gpr
address_sorting
- upb
)
if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC)
target_link_libraries(grpc_unsecure "-framework CoreFoundation")
@@ -3805,7 +3806,7 @@ if(gRPC_INSTALL)
endif()

endif()
-
+if (gRPC_UPB_PROVIDER STREQUAL "module")
add_library(upb
third_party/upb/upb/decode_fast.c
third_party/upb/upb/decode.c
@@ -3863,7 +3864,7 @@ if(gRPC_INSTALL)
)
endif()

-
+endif()

add_executable(check_epollexclusive
test/build/check_epollexclusive.c
diff --git a/cmake/gRPCConfig.cmake.in b/cmake/gRPCConfig.cmake.in
index 3623f4a..df6ced5 100644
--- a/cmake/gRPCConfig.cmake.in
+++ b/cmake/gRPCConfig.cmake.in
@@ -8,6 +8,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules)
@_gRPC_FIND_CARES@
@_gRPC_FIND_ABSL@
@_gRPC_FIND_RE2@
+@_gRPC_FIND_UPB@

# Targets
include(${CMAKE_CURRENT_LIST_DIR}/gRPCTargets.cmake)
diff --git a/cmake/upb.cmake b/cmake/upb.cmake
index f2a0e50..c1c65f5 100644
--- a/cmake/upb.cmake
+++ b/cmake/upb.cmake
@@ -12,9 +12,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.

+set(_gRPC_UPB_GRPC_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-generated" "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upbdefs-generated")
+if (gRPC_UPB_PROVIDER STREQUAL "module")
+
set(UPB_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/upb)

set(_gRPC_UPB_INCLUDE_DIR "${UPB_ROOT_DIR}")
set(_gRPC_UPB_GRPC_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-generated" "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upbdefs-generated")

set(_gRPC_UPB_LIBRARIES upb)
+
+
+elseif(gRPC_UPB_PROVIDER STREQUAL "package")
+ find_package(upb CONFIG REQUIRED)
+ set(_gRPC_UPB_LIBRARIES upb::upb)
+ set(_gRPC_UPB_INCLUDE_DIR)
+ set(upb ${_gRPC_UPB_LIBRARIES})
+ set(_gRPC_FIND_UPB "if(NOT upb_FOUND)\n find_package(upb CONFIG REQUIRED)\nendif()")
+endif()
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1c3146b..ae06ea3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -84,6 +84,9 @@ set_property(CACHE gRPC_SSL_PROVIDER PROPERTY STRINGS "module" "package")
set(gRPC_PROTOBUF_PROVIDER "module" CACHE STRING "Provider of protobuf library")
set_property(CACHE gRPC_PROTOBUF_PROVIDER PROPERTY STRINGS "module" "package")

+set(gRPC_UPB_PROVIDER "module" CACHE STRING "Provider of upb library")
+set_property(CACHE gRPC_UPB_PROVIDER PROPERTY STRINGS "module" "package")
+
set(gRPC_PROTOBUF_PACKAGE_TYPE "" CACHE STRING "Algorithm for searching protobuf package")
set_property(CACHE gRPC_PROTOBUF_PACKAGE_TYPE PROPERTY STRINGS "CONFIG" "MODULE")

@@ -1504,7 +1507,6 @@ target_link_libraries(gpr
absl::synchronization
absl::time
absl::optional
- upb
)
if(_gRPC_PLATFORM_ANDROID)
target_link_libraries(gpr
@@ -3927,6 +3929,7 @@ endif()

endif()

+if (gRPC_UPB_PROVIDER STREQUAL "module")
add_library(upb
third_party/upb/upb/decode_fast.c
third_party/upb/upb/decode.c
@@ -3984,7 +3987,7 @@ if(gRPC_INSTALL)
)
endif()

-
+endif()

add_executable(check_epollexclusive
test/build/check_epollexclusive.c
diff --git a/cmake/gRPCConfig.cmake.in b/cmake/gRPCConfig.cmake.in
index 3623f4a..df6ced5 100644
--- a/cmake/gRPCConfig.cmake.in
+++ b/cmake/gRPCConfig.cmake.in
@@ -8,6 +8,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules)
@_gRPC_FIND_CARES@
@_gRPC_FIND_ABSL@
@_gRPC_FIND_RE2@
+@_gRPC_FIND_UPB@

# Targets
include(${CMAKE_CURRENT_LIST_DIR}/gRPCTargets.cmake)
diff --git a/cmake/upb.cmake b/cmake/upb.cmake
index f2a0e50..ac6d397 100644
--- a/cmake/upb.cmake
+++ b/cmake/upb.cmake
@@ -12,9 +12,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.

+set(_gRPC_UPB_GRPC_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-generated" "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upbdefs-generated")
+if (gRPC_UPB_PROVIDER STREQUAL "module")
+
set(UPB_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/upb)

set(_gRPC_UPB_INCLUDE_DIR "${UPB_ROOT_DIR}")
set(_gRPC_UPB_GRPC_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-generated" "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upbdefs-generated")

set(_gRPC_UPB_LIBRARIES upb)
+
+
+elseif(gRPC_UPB_PROVIDER STREQUAL "package")
+ find_package(upb CONFIG REQUIRED)
+ set(_gRPC_UPB_LIBRARIES upb::upb)
+ set(_gRPC_UPB_INCLUDE_DIR)
+ set(upb ${_gRPC_UPB_LIBRARIES})
+ set(_gRPC_FIND_UPB "if(NOT upb_FOUND)\n find_package(upb CONFIG REQUIRED)\nendif()")
+endif()
\ No newline at end of file
68 changes: 34 additions & 34 deletions ports/grpc/00010-add-feature-absl-sync.patch
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 24b619f..f7a11b9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2076,6 +2076,8 @@ target_link_libraries(grpc
${_gRPC_UPB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flat_hash_map
+ absl::time
+ absl::synchronization
absl::inlined_vector
absl::bind_front
absl::statusor
@@ -2623,6 +2625,8 @@ target_link_libraries(grpc_unsecure
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flat_hash_map
absl::inlined_vector
+ absl::time
+ absl::synchronization
absl::statusor
gpr
address_sorting
diff --git a/cmake/abseil-cpp.cmake b/cmake/abseil-cpp.cmake
index 078d495..b6f50bd 100644
--- a/cmake/abseil-cpp.cmake
+++ b/cmake/abseil-cpp.cmake
@@ -37,4 +37,7 @@ elseif(gRPC_ABSL_PROVIDER STREQUAL "package")
# Use "CONFIG" as there is no built-in cmake module for absl.
find_package(absl REQUIRED CONFIG)
set(_gRPC_FIND_ABSL "if(NOT absl_FOUND)\n find_package(absl CONFIG)\nendif()")
+ if (gRPC_ABSL_SYNC_ENABLE)
+ add_definitions(-DGPR_ABSEIL_SYNC=1)
+ endif()
endif()
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ae06ea3..8b64438 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2180,6 +2180,8 @@ target_link_libraries(grpc
${_gRPC_UPB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flat_hash_map
+ absl::time
+ absl::synchronization
absl::inlined_vector
absl::bind_front
absl::statusor
@@ -2733,6 +2735,8 @@ target_link_libraries(grpc_unsecure
${_gRPC_UPB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flat_hash_map
+ absl::time
+ absl::synchronization
absl::inlined_vector
absl::bind_front
absl::statusor
diff --git a/cmake/abseil-cpp.cmake b/cmake/abseil-cpp.cmake
index c89ba26..68ae4fd 100644
--- a/cmake/abseil-cpp.cmake
+++ b/cmake/abseil-cpp.cmake
@@ -35,3 +35,6 @@ elseif(gRPC_ABSL_PROVIDER STREQUAL "package")
find_package(absl REQUIRED CONFIG)
endif()
set(_gRPC_FIND_ABSL "if(NOT TARGET absl::strings)\n find_package(absl CONFIG)\nendif()")
+ if (gRPC_ABSL_SYNC_ENABLE)
+ add_definitions(-DGPR_ABSEIL_SYNC=1)
+ endif()
\ No newline at end of file
66 changes: 33 additions & 33 deletions ports/grpc/00011-fix-csharp_plugin.patch
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ae77375eae..ad8815d2f9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1960,10 +1960,14 @@ endif()
if(gRPC_BUILD_CSHARP_EXT)
-add_library(grpc_csharp_ext SHARED
+add_library(grpc_csharp_ext
src/csharp/ext/grpc_csharp_ext.c
)
+if (WIN32 AND BUILD_SHARED_LIBS)
+ target_compile_definitions(grpc_csharp_ext PUBLIC GPR_WINDOWS)
+endif()
+
set_target_properties(grpc_csharp_ext PROPERTIES
VERSION ${gRPC_CORE_VERSION}
SOVERSION ${gRPC_CORE_SOVERSION}
@@ -1977,6 +1981,12 @@ if(WIN32 AND MSVC)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/grpc_csharp_ext.pdb
DESTINATION ${gRPC_INSTALL_LIBDIR} OPTIONAL
)
+
+ install(TARGETS grpc_csharp_ext
+ RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
+ )
endif()
endif()
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ae77375eae..ad8815d2f9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1960,10 +1960,14 @@ endif()

if(gRPC_BUILD_CSHARP_EXT)

-add_library(grpc_csharp_ext SHARED
+add_library(grpc_csharp_ext
src/csharp/ext/grpc_csharp_ext.c
)

+if (WIN32 AND BUILD_SHARED_LIBS)
+ target_compile_definitions(grpc_csharp_ext PUBLIC GPR_WINDOWS)
+endif()
+
set_target_properties(grpc_csharp_ext PROPERTIES
VERSION ${gRPC_CORE_VERSION}
SOVERSION ${gRPC_CORE_SOVERSION}
@@ -1977,6 +1981,12 @@ if(WIN32 AND MSVC)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/grpc_csharp_ext.pdb
DESTINATION ${gRPC_INSTALL_LIBDIR} OPTIONAL
)
+
+ install(TARGETS grpc_csharp_ext
+ RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
+ )
endif()
endif()

Loading