Skip to content

Building 1.63.0 or newer on macOS fails. #36654

@moubctez

Description

@moubctez

What version of gRPC and what language are you using?

1.63.0 1.64.0

What operating system (Linux, Windows,...) and version?

macOS

What runtime / compiler are you using (e.g. python version or version of gcc)

clang

What did you do?

Try to build 1.63.0 or 1.64.0 (older versions are fine).

What did you expect to see?

Builds fine

What did you see instead?

Build fails with

Undefined symbols for architecture arm64:
 "_google__protobuf__EnumOptions_msg_init", referenced from:
     __upb_EnumDefs_New in enum_def.c.o
     __upb_EnumDefs_New in enum_def.c.o
     __upb_EnumDefs_New in enum_def.c.o
 "_google__protobuf__EnumValueOptions_msg_init", referenced from:
     __upb_EnumValueDefs_New in enum_value_def.c.o
     __upb_EnumValueDefs_New in enum_value_def.c.o
     __upb_EnumValueDefs_New in enum_value_def.c.o
 "_google__protobuf__ExtensionRangeOptions_msg_init", referenced from:
     __upb_ExtensionRanges_New in extension_range.c.o
     __upb_ExtensionRanges_New in extension_range.c.o
     __upb_ExtensionRanges_New in extension_range.c.o
 "_google__protobuf__FeatureSetDefaults_msg_init", referenced from:
     _upb_DefPool_SetFeatureSetDefaults in def_pool.c.o
     _upb_DefPool_SetFeatureSetDefaults in def_pool.c.o
 "_google__protobuf__FeatureSet_msg_init", referenced from:
     _upb_DefBuilder_AddFileToPool in def_pool.c.o
     __upb_FieldDef_Create in field_def.c.o
     __upb_DefBuilder_GetOrCreateFeatureSet in def_builder.c.o
     __upb_DefBuilder_DoResolveFeatures in def_builder.c.o
     __upb_DefBuilder_DoResolveFeatures in def_builder.c.o
 "_google__protobuf__FieldOptions_msg_init", referenced from:
     __upb_FieldDef_Create in field_def.c.o
     __upb_FieldDef_Create in field_def.c.o
 "_google__protobuf__FileDescriptorProto_msg_init", referenced from:
     __upb_DefPool_LoadDefInitEx in def_pool.c.o
     __upb_DefPool_LoadDefInitEx in def_pool.c.o
 "_google__protobuf__FileOptions_msg_init", referenced from:
     __upb_FileDef_Create in file_def.c.o
     __upb_FileDef_Create in file_def.c.o
 "_google__protobuf__MessageOptions_msg_init", referenced from:
     __upb_MessageDefs_New in message_def.c.o
     __upb_MessageDefs_New in message_def.c.o
     __upb_MessageDefs_New in message_def.c.o
 "_google__protobuf__MethodOptions_msg_init", referenced from:
     __upb_MethodDefs_New in method_def.c.o
     __upb_MethodDefs_New in method_def.c.o
     __upb_MethodDefs_New in method_def.c.o
 "_google__protobuf__OneofOptions_msg_init", referenced from:
     __upb_OneofDefs_New in oneof_def.c.o
     __upb_OneofDefs_New in oneof_def.c.o
     __upb_OneofDefs_New in oneof_def.c.o
 "_google__protobuf__ServiceOptions_msg_init", referenced from:
     __upb_ServiceDefs_New in service_def.c.o
     __upb_ServiceDefs_New in service_def.c.o
     __upb_ServiceDefs_New in service_def.c.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Anything else we should know about your project / environment?

Fix:

--- CMakeLists.txt.orig	2024-05-16 01:01:03.000000000 +0000
+++ CMakeLists.txt
@@ -3682,6 +3682,7 @@ target_include_directories(upb_json_lib
 )
 target_link_libraries(upb_json_lib
   ${_gRPC_ALLTARGETS_LIBRARIES}
+  grpc++_unsecure
   utf8_range_lib
   upb_message_lib
 )
@@ -3883,6 +3884,7 @@ target_include_directories(upb_textforma
 )
 target_link_libraries(upb_textformat_lib
   ${_gRPC_ALLTARGETS_LIBRARIES}
+  grpc++_unsecure
   utf8_range_lib
   upb_message_lib
 )

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions