[ZBX-22844] Server build from sources on OpenBSD is broken Created: 2023 May 24  Updated: 2024 Apr 10  Resolved: 2023 Jun 09

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 6.4.2
Fix Version/s: 6.4.4rc1, 7.0.0alpha2, 7.0 (plan)

Type: Problem report Priority: Trivial
Reporter: Alex Kalimulin Assignee: Konstantins Prutkovs (Inactive)
Resolution: Fixed Votes: 0
Labels: openbsd
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OpenBSD 7.2


Issue Links:
Sub-task
part of ZBX-22307 Zabbix FTBFS on OpenBSD Closed
Team: Team C
Sprint: Sprint 100 (May 2023), Sprint 101 (Jun 2023)
Story Points: 1

 Description   

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.



 Comments   
Comment by Konstantins Prutkovs (Inactive) [ 2023 Jun 09 ]

kprutkovs RESOLVED in feature/ZBX-22844-6.5

Comment by Konstantins Prutkovs (Inactive) [ 2023 Jun 09 ]

Available in versions:

Generated at Sun Apr 20 21:02:05 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.