-
Incident report
-
Resolution: Duplicate
-
Major
-
None
-
1.6
-
None
-
ALT Linux Sisyphus
In ALT Linux Wl,-as-needed is passed to gcc by default. So,
./configure --with-ldap \
...
Build log:
i586-alt-linux-gcc -pipe -Wall -O2 -march=i586 -mtune=i686 -I/usr/include/mysql -pipe -march=i586 -mtune=i686 -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -DHAVE_ERRNO_AS_DEFINE -DONE_THREAD -I/usr/include/rpm -I/usr/include/gdbm -I/usr/lib/perl5/i386-linux/CORE -I. -I/usr/include -I/usr/include -L/usr/lib -lldap -o zabbix_agent zabbix_agent.o stats.o cpustat.o diskdevices.o interfaces.o perfstat.o zbxconf.o ../../src/libs/zbxsysinfo/libzbxagentsysinfo.a ../../src/libs/zbxsysinfo/linux/libspecsysinfo.a ../../src/libs/zbxsysinfo/common/libcommonsysinfo.a ../../src/libs/zbxsysinfo/simple/libsimplesysinfo.a ../../src/libs/zbxlog/libzbxlog.a ../../src/libs/zbxsys/libzbxsys.a ../../src/libs/zbxnix/libzbxnix.a ../../src/libs/zbxcomms/libzbxcomms.a ../../src/libs/zbxconf/libzbxconf.a ../../src/libs/zbxcommon/libzbxcommon.a ../../src/libs/zbxcrypto/libzbxcrypto.a ../../src/libs/zbxjson/libzbxjson.a -lm -lresolv
../../src/libs/zbxsysinfo/simple/libsimplesysinfo.a(simple.o): In function `check_ldap':
simple.c.text+0x2e0): undefined reference to `ldap_init'
simple.c.text+0x322): undefined reference to `ldap_search_s'
simple.c.text+0x32e): undefined reference to `ldap_err2string'
simple.c.text+0x362): undefined reference to `ber_free'
simple.c.text+0x372): undefined reference to `ldap_msgfree'
simple.c.text+0x382): undefined reference to `ldap_unbind'
simple.c.text+0x3ac): undefined reference to `ldap_first_entry'
simple.c.text+0x3c6): undefined reference to `ldap_first_attribute'
simple.c.text+0x3d8): undefined reference to `ldap_get_values'
simple.c.text+0x3ea): undefined reference to `ldap_value_free'
simple.c.text+0x3fa): undefined reference to `ldap_memfree'
simple.c.text+0x42e): undefined reference to `ldap_err2string'
collect2: ld returned 1 exit status
In linking string '-lldap' comes before '-o zabbix_agent', but must come after.
Same problem with zabbix_agentd, zabbix_proxy.
zabbix_proxy also can't build because of wrong place of -lpq in link string:
i586-alt-linux-gcc -DZABBIX_DAEMON -pipe -Wall -O2 -march=i586 -mtune=i686 -I/usr/include/pgsql -I/usr/include/rpm -I/usr/include/gdbm -I/usr/lib/perl5/i386-linux/CORE -I. -I/usr/include -I/usr/include -L/usr/lib -lpq -lcurl -lcrypto -lnetsnmp -lcrypto -lcrypto -lnetsnmp -lcrypto -L/usr/lib -lldap -o zabbix_proxy zabbix_proxy-servercomms.o zabbix_proxy-events.o zabbix_proxy-zlog.o zabbix_proxy-proxy.o heart/libzbxheart.a ../../src/zabbix_server/dbsyncer/libzbxdbsyncer.a ../../src/zabbix_server/discoverer/libzbxdiscoverer.a housekeeper/libzbxhousekeeper.a ../../src/zabbix_server/httppoller/libzbxhttppoller.a proxyconfig/libzbxproxyconfig.a ../../src/zabbix_server/pinger/libzbxpinger.a ../../src/zabbix_server/poller/libzbxpoller.a ../../src/zabbix_server/trapper/libzbxtrapper.a ../../src/zabbix_server/nodewatcher/libzbxnodewatcher.a datasender/libzbxdatasender.a ../../src/libs/zbxsysinfo/libzbxserversysinfo.a ../../src/libs/zbxsysinfo/linux/libspecsysinfo.a ../../src/libs/zbxsysinfo/common/libcommonsysinfo.a ../../src/libs/zbxsysinfo/simple/libsimplesysinfo.a ../../src/libs/zbxlog/libzbxlog.a ../../src/libs/zbxnix/libzbxnix.a ../../src/libs/zbxsys/libzbxsys.a ../../src/libs/zbxconf/libzbxconf.a ../../src/libs/zbxdbhigh/libzbxdbhigh.a ../../src/libs/zbxdb/libzbxdb.a ../../src/libs/zbxdbcache/libzbxdbcache.a ../../src/libs/zbxcommon/libzbxcommon.a ../../src/libs/zbxcrypto/libzbxcrypto.a ../../src/libs/zbxcomms/libzbxcomms.a ../../src/libs/zbxjson/libzbxjson.a ../../src/libs/zbxserver/libzbxserver.a ../../src/libs/zbxicmpping/libzbxicmpping.a -lcurl -lnetsnmp -lldap -lm -lresolv
../../src/libs/zbxdb/libzbxdb.a(db.o): In function `zbx_db_vselect':
db.c.text+0x8f): undefined reference to `PQexec'
db.c.text+0xab): undefined reference to `PQresultStatus'
db.c.text+0xba): undefined reference to `PQntuples'
db.c.text+0x134): undefined reference to `PQresultErrorMessage'
db.c.text+0x140): undefined reference to `PQresultStatus'
db.c.text+0x148): undefined reference to `PQresStatus'
../../src/libs/zbxdb/libzbxdb.a(db.o): In function `zbx_db_fetch':
db.c.text+0x219): undefined reference to `PQnfields'
db.c.text+0x28d): undefined reference to `PQgetisnull'
db.c.text+0x2ac): undefined reference to `PQgetvalue'
db.c.text+0x2bc): undefined reference to `PQftype'
../../src/libs/zbxdb/libzbxdb.a(db.o): In function `PG_DBfree_result':
db.c.text+0x32d): undefined reference to `PQclear'
../../src/libs/zbxdb/libzbxdb.a(db.o): In function `zbx_db_insert_id':
db.c.text+0x3c6): undefined reference to `PQgetvalue'
../../src/libs/zbxdb/libzbxdb.a(db.o): In function `zbx_db_vexecute':
db.c.text+0x44a): undefined reference to `PQexec'
db.c.text+0x45c): undefined reference to `PQresultStatus'
db.c.text+0x481): undefined reference to `PQresultErrorMessage'
db.c.text+0x48b): undefined reference to `PQresultStatus'
db.c.text+0x493): undefined reference to `PQresStatus'
db.c.text+0x4bc): undefined reference to `PQclear'
db.c.text+0x4da): undefined reference to `PQntuples'
../../src/libs/zbxdb/libzbxdb.a(db.o): In function `zbx_db_connect':
db.c.text+0x5fe): undefined reference to `PQsetdbLogin'
db.c.text+0x61e): undefined reference to `PQstatus'
db.c.text+0x6ae): undefined reference to `PQsetdbLogin'
db.c.text+0x6ca): undefined reference to `PQerrorMessage'
../../src/libs/zbxdb/libzbxdb.a(db.o): In function `zbx_db_close':
db.c.text+0x70f): undefined reference to `PQfinish'
collect2: ld returned 1 exit status
Same error with zabbix_server.
I fixed this issues for myself with a quick hack by adding -lldap/-lpq into xxx_LDADD (you must fix this more properly)
- is duplicated by
-
ZBX-4535 zabbix - FTBFS with ld --as-needed
- Closed