Never mind, I figured it out. For future reference:
gRPC already builds libupb from its third-party which generates libupb.a together with all other core libs. The way I did was build *protobuffers/upb *from GitHub to produce a different libupb.a and put it in the link path. After checking how GRPC builds it, it's different which includes two more generated files from /grpc itself: https://github.com/grpc/grpc/blob/master/CMakeLists.txt#L3964-L3965 Obviously, the lib I provided will miss those symbols. It's my fault. Best, Shawn https://columns.ai - the modern BI, simple, fast, and accessible. On Fri, Mar 11, 2022 at 6:47 PM Shawn Cao <[email protected]> wrote: > Hi, > > I was trying to upgrade to the latest version as of v1.44.0, also a few > earlier versions like v1.33.2, I started to fail my build with these > undefined symbols, I tried to include in "proto buffers/upb" lib in the > linker path, but still not working, could you help take a look, please? > > Thanks, > Shawn > > Here is the build/link command and error messages: > > [ 99%] Linking CXX executable NebulaClient > /opt/homebrew/Cellar/cmake/3.21.1/bin/cmake -E cmake_link_script > CMakeFiles/NebulaClient.dir/link.txt --verbose=1 > /usr/bin/g++ -Wall -Wextra -Werror -Wno-error=extern-c-compat > -Wno-error=inconsistent-missing-override > -Wno-error=nullability-completeness -Wno-error=sign-compare > -Wno-error=unknown-warning-option -g -DNDBG -arch arm64 -isysroot > /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk > -Wl,-search_paths_first -Wl,-headerpad_max_install_names > -L/opt/homebrew/opt/icu4c/lib > CMakeFiles/NebulaClient.dir/src/service/client/NebulaClient.cpp.o -o > NebulaClient -Wl,-rpath,/opt/homebrew/lib libNService.a > grpc/src/grpc-build/libgrpc++.a grpc/src/grpc-build/libgrpc.a > grpc/src/grpc-build/libgpr.a grpc/src/grpc-build/libaddress_sorting.a > yomm2/src/yomm2-build/src/libyomm2.a > uriparser/src/uriparser-build/liburiparser.a > folly/src/folly-build/libfolly.a glog/src/glog-build/libglog.a > c-ares/src/c-ares-build/lib/libcares.a /opt/homebrew/opt/zlib/lib/libz.a > re2/src/re2-build/libre2.a *upb/src/upb/cmake/libupb.a > */usr/local/lib/libabsl_hash.a > /usr/local/lib/libabsl_status.a /usr/local/lib/libabsl_statusor.a > /usr/local/lib/libabsl_synchronization.a xxhash/src/xxhash/libxxhash.a > gperftools/src/gperftools/lib/libtcmalloc_and_profiler.a libNIngest.a > libNApi.a libNExec.a yomm2/src/yomm2-build/src/libyomm2.a > glog/src/glog-build/libglog.a > gperftools/src/gperftools/lib/libtcmalloc_and_profiler.a libNStorage.a > uriparser/src/uriparser-build/liburiparser.a > aws/src/aws-build/aws-cpp-sdk-s3/libaws-cpp-sdk-s3.a > aws/src/aws-build/aws-cpp-sdk-core/libaws-cpp-sdk-core.a > aws/src/aws-build/crt/aws-crt-cpp/libaws-crt-cpp.a > aws/src/aws-build/lib/libaws-c-event-stream.a > aws/src/aws-build/crt/aws-crt-cpp/crt/aws-c-s3/libaws-c-s3.a > aws/src/aws-build/crt/aws-crt-cpp/crt/aws-c-auth/libaws-c-auth.a > aws/src/aws-build/crt/aws-crt-cpp/crt/aws-c-cal/libaws-c-cal.a > aws/src/aws-build/crt/aws-crt-cpp/crt/aws-c-mqtt/libaws-c-mqtt.a > aws/src/aws-build/crt/aws-crt-cpp/crt/aws-c-http/libaws-c-http.a > aws/src/aws-build/crt/aws-crt-cpp/crt/aws-c-compression/libaws-c-compression.a > aws/src/aws-build/crt/aws-crt-cpp/crt/aws-checksums/libaws-checksums.a > aws/src/aws-build/crt/aws-crt-cpp/crt/aws-c-io/libaws-c-io.a > aws/src/aws-build/crt/aws-crt-cpp/crt/aws-c-common/libaws-c-common.a > /opt/homebrew/opt/curl/lib/libcurl.dylib -framework corefoundation > -framework security -lresolv -L/opt/homebrew/opt/icu4c/lib > gcp/src/gcp-build/google/cloud/storage/libgoogle_cloud_cpp_storage.a > gcp/src/gcp-build/google/cloud/libgoogle_cloud_cpp_common.a > /usr/local/lib/libcrc32c.a arrow/src/arrow-build/release/libparquet.a > arrow/src/arrow-build/release/libarrow.a > azure/src/azure-build/sdk/storage/azure-storage-files-datalake/libazure-storage-files-datalake.a > azure/src/azure-build/sdk/storage/azure-storage-blobs/libazure-storage-blobs.a > azure/src/azure-build/sdk/storage/azure-storage-common/libazure-storage-common.a > azure/src/azure-build/sdk/core/azure-core/libazure-core.a > /opt/homebrew/opt/libxml2/lib/libxml2.dylib > kafka/src/kafka-build/src-cpp/librdkafka++.a > kafka/src/kafka-build/src/librdkafka.a > /opt/homebrew/opt/openssl/lib/libssl.a > /opt/homebrew/opt/openssl/lib/libcrypto.a libNMemory.a libNMeta.a > libNType.a yaml/src/yaml-build/libyaml-cpp.a libNSurface.a libNCommon.a > folly/src/folly-build/libfolly.a /opt/homebrew/opt/zlib/lib/libz.a > double-conversion/src/double-conversion-build/libdouble-conversion.a > /opt/homebrew/opt/libevent/lib/libevent.a > /opt/homebrew/lib/libboost_context-mt.a > /opt/homebrew/lib/libboost_filesystem-mt.a > /opt/homebrew/lib/libboost_program_options-mt.a > /opt/homebrew/lib/libboost_regex-mt.a -licudata -licui18n -licuuc > /opt/homebrew/lib/libboost_system-mt.a > /opt/homebrew/lib/libboost_thread-mt.a /opt/homebrew/opt/zstd/lib/libzstd.a > /opt/homebrew/opt/lz4/lib/liblz4.a /opt/homebrew/opt/bzip2/lib/libbz2.a > /opt/homebrew/opt/xz/lib/liblzma.a xxhash/src/xxhash/libxxhash.a > /opt/homebrew/lib/libfmt.8.0.1.dylib quickjs/src/quickjs/libquickjs.a > /usr/local/lib/libgflags.a /usr/local/lib/libprotobuf.a > flatbuffers/src/flatbuffers-build/libflatbuffers.a > thrift/src/thrift-build/lib/libthrift.a > roaring/src/roaring-build/src/libroaring.a > leveldb/src/leveldb-build/libleveldb.a > /opt/homebrew/opt/snappy/lib/libsnappy.a /usr/local/lib/libabsl_city.a > /usr/local/lib/libabsl_low_level_hash.a /usr/local/lib/libabsl_status.a > /usr/local/lib/libabsl_cord.a /usr/local/lib/libabsl_bad_optional_access.a > /usr/local/lib/libabsl_cordz_info.a /usr/local/lib/libabsl_cord_internal.a > /usr/local/lib/libabsl_cordz_functions.a > /usr/local/lib/libabsl_exponential_biased.a > /usr/local/lib/libabsl_cordz_handle.a > /usr/local/lib/libabsl_synchronization.a > /usr/local/lib/libabsl_stacktrace.a /usr/local/lib/libabsl_symbolize.a > /usr/local/lib/libabsl_debugging_internal.a > /usr/local/lib/libabsl_demangle_internal.a > /usr/local/lib/libabsl_graphcycles_internal.a > /usr/local/lib/libabsl_malloc_internal.a /usr/local/lib/libabsl_time.a > /usr/local/lib/libabsl_civil_time.a /usr/local/lib/libabsl_time_zone.a > -framework CoreFoundation /usr/local/lib/libabsl_str_format_internal.a > /usr/local/lib/libabsl_strings.a /usr/local/lib/libabsl_int128.a > /usr/local/lib/libabsl_throw_delegate.a > /usr/local/lib/libabsl_strings_internal.a > /usr/local/lib/libabsl_bad_variant_access.a /usr/local/lib/libabsl_base.a > /usr/local/lib/libabsl_raw_logging_internal.a > /usr/local/lib/libabsl_log_severity.a /usr/local/lib/libabsl_spinlock_wait.a > > > *Undefined symbols for architecture arm64: "__upb_arena_slowmalloc", > referenced from: _upb_arena_malloc in > libgrpc.a(load_balancer_api.cc.o)* > _upb_arena_malloc in libgrpc.a(xds_api.cc.o) > _upb_arena_malloc in libgrpc.a(alts_tsi_handshaker.cc.o) > _upb_arena_malloc in libgrpc.a(alts_handshaker_client.cc.o) > _upb_arena_malloc in libgrpc.a(alts_tsi_utils.cc.o) > "__upb_array_append_fallback", referenced from: > __upb_array_append_accessor in libgrpc.a(load_balancer_api.cc.o) > __upb_array_append_accessor in libgrpc.a(xds_api.cc.o) > __upb_array_append_accessor in libgrpc.a(alts_handshaker_client.cc.o) > "__upb_map_new", referenced from: > __upb_msg_map_set in libgrpc.a(xds_api.cc.o) > __upb_msg_map_set in libgrpc.a(alts_tsi_handshaker.cc.o) > __upb_msg_map_set in libgrpc.a(alts_handshaker_client.cc.o) > 60 warnings generated. > "__upb_msg_addunknown", referenced from: > grpc_core::(anonymous namespace)::PopulateBuildVersion(upb_arena*, > envoy_config_core_v3_Node*, std::__1::basic_string<char, > std::__1::char_traits<char>, std::__1::allocator<char> > const&) in > libgrpc.a(xds_api.cc.o) > "__upb_msg_new", referenced from: > _grpc_health_v1_HealthCheckRequest_new in > libgrpc.a(health_check_client.cc.o) > _grpc_health_v1_HealthCheckResponse_new in > libgrpc.a(health_check_client.cc.o) > _grpc_lb_v1_LoadBalanceRequest_new in > libgrpc.a(load_balancer_api.cc.o) > _grpc_lb_v1_LoadBalanceRequest_mutable_initial_request in > libgrpc.a(load_balancer_api.cc.o) > _grpc_lb_v1_LoadBalanceRequest_mutable_client_stats in > libgrpc.a(load_balancer_api.cc.o) > _grpc_lb_v1_ClientStats_mutable_timestamp in > libgrpc.a(load_balancer_api.cc.o) > _grpc_lb_v1_ClientStats_add_calls_finished_with_drop in > libgrpc.a(load_balancer_api.cc.o) > ... > "_upb_arena_free", referenced from: > upb::Arena::Arena() in libgrpc.a(grpclb.cc.o) > upb::Arena::Arena() in libgrpc.a(health_check_client.cc.o) > upb::Arena::Arena() in libgrpc.a(xds_api.cc.o) > upb::Arena::Arena() in libgrpc.a(backend_metric.cc.o) > upb::Arena::Arena() in libgrpc.a(transport_security_common_api.cc.o) > upb::Arena::Arena() in libgrpc.a(alts_tsi_handshaker.cc.o) > upb::Arena::Arena() in libgrpc.a(alts_handshaker_client.cc.o) > ... > "_upb_arena_init", referenced from: > _upb_arena_new in libgrpc.a(grpclb.cc.o) > _upb_arena_new in libgrpc.a(health_check_client.cc.o) > _upb_arena_new in libgrpc.a(xds_api.cc.o) > _upb_arena_new in libgrpc.a(backend_metric.cc.o) > _upb_arena_new in libgrpc.a(transport_security_common_api.cc.o) > _upb_arena_new in libgrpc.a(alts_tsi_handshaker.cc.o) > _upb_arena_new in libgrpc.a(alts_handshaker_client.cc.o) > ... > "_upb_decode", referenced from: > _grpc_health_v1_HealthCheckResponse_parse in > libgrpc.a(health_check_client.cc.o) > _grpc_lb_v1_LoadBalanceResponse_parse in > libgrpc.a(load_balancer_api.cc.o) > _envoy_service_discovery_v3_DiscoveryResponse_parse in > libgrpc.a(xds_api.cc.o) > _envoy_service_load_stats_v3_LoadStatsResponse_parse in > libgrpc.a(xds_api.cc.o) > _envoy_config_listener_v3_Listener_parse in libgrpc.a(xds_api.cc.o) > > _envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_parse > in libgrpc.a(xds_api.cc.o) > _envoy_config_route_v3_RouteConfiguration_parse in > libgrpc.a(xds_api.cc.o) > ... > "_upb_encode", referenced from: > _grpc_health_v1_HealthCheckRequest_serialize in > libgrpc.a(health_check_client.cc.o) > _grpc_lb_v1_LoadBalanceRequest_serialize in > libgrpc.a(load_balancer_api.cc.o) > _envoy_service_discovery_v3_DiscoveryRequest_serialize in > libgrpc.a(xds_api.cc.o) > _envoy_service_load_stats_v3_LoadStatsRequest_serialize in > libgrpc.a(xds_api.cc.o) > _grpc_gcp_RpcProtocolVersions_serialize in > libgrpc.a(transport_security_common_api.cc.o) > _grpc_gcp_AltsContext_serialize in > libgrpc.a(alts_tsi_handshaker.cc.o) > _grpc_gcp_HandshakerReq_serialize in > libgrpc.a(alts_handshaker_client.cc.o) > ... > "_upb_strtable_insert3", referenced from: > __upb_map_set in libgrpc.a(xds_api.cc.o) > __upb_map_set in libgrpc.a(alts_tsi_handshaker.cc.o) > __upb_map_set in libgrpc.a(alts_handshaker_client.cc.o) > "_upb_strtable_remove3", referenced from: > __upb_map_set in libgrpc.a(xds_api.cc.o) > __upb_map_set in libgrpc.a(alts_tsi_handshaker.cc.o) > __upb_map_set in libgrpc.a(alts_handshaker_client.cc.o) > ld: symbol(s) not found for architecture arm64 > clang: error: linker command failed with exit code 1 (use -v to see > invocation) > make[2]: *** [NebulaClient] Error 1 > make[1]: *** [CMakeFiles/NebulaClient.dir/all] Error 2 > > -- > You received this message because you are subscribed to a topic in the > Google Groups "grpc.io" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/grpc-io/MGL8JDK9olM/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/grpc-io/ac523598-39a8-4f01-967b-99c9a1e45cb2n%40googlegroups.com > <https://groups.google.com/d/msgid/grpc-io/ac523598-39a8-4f01-967b-99c9a1e45cb2n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/CALMSE6-emp7%2BDPfDViqG-0kV2m-2zLSHLHPMQS88GwZY2A3vwg%40mail.gmail.com.
