Opened 3 years ago

Closed 3 years ago

#63875 closed defect (fixed)

mysql8 @8.0.27_0: Undefined symbols "_xdr_sizeof"

Reported by: chrstphrchvz (Christopher Chavez) Owned by: herbygillot (Herby Gillot)
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: Cc: mascguy (Christopher Nielsen)
Port: mysql8

Description

Build fails on macOS 10.14 Mojave during linking. https://build.macports.org/builders/ports-10.14_x86_64-builder/builds/104230/steps/install-port/logs/stdio

[100%] Linking CXX shared module ../../plugin_output_directory/group_replication.so
cd /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_databases_mysql8/mysql8/work/build/plugin/group_replication && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/group_replication.dir/link.txt --verbose=ON
/opt/local/bin/clang++-mp-7.0 -std=c++17 -fno-omit-frame-pointer -ftls-model=initial-exec -pipe -Os -DNDEBUG -I/opt/local/include -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -Wall -Wextra -Wformat-security -Wvla -Wundef -Wmissing-format-attribute -Woverloaded-virtual -Wcast-qual -Wno-null-conversion -Wno-unused-private-field -Wconditional-uninitialized -Wdeprecated -Wextra-semi -Wheader-hygiene -Wnon-virtual-dtor -Wundefined-reinterpret-cast -Winconsistent-missing-destructor-override -Winconsistent-missing-override -Wshadow-field -ffunction-sections -fdata-sections -O3 -DNDEBUG -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.14 -bundle -Wl,-headerpad_max_install_names -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -o ../../plugin_output_directory/group_replication.so CMakeFiles/group_replication.dir/src/applier.cc.o CMakeFiles/group_replication.dir/src/applier_channel_state_observer.cc.o CMakeFiles/group_replication.dir/src/asynchronous_channels_state_observer.cc.o CMakeFiles/group_replication.dir/src/auto_increment.cc.o CMakeFiles/group_replication.dir/src/autorejoin.cc.o CMakeFiles/group_replication.dir/src/certifier.cc.o CMakeFiles/group_replication.dir/src/compatibility_module.cc.o CMakeFiles/group_replication.dir/src/consistency_manager.cc.o CMakeFiles/group_replication.dir/src/delayed_plugin_initialization.cc.o CMakeFiles/group_replication.dir/src/gcs_event_handlers.cc.o CMakeFiles/group_replication.dir/src/gcs_logger.cc.o CMakeFiles/group_replication.dir/src/gcs_mysql_network_provider.cc.o CMakeFiles/group_replication.dir/src/gcs_operations.cc.o CMakeFiles/group_replication.dir/src/gcs_plugin_messages.cc.o CMakeFiles/group_replication.dir/src/gcs_view_modification_notifier.cc.o CMakeFiles/group_replication.dir/src/group_actions/communication_protocol_action.cc.o CMakeFiles/group_replication.dir/src/group_actions/group_action.cc.o CMakeFiles/group_replication.dir/src/group_actions/group_action_coordinator.cc.o CMakeFiles/group_replication.dir/src/group_actions/multi_primary_migration_action.cc.o CMakeFiles/group_replication.dir/src/group_actions/primary_election_action.cc.o CMakeFiles/group_replication.dir/src/handlers/applier_handler.cc.o CMakeFiles/group_replication.dir/src/handlers/certification_handler.cc.o CMakeFiles/group_replication.dir/src/handlers/event_cataloger.cc.o CMakeFiles/group_replication.dir/src/hold_transactions.cc.o CMakeFiles/group_replication.dir/src/leave_group_on_failure.cc.o CMakeFiles/group_replication.dir/src/member_info.cc.o CMakeFiles/group_replication.dir/src/member_version.cc.o CMakeFiles/group_replication.dir/src/mysql_version_gcs_protocol_map.cc.o CMakeFiles/group_replication.dir/src/observer_server_actions.cc.o CMakeFiles/group_replication.dir/src/observer_server_channels.cc.o CMakeFiles/group_replication.dir/src/observer_server_state.cc.o CMakeFiles/group_replication.dir/src/observer_trans.cc.o CMakeFiles/group_replication.dir/src/perfschema/pfs.cc.o CMakeFiles/group_replication.dir/src/perfschema/table_replication_group_configuration_version.cc.o CMakeFiles/group_replication.dir/src/perfschema/table_replication_group_member_actions.cc.o CMakeFiles/group_replication.dir/src/perfschema/table_communication_information.cc.o CMakeFiles/group_replication.dir/src/pipeline_factory.cc.o CMakeFiles/group_replication.dir/src/pipeline_stats.cc.o CMakeFiles/group_replication.dir/src/plugin.cc.o CMakeFiles/group_replication.dir/src/plugin_handlers/consensus_leaders_handler.cc.o CMakeFiles/group_replication.dir/src/plugin_handlers/group_partition_handling.cc.o CMakeFiles/group_replication.dir/src/plugin_handlers/member_actions_handler.cc.o CMakeFiles/group_replication.dir/src/plugin_handlers/member_actions_handler_configuration.cc.o CMakeFiles/group_replication.dir/src/plugin_handlers/offline_mode_handler.cc.o CMakeFiles/group_replication.dir/src/plugin_handlers/persistent_variables_handler.cc.o CMakeFiles/group_replication.dir/src/plugin_handlers/primary_election_invocation_handler.cc.o CMakeFiles/group_replication.dir/src/plugin_handlers/primary_election_primary_process.cc.o CMakeFiles/group_replication.dir/src/plugin_handlers/primary_election_secondary_process.cc.o CMakeFiles/group_replication.dir/src/plugin_handlers/primary_election_utils.cc.o CMakeFiles/group_replication.dir/src/plugin_handlers/primary_election_validation_handler.cc.o CMakeFiles/group_replication.dir/src/plugin_handlers/read_mode_handler.cc.o CMakeFiles/group_replication.dir/src/plugin_handlers/remote_clone_handler.cc.o CMakeFiles/group_replication.dir/src/plugin_handlers/server_ongoing_transactions_handler.cc.o CMakeFiles/group_replication.dir/src/plugin_handlers/stage_monitor_handler.cc.o CMakeFiles/group_replication.dir/src/plugin_messages/group_action_message.cc.o CMakeFiles/group_replication.dir/src/plugin_messages/group_service_message.cc.o CMakeFiles/group_replication.dir/src/plugin_messages/group_validation_message.cc.o CMakeFiles/group_replication.dir/src/plugin_messages/recovery_message.cc.o CMakeFiles/group_replication.dir/src/plugin_messages/single_primary_message.cc.o CMakeFiles/group_replication.dir/src/plugin_messages/sync_before_execution_message.cc.o CMakeFiles/group_replication.dir/src/plugin_messages/transaction_message.cc.o CMakeFiles/group_replication.dir/src/plugin_messages/transaction_prepared_message.cc.o CMakeFiles/group_replication.dir/src/plugin_messages/transaction_with_guarantee_message.cc.o CMakeFiles/group_replication.dir/src/plugin_observers/channel_observation_manager.cc.o CMakeFiles/group_replication.dir/src/plugin_observers/group_event_observer.cc.o CMakeFiles/group_replication.dir/src/plugin_observers/group_transaction_observation_manager.cc.o CMakeFiles/group_replication.dir/src/plugin_variables/recovery_endpoints.cc.o CMakeFiles/group_replication.dir/src/plugin_psi.cc.o CMakeFiles/group_replication.dir/src/plugin_utils.cc.o CMakeFiles/group_replication.dir/src/ps_information.cc.o CMakeFiles/group_replication.dir/src/recovery.cc.o CMakeFiles/group_replication.dir/src/recovery_channel_state_observer.cc.o CMakeFiles/group_replication.dir/src/recovery_state_transfer.cc.o CMakeFiles/group_replication.dir/src/replication_threads_api.cc.o CMakeFiles/group_replication.dir/src/services/get_system_variable/get_system_variable.cc.o CMakeFiles/group_replication.dir/src/services/message_service/message_service.cc.o CMakeFiles/group_replication.dir/src/services/notification/notification.cc.o CMakeFiles/group_replication.dir/src/services/status_service/status_service.cc.o CMakeFiles/group_replication.dir/src/services/registry.cc.o CMakeFiles/group_replication.dir/src/sql_service/sql_command_test.cc.o CMakeFiles/group_replication.dir/src/sql_service/sql_resultset.cc.o CMakeFiles/group_replication.dir/src/sql_service/sql_service_command.cc.o CMakeFiles/group_replication.dir/src/sql_service/sql_service_context.cc.o CMakeFiles/group_replication.dir/src/sql_service/sql_service_context_base.cc.o CMakeFiles/group_replication.dir/src/sql_service/sql_service_interface.cc.o CMakeFiles/group_replication.dir/src/thread/mysql_thread.cc.o CMakeFiles/group_replication.dir/src/udf/udf_communication_protocol.cc.o CMakeFiles/group_replication.dir/src/udf/udf_member_actions.cc.o CMakeFiles/group_replication.dir/src/udf/udf_multi_primary.cc.o CMakeFiles/group_replication.dir/src/udf/udf_registration.cc.o CMakeFiles/group_replication.dir/src/udf/udf_single_primary.cc.o CMakeFiles/group_replication.dir/src/udf/udf_utils.cc.o CMakeFiles/group_replication.dir/src/udf/udf_write_concurrency.cc.o CMakeFiles/group_replication.dir/src/services/notification/impl/gms_listener_test.cc.o  -Wl,-rpath,/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_databases_mysql8/mysql8/work/build/library_output_directory ../../libservices/libmysqlservices.a -Wl,-bundle_loader,/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_databases_mysql8/mysql8/work/build/runtime_output_directory/mysqld ../../liblz4_lib.a ../../library_output_directory/./libssl.dylib ../../library_output_directory/./libcrypto.dylib protobuf/libgr_protobuf_lite.a libmysqlgcs/libmysqlgcs.a ../../liblz4_lib.a ../../library_output_directory/./libssl.dylib ../../library_output_directory/./libcrypto.dylib ../../library_output_directory/libprotobuf-lite.3.11.4.dylib protobuf/libgr_protobuf_lite.a libmysqlgcs/libmysqlgcs.a 
Undefined symbols for architecture x86_64:
  "_xdr_sizeof", referenced from:
      serialize_msg(pax_msg*, xcom_proto, unsigned int*, char**) in libmysqlgcs.a(xcom_transport.cc.o)

Change History (8)

comment:1 Changed 3 years ago by chrstphrchvz (Christopher Chavez)

I personally do not use this port.

I want to say this has to do with plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/windeps/sunrpc/xdr_sizeof.c not being compiled for some reason. MySQL says it only needs to compile xdr_sizeof.c it with Xcode clang 10 or newer because xdr_sizeof() is no longer provided (I’ve not verified this claim): https://github.com/mysql/mysql-server/blob/mysql-8.0.27/plugin/group_replication/libmysqlgcs/cmake/rpcgen.cmake#L45-L53. Meanwhile, MacPorts is instead trying to use its own clang 7 to workaround errors when using MacPorts clang 8-9 and Xcode clang < 11: [ca0a578536/macports-ports].

Note that MySQL builds fine on macOS 10.13 with MacPorts clang 7 (without compiling xdr_sizeof.c), and also builds fine on macOS 10.15 with Xcode clang 11.7 (which does compile xdr_sizeof.c).

Last edited 3 years ago by chrstphrchvz (Christopher Chavez) (previous) (diff)

comment:2 Changed 3 years ago by chrstphrchvz (Christopher Chavez)

Summary: mysql8 @8.0.27_1: Undefined symbols "_xdr_sizeof"mysql8 @8.0.27_0: Undefined symbols "_xdr_sizeof"

