Looks simillar to ZBX-19635 however I've tested that this issue happens as well when LTO is not used
Source code configured with :
%configure \ --enable-agent \ --enable-ipv6 \ --enable-proxy \ --enable-server \ --%{?with_java:en}%{!?with_java:dis}able-java \ --with-ldap \ --with-libcurl \ --with-libpcre2 \ --with-libxml2 \ --with-net-snmp \ --with-openipmi \ --with-openssl \ --without-libpcre \ --with-ssh2 \ --with-unixodbc \ --with%{!?with_jabber:out}-jabber \ --with%-mysql
And linking fails with:
Making all in ha make[3]: Entering directory '/home/tkloczko/rpmbuild/BUILD/zabbix-6.0.6/x86_64-redhat-linux-gnu-mysql/src/zabbix_server/ha' make[3]: Nothing to be done for 'all'. make[3]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/zabbix-6.0.6/x86_64-redhat-linux-gnu-mysql/src/zabbix_server/ha' make[3]: Entering directory '/home/tkloczko/rpmbuild/BUILD/zabbix-6.0.6/x86_64-redhat-linux-gnu-mysql/src/zabbix_server' /bin/sh ../../libtool --tag=CC --mode=link /usr/bin/gcc -DDEFAULT_SSL_CERT_LOCATION="\"/usr/share/zabbix/ssl/certs\"" -DDEFAULT_SSL_KEY_LOCATION="\"/usr/share/zabbix/ssl/keys\"" -DDEFAULT_CONFIG_FILE="\"/etc/zabbix/zabbix_server.conf\"" -DDEFAULT_EXTERNAL_SCRIPTS_PATH="\"/usr/share/zabbix/externalscripts\"" -DDEFAULT_ALERT_SCRIPTS_PATH="\"/usr/share/zabbix/alertscripts\"" -DDEFAULT_LOAD_MODULE_PATH="\"/usr/lib64/modules/zabbix\"" -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -L/usr/lib64 -L/usr/lib64 -L/usr/lib64 -L/usr/lib -L/usr/lib -L/usr/lib -L/usr/lib -rdynamic -Wl,-z,relro -Wl,--as-needed -Wl,--gc-sections -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1 -o zabbix_server zabbix_server-server.o alerter/libzbxalerter.a dbsyncer/libzbxdbsyncer.a dbconfig/libzbxdbconfig.a discoverer/libzbxdiscoverer.a pinger/libzbxpinger.a poller/libzbxpoller.a housekeeper/libzbxhousekeeper.a timer/libzbxtimer.a trapper/libzbxtrapper.a trapper/libzbxtrapper_server.a reporter/libzbxreporter.a snmptrapper/libzbxsnmptrapper.a httppoller/libzbxhttppoller.a escalator/libzbxescalator.a proxypoller/libzbxproxypoller.a selfmon/libzbxselfmon.a vmware/libzbxvmware.a taskmanager/libzbxtaskmanager.a odbc/libzbxodbc.a scripts/libzbxscripts.a preprocessor/libpreprocessor.a availability/libavailability.a service/libservice.a ../../src/libs/zbxembed/libzbxembed.a ../../src/libs/zbxxml/libzbxxml.a poller/libzbxpoller_server.a lld/libzbxlld.a libzbxserver.a ha/libzbxha.a ../../src/libs/zbxprometheus/libzbxprometheus.a ../../src/libs/zbxsysinfo/libzbxserversysinfo.a ../../src/libs/zbxsysinfo/common/libcommonsysinfo.a ../../src/libs/zbxsysinfo/common/libcommonsysinfo_httpmetrics.a ../../src/libs/zbxsysinfo/common/libcommonsysinfo_http.a ../../src/libs/zbxsysinfo/simple/libsimplesysinfo.a ../../src/libs/zbxlog/libzbxlog.a ../../src/libs/zbxdbcache/libzbxdbcache.a ../../src/libs/zbxserver/libzbxserver.a ../../src/libs/zbxeval/libzbxeval.a ../../src/libs/zbxhistory/libzbxhistory.a ../../src/libs/zbxmemory/libzbxmemory.a ../../src/libs/zbxregexp/libzbxregexp.a ../../src/libs/zbxself/libzbxself.a ../../src/libs/zbxself/libzbxself_server.a ../../src/libs/zbxnix/libzbxnix.a ../../src/libs/zbxalgo/libzbxalgo.a ../../src/libs/zbxsys/libzbxsys.a ../../src/libs/zbxconf/libzbxconf.a ../../src/libs/zbxmedia/libzbxmedia.a ../../src/libs/zbxaudit/libzbxaudit.a ../../src/libs/zbxcommon/libzbxcommon.a ../../src/libs/zbxcrypto/libzbxcrypto.a ../../src/libs/zbxcomms/libzbxcomms.a ../../src/libs/zbxcommon/libzbxcommon.a ../../src/libs/zbxcommshigh/libzbxcommshigh.a ../../src/libs/zbxjson/libzbxjson.a ../../src/libs/zbxhttp/libzbxhttp.a ../../src/libs/zbxipcservice/libzbxipcservice.a ../../src/libs/zbxexec/libzbxexec.a ../../src/libs/zbxicmpping/libzbxicmpping.a ../../src/libs/zbxdbupgrade/libzbxdbupgrade.a ../../src/libs/zbxdbhigh/libzbxdbhigh.a ../../src/libs/zbxdb/libzbxdb.a ../../src/libs/zbxmodules/libzbxmodules.a ../../src/libs/zbxtasks/libzbxtasks.a ../../src/libs/zbxdiag/libzbxdiag_server.a ../../src/libs/zbxcompress/libzbxcompress.a ../../src/libs/zbxtrends/libzbxtrends_baseline.a ../../src/libs/zbxtrends/libzbxtrends.a ../../src/libs/zbxserver/libzbxserver_server.a ../../src/libs/zbxha/libzbxha.a ../../src/libs/zbxrtc/libzbxrtc_service.a ../../src/libs/zbxrtc/libzbxrtc_server.a ../../src/libs/zbxrtc/libzbxrtc.a ../../src/libs/zbxvault/libzbxvault.a ../../src/libs/zbxavailability/libzbxavailability.a ../../src/libs/zbxaudit/libzbxaudit.a ../../src/libs/zbxservice/libzbxservice.a ipmi/libipmi.a -lmysqlclient -lxml2 -lodbc -lnetsnmp -lssh2 -lOpenIPMI -lOpenIPMIposix -lz -lpthread -levent -lssl -lcrypto -lldap -llber -lcurl -lm -lpcre2-8 libtool: link: /usr/bin/gcc -DDEFAULT_SSL_CERT_LOCATION=\"/usr/share/zabbix/ssl/certs\" -DDEFAULT_SSL_KEY_LOCATION=\"/usr/share/zabbix/ssl/keys\" -DDEFAULT_CONFIG_FILE=\"/etc/zabbix/zabbix_server.conf\" -DDEFAULT_EXTERNAL_SCRIPTS_PATH=\"/usr/share/zabbix/externalscripts\" -DDEFAULT_ALERT_SCRIPTS_PATH=\"/usr/share/zabbix/alertscripts\" -DDEFAULT_LOAD_MODULE_PATH=\"/usr/lib64/modules/zabbix\" -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -rdynamic -Wl,-z -Wl,relro -Wl,--as-needed -Wl,--gc-sections -Wl,-z -Wl,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1 -o zabbix_server zabbix_server-server.o -L/usr/lib64 -L/usr/lib alerter/libzbxalerter.a dbsyncer/libzbxdbsyncer.a dbconfig/libzbxdbconfig.a discoverer/libzbxdiscoverer.a pinger/libzbxpinger.a poller/libzbxpoller.a housekeeper/libzbxhousekeeper.a timer/libzbxtimer.a trapper/libzbxtrapper.a trapper/libzbxtrapper_server.a reporter/libzbxreporter.a snmptrapper/libzbxsnmptrapper.a httppoller/libzbxhttppoller.a escalator/libzbxescalator.a proxypoller/libzbxproxypoller.a selfmon/libzbxselfmon.a vmware/libzbxvmware.a taskmanager/libzbxtaskmanager.a odbc/libzbxodbc.a scripts/libzbxscripts.a preprocessor/libpreprocessor.a availability/libavailability.a service/libservice.a ../../src/libs/zbxembed/libzbxembed.a ../../src/libs/zbxxml/libzbxxml.a poller/libzbxpoller_server.a lld/libzbxlld.a libzbxserver.a ha/libzbxha.a ../../src/libs/zbxprometheus/libzbxprometheus.a ../../src/libs/zbxsysinfo/libzbxserversysinfo.a ../../src/libs/zbxsysinfo/common/libcommonsysinfo.a ../../src/libs/zbxsysinfo/common/libcommonsysinfo_httpmetrics.a ../../src/libs/zbxsysinfo/common/libcommonsysinfo_http.a ../../src/libs/zbxsysinfo/simple/libsimplesysinfo.a ../../src/libs/zbxlog/libzbxlog.a ../../src/libs/zbxdbcache/libzbxdbcache.a ../../src/libs/zbxserver/libzbxserver.a ../../src/libs/zbxeval/libzbxeval.a ../../src/libs/zbxhistory/libzbxhistory.a ../../src/libs/zbxmemory/libzbxmemory.a ../../src/libs/zbxregexp/libzbxregexp.a ../../src/libs/zbxself/libzbxself.a ../../src/libs/zbxself/libzbxself_server.a ../../src/libs/zbxnix/libzbxnix.a ../../src/libs/zbxalgo/libzbxalgo.a ../../src/libs/zbxsys/libzbxsys.a ../../src/libs/zbxconf/libzbxconf.a ../../src/libs/zbxmedia/libzbxmedia.a ../../src/libs/zbxcrypto/libzbxcrypto.a ../../src/libs/zbxcomms/libzbxcomms.a ../../src/libs/zbxcommon/libzbxcommon.a ../../src/libs/zbxcommshigh/libzbxcommshigh.a ../../src/libs/zbxjson/libzbxjson.a ../../src/libs/zbxhttp/libzbxhttp.a ../../src/libs/zbxipcservice/libzbxipcservice.a ../../src/libs/zbxexec/libzbxexec.a ../../src/libs/zbxicmpping/libzbxicmpping.a ../../src/libs/zbxdbupgrade/libzbxdbupgrade.a ../../src/libs/zbxdbhigh/libzbxdbhigh.a ../../src/libs/zbxdb/libzbxdb.a ../../src/libs/zbxmodules/libzbxmodules.a ../../src/libs/zbxtasks/libzbxtasks.a ../../src/libs/zbxdiag/libzbxdiag_server.a ../../src/libs/zbxcompress/libzbxcompress.a ../../src/libs/zbxtrends/libzbxtrends_baseline.a ../../src/libs/zbxtrends/libzbxtrends.a ../../src/libs/zbxserver/libzbxserver_server.a ../../src/libs/zbxha/libzbxha.a ../../src/libs/zbxrtc/libzbxrtc_service.a ../../src/libs/zbxrtc/libzbxrtc_server.a ../../src/libs/zbxrtc/libzbxrtc.a ../../src/libs/zbxvault/libzbxvault.a ../../src/libs/zbxavailability/libzbxavailability.a ../../src/libs/zbxaudit/libzbxaudit.a ../../src/libs/zbxservice/libzbxservice.a ipmi/libipmi.a -lmysqlclient -lxml2 -lodbc -lnetsnmp -lssh2 -lOpenIPMI -lOpenIPMIposix -lz -lpthread -levent -lssl -lcrypto -lldap -llber -lcurl -lm -lpcre2-8 /usr/bin/ld: ../../src/libs/zbxcommon/libzbxcommon.a(libzbxcommon_a-str.o): in function `version': /home/tkloczko/rpmbuild/BUILD/zabbix-6.0.6/x86_64-redhat-linux-gnu-mysql/src/libs/zbxcommon/../../../../src/libs/zbxcommon/str.c:57: undefined reference to `zbx_tls_version' collect2: error: ld returned 1 exit status make[3]: *** [Makefile:762: zabbix_server] Error 1 make[3]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/zabbix-6.0.6/x86_64-redhat-linux-gnu-mysql/src/zabbix_server'