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

Server build from sources on OpenBSD is broken

XMLWordPrintable

    • Sprint 100 (May 2023), Sprint 101 (Jun 2023)
    • 1

      Steps to reproduce:

      1. Get fresh OpenBSD 7.2 installation
      2. Install pre-requisites (mariadb client, etc), install latest libevent2 from standard packages
      3. Run configure: 
        ./configure --enable-server --with-mysql --with-libevent-lib=/usr/local/lib --with-libevent-include=/usr/local/include --with-libpcre2=/usr/local

      Result:
      Configure fails with error:

      checking for libevent support... configure: error: Unable to use libevent (libevent check failed)

      config.log:

      configure:12448: cc -o conftest -g -O2 -I/usr/local/include  -rdynamic  -L/usr/local/lib conftest.c -lpthread -lkvm -lm -lexecinfo   -levent -levent_pthreads >&5
      ld: error: /usr/local/lib/libevent_pthreads.so.0.0: undefined reference to evthread_set_lock_callbacks [--no-allow-shlib-undefined]
      ld: error: /usr/local/lib/libevent_pthreads.so.0.0: undefined reference to evthread_set_condition_callbacks [--no-allow-shlib-undefined]

      Expected:

      Successful ./configure

      Analysis:

      OpenBSD includes some libevent.so by default. When libevent2 is installed from the packages, it comes with libevent_core and libevent_pthreads. It's recommended to use libevent_core instead of libevent by libevent authors. However, configure.sh tests for -llibevent which is incompatible with libevent_pthreads from the packages. configure should somehow detect such situations and link to the correct library (libevent_core). If I change -levent -levent_pthreads to -levent_core -levent_pthreads then the configure and make work fine.

            kprutkovs Konstantins Prutkovs
            Kalimulin Alex Kalimulin
            Team C
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: