[ZBX-23014] Zabbix 7.0.0alpha2 build failed in HP-UX Created: 2023 Jun 23  Updated: 2024 Apr 10  Resolved: 2023 Oct 13

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G)
Affects Version/s: 6.0.22, 6.4.7, 7.0.0alpha2
Fix Version/s: 6.0.23rc1, 6.4.8rc1, 7.0.0alpha3, 7.0.0alpha7, 7.0 (plan)

Type: Problem report Priority: Major
Reporter: Yuuki Enomoto Assignee: Artjoms Rimdjonoks
Resolution: Fixed Votes: 0
Labels: agent
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:
  • HP-UX hpux11i3 B.11.31 U ia64 3932273393 unlimited-user license
  • gcc (GCC) 4.2.3

Attachments: Text File build.log    
Issue Links:
Causes
causes ZBX-23645 Agent build broken on AIX Closed
Duplicate
Team: Team C
Sprint: Sprint 102 (Jul 2023), Sprint 105 (Oct 2023)
Story Points: 1

 Description   

Steps to reproduce:

  1. Do configure in zabbix-7.0.0alpha2 source directory
    #  CC=/usr/bin/gcc CFLAGS=-std=gnu99 ./configure --enable-agent --sysconfdir=/etc/zabbix --localstatedir=/var --with-libpcre2 --with-libpcre2-lib=/usr/local/pcre2-10.42/lib --with-libpcre2-include=/usr/local/pcre2-10.42/include --with-openssl=/usr/local/openssl-1.1.1u
  1. Run make
    # make

Result:

        /usr/bin/gcc -DZABBIX_DAEMON  -DDEFAULT_CONFIG_FILE="\"/etc/zabbix/zabbix_agentd.conf\""  -DDEFAULT_LOAD_MODULE_PATH="\"/usr/local/lib/modules\""  -I/usr/local/openssl-1.1.1u/include -std=gnu99  -I/usr/local/pcre2-10.42/include  -L/usr/local/openssl-1.1.1u/lib   -L/usr/local/pcre2-10.42/lib  -o zabbix_agentd zabbix_agentd-zabbix_agentd.o libzbxagent.a  active_checks/libzbxactive_checks.a  logfiles/libzbxlogfiles.a  ../../src/libs/zbxsysinfo/libzbxagentsysinfo.a  ../../src/libs/zbxsysinfo/hpux/libspecsysinfo.a  ../../src/libs/zbxsysinfo/hpux/libspechostnamesysinfo.a  ../../src/libs/zbxsysinfo/agent/libagentsysinfo.a  ../../src/libs/zbxsysinfo/common/libcommonsysinfo.a  ../../src/libs/zbxsysinfo/common/libcommonsysinfo_httpmetrics.a  ../../src/libs/zbxsysinfo/common/libcommonsysinfo_http.a  ../../src/libs/zbxsysinfo/simple/libsimplesysinfo.a  ../../src/libs/zbxsysinfo/alias/libalias.a  ../../src/libs/zbxlog/libzbxlog.a  ../../src/libs/zbxregexp/libzbxregexp.a  ../../src/libs/zbxthreads/libzbxthreads.a  ../../src/libs/zbxmutexs/libzbxmutexs.a  ../../src/libs/zbxprof/libzbxprof.a  ../../src/libs/zbxnix/libzbxnix.a  ../../src/libs/zbxcomms/libzbxcomms.a  ../../src/libs/zbxcommshigh/libzbxcommshigh.a  ../../src/libs/zbxconf/libzbxconf.a  ../../src/libs/zbxjson/libzbxjson.a  ../../src/libs/zbxalgo/libzbxalgo.a  ../../src/libs/zbxvariant/libzbxvariant.a  ../../src/libs/zbxcommon/libzbxcommon.a  ../../src/libs/zbxgetopt/libzbxgetopt.a  ../../src/libs/zbxhash/libzbxhash.a  ../../src/libs/zbxcrypto/libzbxcrypto.a  ../../src/libs/zbxexec/libzbxexec.a  ../../src/libs/zbxcompress/libzbxcompress.a  ../../src/libs/zbxmodules/libzbxmodules.a  ../../src/libs/zbxhttp/libzbxhttp.a  ../../src/libs/zbxfile/libzbxfile.a  ../../src/libs/zbxip/libzbxip.a  ../../src/libs/zbxtime/libzbxtime.a  ../../src/libs/zbxnum/libzbxnum.a  ../../src/libs/zbxstr/libzbxstr.a  ../../src/libs/zbxparam/libzbxparam.a  ../../src/libs/zbxexpr/libzbxexpr.a  -lssl -lcrypto   -lpthread -lm    -lpcre2-8 -liconv
