Unable to compile static binaries

XMLWordPrintable

    • Type: Incident report
    • Resolution: Fixed
    • Priority: Major
    • None
    • Affects Version/s: 1.8.3
    • Component/s: Installation (I)
    • Environment:
      Ubuntu 10.10 / x86_64

      We would like to create static binaries for installing agents and proxies on our systems to:

      • create a single installation package for all the linux platforms in our environment
        (efficient installation, compiling and installation)
      • to prevent problems while doing system-upgrades


      cd zabbix-1.8.3
      make distclean;
      ./configure --prefix=/tmp/zabbix \
      --enable-static \
      --enable-proxy \
      --with-mysql \
      && make install

      Compilation fails with:
      (see also attached log)

      make[4]: Entering directory `/home/schoemar/temp/zabbix-1.8.3/src/zabbix_proxy/datasender'
      make[4]: Nothing to be done for `install-exec-am'.
      make[4]: Nothing to be done for `install-data-am'.
      make[4]: Leaving directory `/home/schoemar/temp/zabbix-1.8.3/src/zabbix_proxy/datasender'
      make[3]: Leaving directory `/home/schoemar/temp/zabbix-1.8.3/src/zabbix_proxy/datasender'
      make[3]: Entering directory `/home/schoemar/temp/zabbix-1.8.3/src/zabbix_proxy'
      gcc -DHAVE_CONFIG_H -I. -I../../include -DZABBIX_DAEMON -g -O2 -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -DUNIV_LINUX -DUNIV_LINUX -MT zabbix_proxy-servercomms.o -MD -MP -MF .deps/zabbix_proxy-servercomms.Tpo -c -o zabbix_proxy-servercomms.o `test -f 'servercomms.c' || echo './'`servercomms.c
      mv -f .deps/zabbix_proxy-servercomms.Tpo .deps/zabbix_proxy-servercomms.Po
      gcc -DHAVE_CONFIG_H -I. -I../../include -DZABBIX_DAEMON -g -O2 -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -DUNIV_LINUX -DUNIV_LINUX -MT zabbix_proxy-events.o -MD -MP -MF .deps/zabbix_proxy-events.Tpo -c -o zabbix_proxy-events.o `test -f 'events.c' || echo './'`events.c
      mv -f .deps/zabbix_proxy-events.Tpo .deps/zabbix_proxy-events.Po
      gcc -DHAVE_CONFIG_H -I. -I../../include -DZABBIX_DAEMON -g -O2 -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -DUNIV_LINUX -DUNIV_LINUX -MT zabbix_proxy-zlog.o -MD -MP -MF .deps/zabbix_proxy-zlog.Tpo -c -o zabbix_proxy-zlog.o `test -f 'zlog.c' || echo './'`zlog.c
      mv -f .deps/zabbix_proxy-zlog.Tpo .deps/zabbix_proxy-zlog.Po
      gcc -DHAVE_CONFIG_H -I. -I../../include -DZABBIX_DAEMON -g -O2 -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -DUNIV_LINUX -DUNIV_LINUX -MT zabbix_proxy-proxy.o -MD -MP -MF .deps/zabbix_proxy-proxy.Tpo -c -o zabbix_proxy-proxy.o `test -f 'proxy.c' || echo './'`proxy.c
      proxy.c: In function 'zbx_on_exit':
      proxy.c:651: warning: cast from pointer to integer of different size
      mv -f .deps/zabbix_proxy-proxy.Tpo .deps/zabbix_proxy-proxy.Po
      gcc -DZABBIX_DAEMON -g -O2 -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -DUNIV_LINUX -DUNIV_LINUX -L/usr/lib/mysql -rdynamic -static -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/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/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/zbxserver/libzbxserver.a ../../src/libs/zbxicmpping/libzbxicmpping.a ../../src/libs/zbxdbhigh/libzbxdbhigh.a ../../src/libs/zbxdb/libzbxdb.a -lmysqlclient -lm -lresolv
      ../../src/libs/zbxnix/libzbxnix.a(daemon.o): In function `daemon_start':
      /home/schoemar/temp/zabbix-1.8.3/src/libs/zbxnix/daemon.c:162: warning: Using 'initgroups' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
      /home/schoemar/temp/zabbix-1.8.3/src/libs/zbxnix/daemon.c:146: warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
      /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libmysqlclient.a(libmysql.o): In function `read_user_name':
      (.text+0x3ce8): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
      /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libmysqlclient.a(mf_pack.o): In function `unpack_dirname':
      (.text+0x9e0): warning: Using 'endpwent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
      ../../src/libs/zbxcomms/libzbxcomms.a(comms.o): In function `zbx_gethost':
      /home/schoemar/temp/zabbix-1.8.3/src/libs/zbxcomms/comms.c:208: warning: Using 'gethostbyaddr' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
      /home/schoemar/temp/zabbix-1.8.3/src/libs/zbxcomms/comms.c:203: warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
      /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libmysqlclient.a(my_gethostbyname.o): In function `my_gethostbyname_r':
      (.text+0x10): warning: Using 'gethostbyname_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
      ../../src/libs/zbxsysinfo/common/libcommonsysinfo.a(net.o): In function `CHECK_DNS_QUERY':
      /home/schoemar/temp/zabbix-1.8.3/src/libs/zbxsysinfo/common/net.c:546: warning: Using 'getprotobynumber' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
      /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libmysqlclient.a(libmysql.o): In function `mysql_server_init':
      (.text+0x4315): warning: Using 'getservbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
      ../../src/libs/zbxsysinfo/common/libcommonsysinfo.a(net.o): In function `CHECK_DNS_QUERY':
      /home/schoemar/temp/zabbix-1.8.3/src/libs/zbxsysinfo/common/net.c:560: warning: Using 'getservbyport' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
      /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libmysqlclient.a(yassl_int.o): In function `yaSSL::yassl_int_cpp_local2::GetSelf()':
      (.text+0x1e51): undefined reference to `pthread_self'
      /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libmysqlclient.a(my_compress.o): In function `my_uncompress':
      (.text+0x7d): undefined reference to `uncompress'
      /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libmysqlclient.a(my_compress.o): In function `my_compress_alloc':
      (.text+0x26b): undefined reference to `compress'
      /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libmysqlclient.a(my_compress.o): In function `my_compress':
      (.text+0x378): undefined reference to `compress'
      /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libmysqlclient.a(my_compress.o): In function `packfrm':
      (.text+0x53a): undefined reference to `compress'
      /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libmysqlclient.a(lock.o): In function `yaSSL::Mutex::Lock::~Lock()':
      (.text+0x34): undefined reference to `pthread_mutex_unlock'
      /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libmysqlclient.a(lock.o): In function `yaSSL::Mutex::Lock::~Lock()':
      (.text+0x44): undefined reference to `pthread_mutex_unlock'
      /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libmysqlclient.a(lock.o): In function `yaSSL::Mutex::Lock::Lock(yaSSL::Mutex&)':
      (.text+0x57): undefined reference to `pthread_mutex_lock'
      /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libmysqlclient.a(lock.o): In function `yaSSL::Mutex::Lock::Lock(yaSSL::Mutex&)':
      (.text+0x67): undefined reference to `pthread_mutex_lock'
      /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libmysqlclient.a(lock.o): In function `yaSSL::Mutex::~Mutex()':
      (.text+0x71): undefined reference to `pthread_mutex_destroy'
      /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libmysqlclient.a(lock.o): In function `yaSSL::Mutex::~Mutex()':
      (.text+0x81): undefined reference to `pthread_mutex_destroy'
      /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libmysqlclient.a(lock.o): In function `yaSSL::Mutex::Mutex()':
      (.text+0x93): undefined reference to `pthread_mutex_init'
      /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libmysqlclient.a(lock.o): In function `yaSSL::Mutex::Mutex()':
      (.text+0xa3): undefined reference to `pthread_mutex_init'
      /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__register_frame_info_bases':
      (.text+0x42): undefined reference to `pthread_mutex_lock'
      /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__register_frame_info_table_bases':
      (.text+0xdb): undefined reference to `pthread_mutex_lock'
      /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `_Unwind_Find_FDE':
      (.text+0x1776): undefined reference to `pthread_mutex_lock'
      /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `_Unwind_Find_FDE':
      (.text+0x17c7): undefined reference to `pthread_mutex_unlock'
      /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__deregister_frame_info_bases':
      (.text+0x1992): undefined reference to `pthread_mutex_lock'
      /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__deregister_frame_info_bases':
      (.text+0x1a16): undefined reference to `pthread_mutex_unlock'
      /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__register_frame_info_bases':
      (.text+0x61): undefined reference to `pthread_mutex_unlock'
      /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__register_frame_info_table_bases':
      (.text+0xfa): undefined reference to `pthread_mutex_unlock'
      collect2: ld returned 1 exit status
      make[3]: *** [zabbix_proxy] Error 1
      make[3]: Leaving directory `/home/schoemar/temp/zabbix-1.8.3/src/zabbix_proxy'
      make[2]: *** [install-recursive] Error 1
      make[2]: Leaving directory `/home/schoemar/temp/zabbix-1.8.3/src/zabbix_proxy'
      make[1]: *** [install-recursive] Error 1
      make[1]: Leaving directory `/home/schoemar/temp/zabbix-1.8.3/src'
      make: *** [install-recursive] Error 1

            Assignee:
            Unassigned
            Reporter:
            Marc Schoechlin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: