Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-4535

zabbix - FTBFS with ld --as-needed

    XMLWordPrintable

    Details

    • Type: Incident report
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.8.9, 1.8.10
    • Fix Version/s: 1.8.11, 1.9.9 (beta)
    • Component/s: Agent (G), Server (S)
    • Labels:
      None
    • Environment:
      Ubuntu Dev Precise (12.04)

      Description

      Dear developers,

      zabbix fail to build with flag "ld --as-needed" enabled (as set in Ubuntu), trying to add LDAP and POSTGRESQL LIBS during compilation in the wrong place.

      Snippet from build fail about zabbix_agent and LDAP:
      i686-linux-gnu-gcc -Wall -g -O2 -I/usr/include/postgresql -I/usr/local/include -I/usr/lib/perl/5.14/CORE -I. -I/usr/include -I/usr/include -I/usr/include -I/usr/include -rdynamic -Wl,-Bsymbolic-functions -Wl,-z,relro -o zabbix_agent -L/usr/lib -lldap -llber zabbix_agent.o stats.o cpustat.o diskdevices.o perfstat.o vmstats.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/zbxalgo/libzbxalgo.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 ../../src/libs/zbxexec/libzbxexec.a -lm -lresolv
      ../../src/libs/zbxsysinfo/simple/libsimplesysinfo.a(simple.o): In function `check_ldap':
      /tmp/buildd/zabbix-1.8.9/debian/tmp-build-PGSQL/src/libs/zbxsysinfo/simple/simple.c:57: undefined reference to `ldap_init'
      /tmp/buildd/zabbix-1.8.9/debian/tmp-build-PGSQL/src/libs/zbxsysinfo/simple/simple.c:63: undefined reference to `ldap_search_s'
      ...

      Snippet from build fail about zabbix_server and POSTGRESQL:
      x86_64-linux-gnu-gcc -Wall -g -O2 -I/usr/include/postgresql -I/usr/local/include -I/usr/lib/perl/5.14/CORE -I. -I/usr/include -I/usr/include -I/usr/include -I/usr/include -rdynamic -Wl,-Bsymbolic-functions -Wl,-z,relro -o zabbix_server -L/usr/lib -lpq -liksemel -L/usr/lib/x86_64-linux-gnu -lcurl -L/usr/lib -lnetsnmp -L/usr/lib -lnetsnmp -L/usr/lib -L/usr/lib -L/usr/lib zabbix_server-actions.o zabbix_server-operations.o zabbix_server-events.o zabbix_server-zlog.o 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 nodewatcher/libzbxnodewatcher.a utils/libzbxutils.a httppoller/libzbxhttppoller.a watchdog/libzbxwatchdog.a escalator/libzbxescalator.a proxypoller/libzbxproxypoller.a selfmon/libzbxselfmon.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/zbxdbcache/libzbxdbcache.a ../../src/libs/zbxmemory/libzbxmemory.a ../../src/libs/zbxalgo/libzbxalgo.a ../../src/libs/zbxnix/libzbxnix.a ../../src/libs/zbxsys/libzbxsys.a ../../src/libs/zbxconf/libzbxconf.a ../../src/libs/zbxmedia/libzbxmedia.a ../../src/libs/zbxcommon/libzbxcommon.a ../../src/libs/zbxcrypto/libzbxcrypto.a ../../src/libs/zbxcomms/libzbxcomms.a ../../src/libs/zbxcommshigh/libzbxcommshigh.a ../../src/libs/zbxjson/libzbxjson.a ../../src/libs/zbxexec/libzbxexec.a ../../src/libs/zbxself/libzbxself.a ../../src/libs/zbxserver/libzbxserver.a ../../src/libs/zbxicmpping/libzbxicmpping.a ../../src/libs/zbxdbhigh/libzbxdbhigh.a ../../src/libs/zbxdb/libzbxdb.a -liksemel -lcurl -lnetsnmp -lssh2 -lOpenIPMI -lOpenIPMIposix -lm -lresolv
      ../../src/libs/zbxdb/libzbxdb.a(db.o): In function `zbx_db_close':
      /tmp/buildd/zabbix-1.8.9/debian/tmp-build-PGSQL/src/libs/zbxdb/db.c:443: undefined reference to `PQfinish'
      ../../src/libs/zbxdb/libzbxdb.a(db.o): In function `zbx_db_vexecute':
      /tmp/buildd/zabbix-1.8.9/debian/tmp-build-PGSQL/src/libs/zbxdb/db.c:815: undefined reference to `PQexec'

      The attached patch fixes both problems, it moves '-lldap -llber' into LDAP_LIBS (exporting it and using in configure.in) and '-lpq' into POSTGRESQL_LIBS as well (already exported and defined into configure.in).

      Can you kindly consider to apply this patch?

      Thanks,

      Leo.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              l3on Leo Iannacone
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: