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

Libcurl ld path not getting set in zabbix_server makefile

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Workaround proposed
    • Icon: Minor Minor
    • None
    • 3.4.13
    • None
    • None

      Compiling on RHEL  6.9.

      Because of the higher curl depenancy, I am using the optional httpd24-curl packages.

      httpd24-libcurl-7.47.1-1.1.el6.x86_64

      httpd24-curl-7.47.1-1.1.el6.x86_64

      httpd24-libcurl-devel-7.47.1-1.1.el6.x86_64

      Which get installed in /opt/rh/httpd24. Usual procedure is to "enable" thier use by sourcing /opt/rh./httpd24/enable, which sets PATH, LD_LIBRARY_PATH and other related items to make sure you are using the right version. In this case, an LD_LIBRARY_PATH that includes

      /opt/rh/httpd24/root/usr/lib64

       

      When compiling, I got the following error while linking zabbix_server

      ../../src/libs/zbxhistory/libzbxhistory.a(history_elastic.o): In function `elastic_writer_flush':
      /opt/sysadmin/accounts/aladen/src/zabbix/zabbix-3.4.13/src/libs/zbxhistory/history_elastic.c:457: undefined reference to `curl_multi_wait'
      collect2: ld returned 1 exit status
      

       Which lead me to look at the linker flags.

      Looked in the Makefile that was generated for zabbix_server. Noticed that

      LIBCURL_LDFLAGS was not set. So I manually set it. (interestingly enough, LIBCURL_CFLAGS was set properly, so it was compiling against the right curl, just not linking against it.

      LIBCURL_LDFLAGS = -L/opt/rh/httpd24/root/usr/lib64

      Tried again. Same error. So I looked a little closer
      Noticed that "zabbix_server_LDFLAGS" doesn't actually use LIBCURL_LDFLAGS.
      So I manually updated that

      zabbix_server_LDFLAGS =    -L/opt/rh/httpd24/root/usr/lib64 -L/opt/rh/postgresql92/root/usr/lib64      -L/usr/lib64 -L/usr/lib   -L/usr/lib -L/usr/lib
      

      After which it compiled sucessfully.

      So the bug is that when configure builds the makefile for zabbix_server it should account for an alternate location of libcurl in both the compile and the linking.

        1. config.log
          284 kB
          Andrew Laden

            Unassigned Unassigned
            aladenov Andrew Laden
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: