[ZBX-13450] Can not compile zabbix_server on Solaris 10 (gcc) Created: 2018 Feb 07  Updated: 2018 Jun 12  Resolved: 2018 Apr 02

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 3.4.6
Fix Version/s: 3.4.8rc1, 4.0.0alpha5, 4.0 (plan)

Type: Problem report Priority: Trivial
Reporter: Little Martian Assignee: Michael Veksler
Resolution: Fixed Votes: 0
Labels: compilation
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Solaris 10 SPARC (T4-2)


Team: Team C
Sprint: Sprint 27, Sprint 28, Sprint 29, Sprint 30
Story Points: 1

 Description   

Hi,
I keep trying to compile version 3.4.6 (probabily any 3.4 source are the same) and it stops when linking libipmi.a with the error described below.

On the same machine, same environment, I can compile successfully 3.2 version (3.2.5 is running on the machine, compiled in the same environment).

Can you help me tracking the problem ? I found on the internet that Solaris has a problem with "empty" archive objects and I tried to add an integer definition in ipmi.h but compilation still failes in the same point. Please keep in mind that I do not use IPMI at all, and OpenIPMI does not compile on Solaris (I tried with version 2.0.24).

Thank you.
PS. I expect I will have the same problem in version 4.x so solving this would really help me in the future versions.

Steps to reproduce:
Compile from source (zabbix-3.4.6.tar.gz) on Solaris 10 SPARC with GNU utils (gcc 5.2.0 from OpenCSW - http://www.opencsw.org)

  1. Changes in configuration...
  • Add definitions to src/libs/zbxsysinfo/solaris/proc.c:
    #ifndef SSLEEP
    #define SSLEEP  1               /* awaiting an event */
    #define SRUN    2               /* running */
    #define SZOMB   3               /* process terminated but not waited for */
    #define SSTOP   4               /* process stopped by debugger */
    #define SIDL    5               /* intermediate state in process creation */
    #define SONPROC 6               /* process is being run on a processor */
    #define SWAIT   7               /* process is waiting to become runnable */
    #endif
    
  • Remove -m64 from configure, configure.ac (conflicts with mixed 32 and 64 libs). Use predefined CFLAGS for 32 bit or 64 bit compilation.
  1. Navigate to screen title...
  2. Click on screen element...
  3. ...

Result:
See screenshot...
Relevant line:
ld: elf error: file ipmi/libipmi.a: elf_getarsym
See log file...

 
gmake
.....
mv -f .deps/zabbix_server-operations.Tpo .deps/zabbix_server-operations.Po
mv -f .deps/zabbix_server-server.Tpo .deps/zabbix_server-server.Po
mv -f .deps/zabbix_server-actions.Tpo .deps/zabbix_server-actions.Po
mv -f .deps/zabbix_server-events.Tpo .deps/zabbix_server-events.Po
gcc -DZABBIX_DAEMON -DSYSCONFDIR="\"/opt/monitor/home/local32/etc\"" -DDATADIR="\"/opt/monitor/home/local32/share\"" -DLIBDIR="\"/opt/monitor/home/local32/lib\"" -I../../src/libs/zbxdbcache  -m32 -I/opt/monitor/home/local/csw/include -m32 -D__EXTENSIONS__ -I/opt/monitor/home/local32/include -I/opt/monitor/home/local32/include -I/opt/monitor/home/local/include -I/opt/monitor/home/local/csw/include -I/opt/monitor/home/local/csw/include/libxml2 -I/opt/monitor/home/local/csw/include/libxml2/libxml -I/opt/monitor/home/local/csw/include/readline -I/opt/monitor/home/local/csw/include/dbi -I/opt/monitor/home/local/csw/include/net-snmp -I/opt/monitor/home/local/csw/include/ncurses -I/opt/monitor/home/local/csw/include/ncursesw -I/opt/monitor/home/local/csw/include/c++ -I/opt/monitor/home/local/csw/include/c++/5.2.0 -I/opt/monitor/home/local/csw/include/gdb -I/opt/monitor/home/local/csw/include/libpng15 -I/opt/monitor/home/local/csw/include/libltdl -I/opt/monitor/home/local/oracle/sdk/include -I/usr/include -I/usr/local/include -L/opt/monitor/home/local32/lib      -L/opt/monitor/home/local/csw/lib   -L/opt/monitor/home/local/csw/lib -L/opt/monitor/home/local/csw/lib  -L/opt/monitor/home/local/csw/lib -L/opt/monitor/home/local32/lib   -L/opt/monitor/home/local/csw/lib -L/opt/monitor/home/local/csw/lib -L/opt/monitor/home/local/csw/lib -L/opt/monitor/home/local/csw/lib -L/opt/monitor/home/local32/lib -L/opt/monitor/home/local/csw/lib -L/opt/monitor/home/local/csw/libexec -L/opt/monitor/home/local32/lib -L/opt/monitor/home/local/oracle -L/usr/local/lib  -o zabbix_server zabbix_server-actions.o zabbix_server-operations.o zabbix_server-events.o zabbix_server-server.o  alerter/libzbxalerter.a dbsyncer/libzbxdbsyncer.a dbconfig/libzbxdbconfig.a discoverer/libzbxdiscoverer.a pinger/libzbxpinger.a poller/libzbxpoller.a housekeeper/libzbxhousekeeper.a timer/libzbxtimer.a trapper/libzbxtrapper.a snmptrapper/libzbxsnmptrapper.a httppoller/libzbxhttppoller.a escalator/libzbxescalator.a proxypoller/libzbxproxypoller.a selfmon/libzbxselfmon.a vmware/libzbxvmware.a taskmanager/libzbxtaskmanager.a ipmi/libipmi.a scripts/libzbxscripts.a preprocessor/libpreprocessor.a ../../src/libs/zbxsysinfo/libzbxserversysinfo.a ../../src/libs/zbxsysinfo/common/libcommonsysinfo.a ../../src/libs/zbxsysinfo/simple/libsimplesysinfo.a ../../src/libs/zbxlog/libzbxlog.a ../../src/libs/zbxserver/libzbxserver.a ../../src/libs/zbxdbcache/libzbxdbcache.a ../../src/libs/zbxhistory/libzbxhistory.a ../../src/libs/zbxmemory/libzbxmemory.a ../../src/libs/zbxregexp/libzbxregexp.a ../../src/libs/zbxself/libzbxself.a ../../src/libs/zbxnix/libzbxnix.a ../../src/libs/zbxalgo/libzbxalgo.a ../../src/libs/zbxsys/libzbxsys.a ../../src/libs/zbxconf/libzbxconf.a ../../src/libs/zbxmedia/libzbxmedia.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/zbxhttp/libzbxhttp.a ../../src/libs/zbxipcservice/libzbxipcservice.a ../../src/libs/zbxexec/libzbxexec.a ../../src/libs/zbxicmpping/libzbxicmpping.a ../../src/libs/zbxdbupgrade/libzbxdbupgrade.a ../../src/libs/zbxdbhigh/libzbxdbhigh.a ../../src/libs/zbxdb/libzbxdb.a ../../src/libs/zbxmodules/libzbxmodules.a ../../src/libs/zbxtasks/libzbxtasks.a   -lmysqlclient  -lsocket -lnsl -lm -lrt     -lxml2    -lnetsnmp -lssh2  -levent -lssl -lcrypto   -lcurl -lcares -lnghttp2 -lidn -lrtmp -lssh2 -lpsl -lssl -lcrypto -lssl -lcrypto -lintl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -llber -lldap -lz -lrt -lsocket -lnsl  -lkvm -lm -lrt -lnsl -lkstat -lsocket -lresolv  -lpcreposix -lpcre -liconv
ld: elf error: file ipmi/libipmi.a: elf_getarsym
ld: warning: symbol 'deflate_copyright' has differing sizes:
        (file /opt/monitor/home/local32/lib/libmysqlclient.so value=0x35; file /opt/monitor/home/local/csw/lib/libz.so value=0x44);
        /opt/monitor/home/local32/lib/libmysqlclient.so definition taken
ld: fatal: file processing errors. No output written to zabbix_server
collect2: error: ld returned 1 exit status
Makefile:611: recipe for target 'zabbix_server' failed
gmake[3]: *** [zabbix_server] Error 1
gmake[3]: Leaving directory '/opt/monitor/home/dev/zabbix/zabbix-3.4.6/src/zabbix_server'
Makefile:720: recipe for target 'all-recursive' failed
gmake[2]: *** [all-recursive] Error 1
gmake[2]: Leaving directory '/opt/monitor/home/dev/zabbix/zabbix-3.4.6/src/zabbix_server'
Makefile:465: recipe for target 'all-recursive' failed
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory '/opt/monitor/home/dev/zabbix/zabbix-3.4.6/src'
Makefile:471: recipe for target 'all-recursive' failed
gmake: *** [all-recursive] Error 1

See memory dump...
Expected:
See screenshot...
See attached patch file...



 Comments   
Comment by Glebs Ivanovskis (Inactive) [ 2018 Feb 09 ]

I tried to add an integer definition in ipmi.h

Header files are not compiled, you should try same trick with .c file.

There was a similar problem with MySQL and one of suggested fixes was:

+++ sql/ha_ndbcluster.cc        2010-01-06 18:19:02 +0000
@@ -10565,4 +10565,6 @@
 }
 mysql_declare_plugin_end;

+#else
+int Sun_ar_require_a_symbol_here= 0;
 #endif
Comment by Little Martian [ 2018 Feb 12 ]

Yes, headers are not compiled but they are included in the c file that is compiled. I tried to put the definition like in the MySQL case, before the #endif in the header and also as an #else case. The same result, library was not linked. I tried to inspect the definitions with 'nm' and I could only find some curl functions. The conditional includes and defines are probably preventing that code to compile as I do not have OpenIPMP in the configuration.

Comment by Viktors Tjarve [ 2018 Mar 09 ]

Please resolve (2) before merging.
Successfully tested.

Generated at Thu Mar 28 22:49:42 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.