comment:3 Changed 3 years ago by chrstphrchvz (Christopher Chavez)

Note that upstream does not support 10.14 Mojave as of 2020-10-19: https://www.mysql.com/support/eol-notice.html

comment:4 Changed 3 years ago by chrstphrchvz (Christopher Chavez)

I’m not aware why the availability of xdr_sizeof() would depend strictly on Xcode clang version. On 10.13 High Sierra, what does group_replication.so link to which provides the xdr_sizeof() implementation: a system library, something “copied” into it from Xcode, or something else?

comment:5 in reply to:  4 Changed 3 years ago by chrstphrchvz (Christopher Chavez)

Using a test program on 10.13 with Xcode clang 1000.11.45.5 (Xcode 10.1 command line tools), it links to libsystem_info.dylib.

#include <stdio.h>
#include <signal.h>
#include <rpc/types.h>
#include <rpc/xdr.h>

extern u_long xdr_sizeof(xdrproc_t, void *);

int main(void) {
        //raise(SIGINT);
        printf("%p\n", xdr_sizeof);
}

prints 0x7fff58f66840, corresponding to:

(lldb) image lookup -va 0x7fff58f66840
      Address: libsystem_info.dylib[0x0000000000042840] (libsystem_info.dylib.__TEXT.__text + 267856)
      Summary: libsystem_info.dylib`xdr_sizeof
       Module: file = "/usr/lib/system/libsystem_info.dylib", arch = "x86_64"
       Symbol: id = {0x00000460}, range = [0x00007fff58f66840-0x00007fff58f66960), name="xdr_sizeof"

I don’t have ready access to macOS 10.14, but I’m inclined to think that libsystem_info.dylib on 10.14 is what dropped xdr_sizeof() (I don’t know why—the source code for Libinfo on opensource.apple.com continues to contain an xdr_sizeof() implementation in rpc.subproj/xdr_sizeof.c, so my guess is that it no longer being compiled), and that the installed Xcode clang version is not a factor.

This would mean the problem is that CMAKE_C_COMPILER_VERSION is not what MySQL should be checking (such usage probably also assumes Xcode clang versioning and not LLVM clang versioning) to determine xdr_sizeof() availability; it should instead just check the macOS version (CMAKE_OSX_DEPLOYMENT_TARGET, I think).

comment:6 Changed 3 years ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:7 Changed 3 years ago by chrstphrchvz (Christopher Chavez)

comment:8 Changed 3 years ago by chrstphrchvz (Christopher Chavez)

Resolution: fixed
Status: assignedclosed

In 762befbad4859f7d343fe40481370900685315b8/macports-ports (master):

mysql8: fix build on macOS 10.14

Fixes: #63875

Note: See TracTickets for help on using tickets.