ld: Unsatisfied symbol "zbx_get_diskstat" in file ../../src/libs/zbxsysinfo/common/libcommonsysinfo.a[libcommonsysinfo_a-diskdevices.o]
1 errors.
collect2: ld returned 1 exit status
*** Error exit code 1 

Expected:
Pass build in HP-UX.



 Comments   
Comment by Andris Mednis [ 2023 Jun 29 ]

Hi, uki!

In ZBX-2015 you described 'configure' step on HP-UX:

# PATH=/usr/local/bin:/usr/local/sbin:/usr/local/ia64/bin/gcc:$PATH CFLAGS=-std=gnu99 ./configure --enable-agent --sysconfdir=/etc/zabbix --localstatedir=/var --with-libpcre2 --with-libpcre2-lib=/usr/local/pcre2-10.42/lib --with-libpcre2-include=/usr/local/pcre2-10.42/include --with-openssl=/usr/local/openssl-1.1.1u CC=/usr/bin/gcc

Can you try it with CFLAGS="-std=gnu99 -Wl,-v" to collect more info from linker?

Comment by Yuuki Enomoto [ 2023 Jun 30 ]

Thank you for your actions!

I tried build with the options. Output is long, so I attached as "build.log".

Comment by Andris Mednis [ 2023 Jun 30 ]

Hi, uki!

One problem is failing compilation on HP-UX. But there is another one - currently you are compiling Zabbix agent in 32-bit mode (default). I'm afraid some things would require 64-bit agent. You may want to try adding "-mlp64" to CFLAGS - but that will require PCRE2 and OpenSSL libraries to be 64-bit, too.

But let's try to solve compilation problem first.
The error

ld: Unsatisfied symbol "zbx_get_diskstat" in file ../../src/libs/zbxsysinfo/common/libcommonsysinfo.a[libcommonsysinfo_a-diskdevices.o]

could be caused by the fact that libcommonsysinfo needs "zbx_get_diskstat" from ../../src/libs/zbxsysinfo/hpux/libspecsysinfo.a which is mentioned before libcommonsysinfo on command line and not searched again.
Can you try to repeat linking step with "-(   -) " arguments added to enforce repeated search for unresolved symbols:

/usr/bin/gcc -DZABBIX_DAEMON -DDEFAULT_CONFIG_FILE="\"/etc/zabbix/zabbix_agentd.conf\"" -DDEFAULT_LOAD_MODULE_PATH="\"/usr/local/lib/modules\"" -I/usr/local/openssl-1.1.1u/include -std=gnu99 -I/usr/local/pcre2-10.42/include -L/usr/local/openssl-1.1.1u/lib -L/usr/local/pcre2-10.42/lib -o zabbix_agentd zabbix_agentd-zabbix_agentd.o -( libzbxagent.a active_checks/libzbxactive_checks.a logfiles/libzbxlogfiles.a ../../src/libs/zbxsysinfo/libzbxagentsysinfo.a ../../src/libs/zbxsysinfo/hpux/libspecsysinfo.a ../../src/libs/zbxsysinfo/hpux/libspechostnamesysinfo.a ../../src/libs/zbxsysinfo/agent/libagentsysinfo.a ../../src/libs/zbxsysinfo/common/libcommonsysinfo.a ../../src/libs/zbxsysinfo/common/libcommonsysinfo_httpmetrics.a ../../src/libs/zbxsysinfo/common/libcommonsysinfo_http.a ../../src/libs/zbxsysinfo/simple/libsimplesysinfo.a ../../src/libs/zbxsysinfo/alias/libalias.a ../../src/libs/zbxlog/libzbxlog.a ../../src/libs/zbxregexp/libzbxregexp.a ../../src/libs/zbxthreads/libzbxthreads.a ../../src/libs/zbxmutexs/libzbxmutexs.a ../../src/libs/zbxprof/libzbxprof.a ../../src/libs/zbxnix/libzbxnix.a ../../src/libs/zbxcomms/libzbxcomms.a ../../src/libs/zbxcommshigh/libzbxcommshigh.a ../../src/libs/zbxconf/libzbxconf.a ../../src/libs/zbxjson/libzbxjson.a ../../src/libs/zbxalgo/libzbxalgo.a ../../src/libs/zbxvariant/libzbxvariant.a ../../src/libs/zbxcommon/libzbxcommon.a ../../src/libs/zbxgetopt/libzbxgetopt.a ../../src/libs/zbxhash/libzbxhash.a ../../src/libs/zbxcrypto/libzbxcrypto.a ../../src/libs/zbxexec/libzbxexec.a ../../src/libs/zbxcompress/libzbxcompress.a ../../src/libs/zbxmodules/libzbxmodules.a ../../src/libs/zbxhttp/libzbxhttp.a ../../src/libs/zbxfile/libzbxfile.a ../../src/libs/zbxip/libzbxip.a ../../src/libs/zbxtime/libzbxtime.a ../../src/libs/zbxnum/libzbxnum.a ../../src/libs/zbxstr/libzbxstr.a ../../src/libs/zbxparam/libzbxparam.a ../../src/libs/zbxexpr/libzbxexpr.a -) -lssl -lcrypto -lpthread -lm -lpcre2-8 -liconv

Comment by Yuuki Enomoto [ 2023 Jul 03 ]

Hello Andris,

I tried to use the options but these are unrecognized option in my HP-UX.

# cd src/zabbix_agent
# /usr/bin/gcc -DZABBIX_DAEMON  -DDEFAULT_CONFIG_FILE="\"/etc/zabbix/zabbix_agentd.conf\""  -DDEFAULT_LOAD_MODULE_PATH="\"/usr/local/lib/modules\""  -I/usr/local/openssl-1.1.1u/include -std=gnu99  -I/usr/local/pcre2-10.42/include  -L/usr/local/openssl-1.1.1u/lib   -L/usr/local/pcre2-10.42/lib  -o zabbix_agentd zabbix_agentd-zabbix_agentd.o "-(" libzbxagent.a  active_checks/libzbxactive_checks.a  logfiles/libzbxlogfiles.a  ../../src/libs/zbxsysinfo/libzbxagentsysinfo.a  ../../src/libs/zbxsysinfo/hpux/libspecsysinfo.a  ../../src/libs/zbxsysinfo/hpux/libspechostnamesysinfo.a  ../../src/libs/zbxsysinfo/agent/libagentsysinfo.a  ../../src/libs/zbxsysinfo/common/libcommonsysinfo.a  ../../src/libs/zbxsysinfo/common/libcommonsysinfo_httpmetrics.a  ../../src/libs/zbxsysinfo/common/libcommonsysinfo_http.a  ../../src/libs/zbxsysinfo/simple/libsimplesysinfo.a  ../../src/libs/zbxsysinfo/alias/libalias.a  ../../src/libs/zbxlog/libzbxlog.a  ../../src/libs/zbxregexp/libzbxregexp.a  ../../src/libs/zbxthreads/libzbxthreads.a  ../../src/libs/zbxmutexs/libzbxmutexs.a  ../../src/libs/zbxprof/libzbxprof.a  ../../src/libs/zbxnix/libzbxnix.a  ../../src/libs/zbxcomms/libzbxcomms.a  ../../src/libs/zbxcommshigh/libzbxcommshigh.a  ../../src/libs/zbxconf/libzbxconf.a  ../../src/libs/zbxjson/libzbxjson.a  ../../src/libs/zbxalgo/libzbxalgo.a  ../../src/libs/zbxvariant/libzbxvariant.a  ../../src/libs/zbxcommon/libzbxcommon.a  ../../src/libs/zbxgetopt/libzbxgetopt.a  ../../src/libs/zbxhash/libzbxhash.a  ../../src/libs/zbxcrypto/libzbxcrypto.a  ../../src/libs/zbxexec/libzbxexec.a  ../../src/libs/zbxcompress/libzbxcompress.a  ../../src/libs/zbxmodules/libzbxmodules.a  ../../src/libs/zbxhttp/libzbxhttp.a  ../../src/libs/zbxfile/libzbxfile.a  ../../src/libs/zbxip/libzbxip.a  ../../src/libs/zbxtime/libzbxtime.a  ../../src/libs/zbxnum/libzbxnum.a  ../../src/libs/zbxstr/libzbxstr.a  ../../src/libs/zbxparam/libzbxparam.a  ../../src/libs/zbxexpr/libzbxexpr.a "-)"  -lssl -lcrypto   -lpthread -lm    -lpcre2-8 -liconv
gcc: unrecognized option '-('
gcc: unrecognized option '-)'
ld: Unsatisfied symbol "zbx_get_diskstat" in file ../../src/libs/zbxsysinfo/common/libcommonsysinfo.a[libcommonsysinfo_a-diskdevices.o]
1 errors.
collect2: ld returned 1 exit status
Comment by Andris Mednis [ 2023 Jul 07 ]

Hi, uki!

You can try a fix from development branch  feature/ZBX-23014-6.5.

It works on HP-UX 11.23.

Comment by Yuuki Enomoto [ 2023 Jul 10 ]

Hello Andris,

I tried the branch. It works fine! Thank you!

# ./src/zabbix_agent/zabbix_agentd --version
zabbix_agentd (daemon) (Zabbix) 7.0.0alpha3
Revision 245cb6cc481 20 June 2023, compilation time: Jul 10 2023 11:40:08Copyright (C) 2023 Zabbix SIA
License GPLv2+: GNU GPL version 2 or later <https://www.gnu.org/licenses/>.
This is free software: you are free to change and redistribute it according to
the license. There is NO WARRANTY, to the extent permitted by law.This product includes software developed by the OpenSSL Project
for use in the OpenSSL Toolkit (http://www.openssl.org/).Compiled with OpenSSL 1.1.1u  30 May 2023
Running with OpenSSL 1.1.1u  30 May 2023
Comment by Andris Mednis [ 2023 Jul 10 ]

Thanks, uki for confirmation that fix works!

The fix was developed by arimdjonoks.

Comment by Artjoms Rimdjonoks [ 2023 Jul 14 ]

Available in versions:

+ additional fix for master (HP-UX with bundled compiler)

Comment by Artjoms Rimdjonoks [ 2023 Aug 07 ]

Also, available in test-branches for testing:
feature/ZBX-23014-6.4
feature/ZBX-23014-6.0

<andris> Reviewed.

<andris> Updated feature/ZBX-23014-6.0 branch to latest release/6.0, added fixes
b311735a822 and 2726af919be to fix compilation with HP cc (confirmed - the fixes work, agent can be compiled with HP bundled cc compiler on HP-UX 11.23 Itanium, without gcc).

<arimdjonoks> I believe, that instead of adding C99 incompatible fix (which is Zabbix standard), we could instead pass

-AC99

flag to hp-ux compiler
https://flylib.com/books/en/2.872.1.117/1/

andris, was this flag used initially on the customer machine?

<andris> I was not aware of '-AC99', I recommended '-Ae' option, which according to docs is the same:

-AC99
The -AC99 option invokes the compiler in ANSI C99 compilation mode with its features.
This is the default C compilation mode, and the following commands are equivalent:
cc
cc -Ae
cc -AC99
aCC -Ae
aCC -AC99
NOTE: This option will be removed in a future version of the compiler. Use the equivalent option +std=c99 to ensure that your builds do not break in future.

I asked to try with '-AC99'.

<andris> Answer: "AC99" and "Ae" options are not supported by HP-UX bundled cc compiler. Looks like these options require commercial HP compiler - very few users will have it. So, I propose to include fixes workarounds b311735a822 and 2726af919be to allow using a limited HP compiler which is available on every HP-UX.

<arimdjonoks> This is unfortunate, if we cannot require customers to use gcc on hp-ux, then I guess we have no choice, but to resort to this fix. Looks reasonable to me.

<andris> Well, we can propose to use gcc. Problem is limited choice of gcc versions for HP-UX downloadable from internet. Customer pays for turnkey solution, it becomes our problem how to cover old HP-UX versions.

<arimdjonoks> fix will need to be ported to the master branch as well, as the original fix for it was already released,
FIXED in feature/ZBX-23014-6.5-2

<andris> Reviewed up to cdc6336a2db, approved.

Generated at Tue Apr 15 08:59:33 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.