diff --git a/recipe/generate_def.py b/recipe/generate_def.py index f517a3df..3416a122 100644 --- a/recipe/generate_def.py +++ b/recipe/generate_def.py @@ -58,14 +58,14 @@ # from another object, but since we do a union, it doesn't matter); # Static symbols aren't visible to the linker, so even if we put # them in the .def file, they would not be found; save the hassle. - if "UNDEF" in line or "Static" in line: + if any(x in line for x in ["UNDEF", "Static", "Label"]): continue # get pure symbol, i.e. what comes after "|", minus spaces, and removing potentially # trailing demangled names (e.g. "(`upb_FieldType_CType'::`2'::c_type)" above); # don't use [-1] because some demangled symbols contain `operator|` symbol = line.split("|")[1].strip().split()[0] - # skip labels and metadata - if "Label" in line or any(symbol.startswith(x) for x in [".", "$", "@", "??", "?$", "__"]): + # skip internal symbols; prefix to #symbols as of v1.71: {"??": 57072, "?$": 102, "__": 84} + if any(symbol.startswith(x) for x in ["??", "?$", "__"]): continue # skip opencensus for now; re-evaluate together with #220 if "opencensus" in symbol.lower(): diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 1a7d4986..d963e2bd 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -46,6 +46,7 @@ source: - patches/0013-add-linkage-to-openssl-to-grpc_unsecure.patch # [win] - patches/0014-reduce-grpc-symbol-explosion-with-autogenerated-expo.patch - patches/0015-update-GRPC_DLL-instances-where-necessary.patch + - patches/0016-add-some-GRPCXX_DLL-exports-for-symbols-needed-by-gc.patch # [win] {% if build_platform == target_platform and not win %} - folder: third_party/benchmark @@ -74,7 +75,9 @@ source: {% endif %} build: - number: 0 + number: 1 + # debug + skip: true # [not win] outputs: - name: libgrpc diff --git a/recipe/patches/0001-windows-ssl-lib-names.patch b/recipe/patches/0001-windows-ssl-lib-names.patch index 74fe3e5c..2200377a 100644 --- a/recipe/patches/0001-windows-ssl-lib-names.patch +++ b/recipe/patches/0001-windows-ssl-lib-names.patch @@ -1,7 +1,7 @@ From a1f2bdb936cf0720b3e6a825276089e40a47499a Mon Sep 17 00:00:00 2001 From: Jonathan Helmus Date: Mon, 17 Feb 2020 15:45:06 -0600 -Subject: [PATCH 01/15] windows ssl lib names +Subject: [PATCH 01/16] windows ssl lib names Co-Authored-By: Julien Schueller Co-Authored-By: Nicholas Bollweg diff --git a/recipe/patches/0002-fix-win-setup-cmds.patch b/recipe/patches/0002-fix-win-setup-cmds.patch index 4c5d5b6b..d2fbb481 100644 --- a/recipe/patches/0002-fix-win-setup-cmds.patch +++ b/recipe/patches/0002-fix-win-setup-cmds.patch @@ -1,7 +1,7 @@ From a41de15b2b9cc889582212d65bc545e7c3b50cc5 Mon Sep 17 00:00:00 2001 From: Mike Sarahan Date: Tue, 18 Feb 2020 13:53:05 -0600 -Subject: [PATCH 02/15] fix win setup cmds +Subject: [PATCH 02/16] fix win setup cmds Co-Authored-By: Julien Schueller Co-Authored-By: Nicholas Bollweg diff --git a/recipe/patches/0003-Link-against-grpc-and-abseil.patch b/recipe/patches/0003-Link-against-grpc-and-abseil.patch index c870bceb..17412015 100644 --- a/recipe/patches/0003-Link-against-grpc-and-abseil.patch +++ b/recipe/patches/0003-Link-against-grpc-and-abseil.patch @@ -1,7 +1,7 @@ From f671ec44b769d0463dfae979d9e223400d49132c Mon Sep 17 00:00:00 2001 From: Marius van Niekerk Date: Mon, 13 Jun 2022 17:13:07 -0400 -Subject: [PATCH 03/15] Link against grpc and abseil +Subject: [PATCH 03/16] Link against grpc and abseil Co-Authored-By: H. Vetinari --- diff --git a/recipe/patches/0004-force-protoc-executable.patch b/recipe/patches/0004-force-protoc-executable.patch index 2f5a9d5d..b37e309f 100644 --- a/recipe/patches/0004-force-protoc-executable.patch +++ b/recipe/patches/0004-force-protoc-executable.patch @@ -1,7 +1,7 @@ From 50ba587ddae9dc56a66e8213d6ec1c132a247688 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Fri, 11 Sep 2020 14:20:04 +0200 -Subject: [PATCH 04/15] force protoc executable +Subject: [PATCH 04/16] force protoc executable --- cmake/protobuf.cmake | 17 ++--------------- diff --git a/recipe/patches/0005-mark-linkages-of-grpc-_unsecure-as-private.patch b/recipe/patches/0005-mark-linkages-of-grpc-_unsecure-as-private.patch index 06ea94dc..46359c1e 100644 --- a/recipe/patches/0005-mark-linkages-of-grpc-_unsecure-as-private.patch +++ b/recipe/patches/0005-mark-linkages-of-grpc-_unsecure-as-private.patch @@ -1,7 +1,7 @@ From 61600719d36d394f9e02a23cf85926b9e31bfcfc Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Tue, 23 Aug 2022 11:45:20 +0200 -Subject: [PATCH 05/15] mark linkages of grpc{,_unsecure} as private +Subject: [PATCH 05/16] mark linkages of grpc{,_unsecure} as private except openssl & gpr, which are needed by dependents diff --git a/recipe/patches/0006-for-main-targets-set-_DLL_EXPORTS-when-building-and-.patch b/recipe/patches/0006-for-main-targets-set-_DLL_EXPORTS-when-building-and-.patch index 6a346f99..f41c5857 100644 --- a/recipe/patches/0006-for-main-targets-set-_DLL_EXPORTS-when-building-and-.patch +++ b/recipe/patches/0006-for-main-targets-set-_DLL_EXPORTS-when-building-and-.patch @@ -1,7 +1,7 @@ -From b52e1b28dcf98f6a9a1127c0f72bfc9caf38d903 Mon Sep 17 00:00:00 2001 +From b6a184e18b663c5c655488cf9266f8923827356b Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 29 Feb 2024 20:31:21 +1100 -Subject: [PATCH 06/15] for main targets, set *_DLL_EXPORTS when building and +Subject: [PATCH 06/16] for main targets, set *_DLL_EXPORTS when building and *_DLL_IMPORTS in interface --- @@ -9,7 +9,7 @@ Subject: [PATCH 06/15] for main targets, set *_DLL_EXPORTS when building and 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index aa48ccb04c..fb3f60850b 100644 +index aa48ccb04c..4bd0b0cac2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2092,10 +2092,8 @@ if(WIN32 AND MSVC) @@ -20,7 +20,7 @@ index aa48ccb04c..fb3f60850b 100644 - PRIVATE - "GPR_DLL_EXPORTS" - ) -+ set_target_properties(gpr PROPERTIES DEFINE_SYMBOL "GPR_DLL_EXPORTS") ++ target_compile_definitions(gpr PRIVATE "GPR_DLL_EXPORTS") + target_compile_definitions(gpr INTERFACE "GPR_DLL_IMPORTS") endif() if(gRPC_INSTALL) @@ -34,7 +34,7 @@ index aa48ccb04c..fb3f60850b 100644 - "GRPC_DLL_EXPORTS" - "GPR_DLL_IMPORTS" - ) -+ set_target_properties(grpc PROPERTIES DEFINE_SYMBOL "GRPC_DLL_EXPORTS") ++ target_compile_definitions(grpc PRIVATE "GRPC_DLL_EXPORTS") + target_compile_definitions(grpc INTERFACE "GRPC_DLL_IMPORTS") endif() if(gRPC_INSTALL) @@ -48,7 +48,7 @@ index aa48ccb04c..fb3f60850b 100644 - "GRPC_DLL_EXPORTS" - "GPR_DLL_IMPORTS" - ) -+ set_target_properties(grpc_unsecure PROPERTIES DEFINE_SYMBOL "GRPC_DLL_EXPORTS") ++ target_compile_definitions(grpc_unsecure PRIVATE "GRPC_DLL_EXPORTS") + target_compile_definitions(grpc_unsecure INTERFACE "GRPC_DLL_IMPORTS") endif() if(gRPC_INSTALL) @@ -63,8 +63,8 @@ index aa48ccb04c..fb3f60850b 100644 - "GPR_DLL_IMPORTS" - "GRPC_DLL_IMPORTS" - ) -+ set_target_properties(grpc++ PROPERTIES DEFINE_SYMBOL "GRPCXX_DLL_EXPORTS") -+ target_compile_definitions(grpc++ INTERFACE "GRPCXX_DLL_IMPORTS") ++ target_compile_definitions(grpc++ PRIVATE "GRPC_DLL_IMPORTS" "GRPCXX_DLL_EXPORTS") ++ target_compile_definitions(grpc++ INTERFACE "GRPC_DLL_IMPORTS" "GRPCXX_DLL_IMPORTS") endif() if(gRPC_INSTALL) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/grpc++.pdb @@ -78,8 +78,8 @@ index aa48ccb04c..fb3f60850b 100644 - "GPR_DLL_IMPORTS" - "GRPC_DLL_IMPORTS" - ) -+ set_target_properties(grpc++_unsecure PROPERTIES DEFINE_SYMBOL "GRPCXX_DLL_EXPORTS") -+ target_compile_definitions(grpc++_unsecure INTERFACE "GRPCXX_DLL_IMPORTS") ++ target_compile_definitions(grpc++_unsecure PRIVATE "GRPC_DLL_IMPORTS" "GRPCXX_DLL_EXPORTS") ++ target_compile_definitions(grpc++_unsecure INTERFACE "GRPC_DLL_IMPORTS" "GRPCXX_DLL_IMPORTS") endif() if(gRPC_INSTALL) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/grpc++_unsecure.pdb diff --git a/recipe/patches/0007-add-missing-linkages-for-gRPC_BUILD_TESTS-ON.patch b/recipe/patches/0007-add-missing-linkages-for-gRPC_BUILD_TESTS-ON.patch index c49c5f51..1826cfdd 100644 --- a/recipe/patches/0007-add-missing-linkages-for-gRPC_BUILD_TESTS-ON.patch +++ b/recipe/patches/0007-add-missing-linkages-for-gRPC_BUILD_TESTS-ON.patch @@ -1,14 +1,14 @@ -From 1a8f40a423a7381590bbe6aef170c1cb247f2d8d Mon Sep 17 00:00:00 2001 +From 2574106452e727e15f61b9537da2f38c128eb1b8 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Tue, 26 Sep 2023 18:25:54 +1100 -Subject: [PATCH 07/15] add missing linkages for gRPC_BUILD_TESTS=ON +Subject: [PATCH 07/16] add missing linkages for gRPC_BUILD_TESTS=ON --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt -index fb3f60850b..dbc8ac939c 100644 +index 4bd0b0cac2..0c782cde52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8089,6 +8089,7 @@ target_include_directories(authorization_matchers_test diff --git a/recipe/patches/0008-add-enable_testing-so-tests-get-run.patch b/recipe/patches/0008-add-enable_testing-so-tests-get-run.patch index f8d02f57..d86bdfab 100644 --- a/recipe/patches/0008-add-enable_testing-so-tests-get-run.patch +++ b/recipe/patches/0008-add-enable_testing-so-tests-get-run.patch @@ -1,14 +1,14 @@ -From c80cd00b33125db5e62805554bcf46a9f9f89bb1 Mon Sep 17 00:00:00 2001 +From 404ea6b43dda4f7ce3a118070cf9c7ef62716be2 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Fri, 28 Feb 2025 22:07:19 +1100 -Subject: [PATCH 08/15] add enable_testing so tests get run +Subject: [PATCH 08/16] add enable_testing so tests get run --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt -index dbc8ac939c..72ee817a05 100644 +index 0c782cde52..3a61b4d88b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,6 +51,10 @@ option(gRPC_BUILD_TESTS "Build tests" OFF) diff --git a/recipe/patches/0009-Build-protobufs-for-tests-only-if-gRPC_BUILD_TESTS.patch b/recipe/patches/0009-Build-protobufs-for-tests-only-if-gRPC_BUILD_TESTS.patch index 895774d5..21d97403 100644 --- a/recipe/patches/0009-Build-protobufs-for-tests-only-if-gRPC_BUILD_TESTS.patch +++ b/recipe/patches/0009-Build-protobufs-for-tests-only-if-gRPC_BUILD_TESTS.patch @@ -1,14 +1,14 @@ -From 5e660b8727fd0386388b7b13ac310fbe60786f7c Mon Sep 17 00:00:00 2001 +From b653b4eac8fb6da5e72064cfaf501123c3a808c1 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Thu, 28 Nov 2024 20:40:54 +0100 -Subject: [PATCH 09/15] Build protobufs for tests only if gRPC_BUILD_TESTS +Subject: [PATCH 09/16] Build protobufs for tests only if gRPC_BUILD_TESTS --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index 72ee817a05..b69b216f3d 100644 +index 3a61b4d88b..2e231c7491 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -720,6 +720,9 @@ protobuf_generate_grpc_cpp_with_import_path_correction( diff --git a/recipe/patches/0010-unvendor-upb-and-utf8_range-use-protobuf-s-version.patch b/recipe/patches/0010-unvendor-upb-and-utf8_range-use-protobuf-s-version.patch index d2e1d4cb..d455605c 100644 --- a/recipe/patches/0010-unvendor-upb-and-utf8_range-use-protobuf-s-version.patch +++ b/recipe/patches/0010-unvendor-upb-and-utf8_range-use-protobuf-s-version.patch @@ -1,7 +1,7 @@ -From 1e2008eb800e4cc2aa9935fcd9c970a61d09544c Mon Sep 17 00:00:00 2001 +From 825a9cbda464425f22fd6dc887dae18126bca5be Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Fri, 28 Feb 2025 15:09:41 +1100 -Subject: [PATCH 10/15] unvendor upb and utf8_range, use protobuf's version +Subject: [PATCH 10/16] unvendor upb and utf8_range, use protobuf's version --- CMakeLists.txt | 522 ++---------------------------------------------- @@ -9,7 +9,7 @@ Subject: [PATCH 10/15] unvendor upb and utf8_range, use protobuf's version 2 files changed, 16 insertions(+), 510 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index b69b216f3d..f6b263e764 100644 +index 2e231c7491..9654b4416d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -346,11 +346,15 @@ else() diff --git a/recipe/patches/0011-reduce-buildtests_cxx-target-to-end2end-tests.patch b/recipe/patches/0011-reduce-buildtests_cxx-target-to-end2end-tests.patch index b5052b5c..35665379 100644 --- a/recipe/patches/0011-reduce-buildtests_cxx-target-to-end2end-tests.patch +++ b/recipe/patches/0011-reduce-buildtests_cxx-target-to-end2end-tests.patch @@ -1,7 +1,7 @@ -From 41bcad7889bdb4f6ce7edf38594ad1cc3e1f64ad Mon Sep 17 00:00:00 2001 +From 5778a21aa4f44beffd79002c3ac4a038ac97c61c Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 2 Mar 2025 08:22:39 +1100 -Subject: [PATCH 11/15] reduce buildtests_cxx target to end2end tests +Subject: [PATCH 11/16] reduce buildtests_cxx target to end2end tests as of v1.69, the whole set of tests takes extremely long to build (>6h), so reduce it to only "end2end" tests. This has the advantage of being @@ -15,7 +15,7 @@ Plus four support libraries (`grpc{,++}_test{,_config,_util}`) and the vendored 1 file changed, 50 insertions(+), 688 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index f6b263e764..31d10c10a6 100644 +index 9654b4416d..77f95ed57f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,11 +47,12 @@ set(gRPC_INSTALL_SHAREDIR "share/grpc" CACHE STRING "Installation directory for diff --git a/recipe/patches/0012-build-grpcio-tools-from-source.patch b/recipe/patches/0012-build-grpcio-tools-from-source.patch index 5e8fef21..b1dcdb62 100644 --- a/recipe/patches/0012-build-grpcio-tools-from-source.patch +++ b/recipe/patches/0012-build-grpcio-tools-from-source.patch @@ -1,7 +1,7 @@ -From 6bdcff13fe6ef5c5fc18b50f0a12cf37343917c6 Mon Sep 17 00:00:00 2001 +From 444b5a7225d2121cc5ffca19e8397f0652116beb Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Tue, 4 Mar 2025 08:53:30 +1100 -Subject: [PATCH 12/15] build grpcio-tools from source +Subject: [PATCH 12/16] build grpcio-tools from source --- tools/distrib/python/grpcio_tools/setup.py | 43 ++++++++++++++++------ diff --git a/recipe/patches/0013-add-linkage-to-openssl-to-grpc_unsecure.patch b/recipe/patches/0013-add-linkage-to-openssl-to-grpc_unsecure.patch index b4fe1dcd..a4cc0bba 100644 --- a/recipe/patches/0013-add-linkage-to-openssl-to-grpc_unsecure.patch +++ b/recipe/patches/0013-add-linkage-to-openssl-to-grpc_unsecure.patch @@ -1,7 +1,7 @@ -From 2aeef12d417bd880de8004aaf8ceaeaf26a82361 Mon Sep 17 00:00:00 2001 +From 3cdda15b6bb09062417e229f2cc923cdccb86d9d Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sat, 1 Mar 2025 08:06:28 +1100 -Subject: [PATCH 13/15] add linkage to openssl to grpc_unsecure +Subject: [PATCH 13/16] add linkage to openssl to grpc_unsecure grpc_unsecure actually requires ParsePemCertificateChain / ParsePemPrivateKey from that TU in ValidatePemKeyCertPair, see @@ -12,7 +12,7 @@ https://github.com/grpc/grpc/blob/v1.69.0/src/core/tsi/ssl_transport_security_ut 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt -index 31d10c10a6..e533337cdf 100644 +index 77f95ed57f..e8b8f0ed29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3029,6 +3029,7 @@ add_library(grpc_unsecure diff --git a/recipe/patches/0014-reduce-grpc-symbol-explosion-with-autogenerated-expo.patch b/recipe/patches/0014-reduce-grpc-symbol-explosion-with-autogenerated-expo.patch index a3294482..bc32423b 100644 --- a/recipe/patches/0014-reduce-grpc-symbol-explosion-with-autogenerated-expo.patch +++ b/recipe/patches/0014-reduce-grpc-symbol-explosion-with-autogenerated-expo.patch @@ -1,7 +1,7 @@ -From 37e86c55123f8285c5db9ca3953bc236aad85882 Mon Sep 17 00:00:00 2001 +From 51ce3916498bd730747f5a07e52075f4a3e11ad0 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Wed, 5 Mar 2025 13:21:01 +1100 -Subject: [PATCH 14/15] reduce grpc symbol explosion with autogenerated export +Subject: [PATCH 14/16] reduce grpc symbol explosion with autogenerated export definitions file Basically, WINDOWS_EXPORT_ALL_SYMBOLS is a nuclear option that includes all symbols @@ -38,7 +38,7 @@ other consumers end up linking to them. 1 file changed, 24 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt -index e533337cdf..86c06eb89b 100644 +index e8b8f0ed29..d39f232f94 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2396,6 +2396,30 @@ add_library(grpc diff --git a/recipe/patches/0015-update-GRPC_DLL-instances-where-necessary.patch b/recipe/patches/0015-update-GRPC_DLL-instances-where-necessary.patch index 21c33d43..c0074929 100644 --- a/recipe/patches/0015-update-GRPC_DLL-instances-where-necessary.patch +++ b/recipe/patches/0015-update-GRPC_DLL-instances-where-necessary.patch @@ -1,7 +1,7 @@ -From a1b3b6828b80bc9b669aedc51c085992b05ed8f3 Mon Sep 17 00:00:00 2001 +From 8d5565ecbd8abc79bed0f26fd09c19ab1c2b93a8 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 2 Mar 2025 07:16:19 +1100 -Subject: [PATCH 15/15] update GRPC_DLL instances where necessary +Subject: [PATCH 15/16] update GRPC_DLL instances where necessary --- include/grpc/event_engine/event_engine.h | 2 +- diff --git a/recipe/patches/0016-add-some-GRPCXX_DLL-exports-for-symbols-needed-by-gc.patch b/recipe/patches/0016-add-some-GRPCXX_DLL-exports-for-symbols-needed-by-gc.patch new file mode 100644 index 00000000..6c46422e --- /dev/null +++ b/recipe/patches/0016-add-some-GRPCXX_DLL-exports-for-symbols-needed-by-gc.patch @@ -0,0 +1,108 @@ +From 94c967993f6f1fe0c6e162a8362b9f2274afa68f Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Fri, 14 Mar 2025 12:27:58 +1100 +Subject: [PATCH 16/16] add some GRPCXX_DLL exports for symbols needed by gcp + +also move CallbackUnaryCall to .cc, otherwise we get clashes between something +that's supposed to be dllimported, yet having a definition in the header +--- + include/grpcpp/impl/rpc_service_method.h | 3 ++- + include/grpcpp/support/client_callback.h | 13 +++---------- + include/grpcpp/support/method_handler.h | 2 +- + src/cpp/client/client_callback.cc | 16 ++++++++++++++++ + 4 files changed, 22 insertions(+), 12 deletions(-) + +diff --git a/include/grpcpp/impl/rpc_service_method.h b/include/grpcpp/impl/rpc_service_method.h +index 1b9911eca4..f551a7d606 100644 +--- a/include/grpcpp/impl/rpc_service_method.h ++++ b/include/grpcpp/impl/rpc_service_method.h +@@ -19,6 +19,7 @@ + #ifndef GRPCPP_IMPL_RPC_SERVICE_METHOD_H + #define GRPCPP_IMPL_RPC_SERVICE_METHOD_H + ++#include + #include + #include + #include +@@ -86,7 +87,7 @@ class MethodHandler { + class RpcServiceMethod : public RpcMethod { + public: + /// Takes ownership of the handler +- RpcServiceMethod(const char* name, RpcMethod::RpcType type, ++ GRPCXX_DLL RpcServiceMethod(const char* name, RpcMethod::RpcType type, + MethodHandler* handler) + : RpcMethod(name, type), + server_tag_(nullptr), +diff --git a/include/grpcpp/support/client_callback.h b/include/grpcpp/support/client_callback.h +index b3818eada6..e9c706c163 100644 +--- a/include/grpcpp/support/client_callback.h ++++ b/include/grpcpp/support/client_callback.h +@@ -49,18 +49,11 @@ class RpcMethod; + template +-void CallbackUnaryCall(grpc::ChannelInterface* channel, ++GRPCXX_DLL void CallbackUnaryCall(grpc::ChannelInterface* channel, + const grpc::internal::RpcMethod& method, + grpc::ClientContext* context, + const InputMessage* request, OutputMessage* result, +- std::function on_completion) { +- static_assert(std::is_base_of::value, +- "Invalid input message specification"); +- static_assert(std::is_base_of::value, +- "Invalid output message specification"); +- CallbackUnaryCallImpl x( +- channel, method, context, request, result, on_completion); +-} ++ std::function on_completion); + + template + class CallbackUnaryCallImpl { +@@ -1203,7 +1196,7 @@ class ClientCallbackUnaryImpl final : public ClientCallbackUnary { + std::atomic callbacks_outstanding_{2}; + }; + +-class ClientCallbackUnaryFactory { ++GRPCXX_DLL class ClientCallbackUnaryFactory { + public: + template +diff --git a/include/grpcpp/support/method_handler.h b/include/grpcpp/support/method_handler.h +index a61843bdb8..3791d5a78c 100644 +--- a/include/grpcpp/support/method_handler.h ++++ b/include/grpcpp/support/method_handler.h +@@ -99,7 +99,7 @@ template + class RpcMethodHandler : public grpc::internal::MethodHandler { + public: +- RpcMethodHandler( ++ GRPCXX_DLL RpcMethodHandler( + std::function + func, +diff --git a/src/cpp/client/client_callback.cc b/src/cpp/client/client_callback.cc +index 85e3ec4569..a8e3b3e2b8 100644 +--- a/src/cpp/client/client_callback.cc ++++ b/src/cpp/client/client_callback.cc +@@ -28,5 +28,21 @@ bool ClientReactor::InternalTrailersOnly(const grpc_call* call) const { + return grpc_call_is_trailers_only(call); + } + ++template ++void CallbackUnaryCall(grpc::ChannelInterface* channel, ++ const grpc::internal::RpcMethod& method, ++ grpc::ClientContext* context, ++ const InputMessage* request, OutputMessage* result, ++ std::function on_completion) { ++ static_assert(std::is_base_of::value, ++ "Invalid input message specification"); ++ static_assert(std::is_base_of::value, ++ "Invalid output message specification"); ++ CallbackUnaryCallImpl x( ++ channel, method, context, request, result, on_completion); ++} ++ + } // namespace internal + } // namespace grpc