[ZBX-20515] 6.0.0beta3 build failed in AIX 7.1 Created: 2022 Feb 01  Updated: 2022 Feb 07  Resolved: 2022 Feb 04

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G)
Affects Version/s: 6.0.0beta3
Fix Version/s: None

Type: Problem report Priority: Blocker
Reporter: Yuji Kamada Assignee: Zabbix Development Team
Resolution: Cannot Reproduce Votes: 0
Labels: agent
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

AIX soaxp077 1 7 00CADA644C00
gcc (GCC) 6.3.0


Attachments: File ZBX-20515.diff    
Issue Links:
Causes
Sprint: Sprint 85 (Feb 2022)

 Description   

Steps to reproduce:

  1. ./configure CFLAGS="-lpthread" --enable-agent --enable-ipv6 --sysconfdir=/etc/zabbix --with-libpcre2 --with-libpcre2-lib=/usr/local/pcre2-10.39/lib --with-libpcre2-include=/usr/local/pcre2-10.39/include --with-openssl=/usr/local/openssl-1.1.1m

  2. make

Result:

        mv -f .deps/libzbxcrypto_a-sha256crypt.Tpo .deps/libzbxcrypto_a-sha256crypt.Po
        gcc -DHAVE_CONFIG_H -I. -I../../../include    -I/usr/local/openssl-1.1.1m/include -lpthread  -I/usr/local/pcre2-10.39/include -MT libzbxcrypto_a-sha512crypt.o -MD -MP -MF .deps/libzbxcrypto_a-sha512crypt.Tpo -c -o libzbxcrypto_a-sha512crypt.o `test -f 'sha512crypt.c' || echo './'`sha512crypt.c
In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include-fixed/fcntl.h:234:0,
                 from ../../../include/sysinc.h:157,
                 from ../../../include/common.h:23,
                 from sha512crypt.c:21:
/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include-fixed/unistd.h:210:16: error: conflicting types for 'lseek64'
 extern off64_t lseek64(int, off64_t, int);
                ^~~~~~~
/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include-fixed/unistd.h:208:14: note: previous declaration of 'lseek64' was here
 extern off_t lseek(int, off_t, int);
              ^
In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include-fixed/unistd.h:863:0,
                 from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include-fixed/fcntl.h:234,
                 from ../../../include/sysinc.h:157,
                 from ../../../include/common.h:23,
                 from sha512crypt.c:21:
/usr/include/sys/lockf.h:64:13: error: conflicting types for 'lockf64'
  extern int lockf64 (int, int, off64_t);
             ^~~~~~~
/usr/include/sys/lockf.h:62:13: note: previous declaration of 'lockf64' was here
  extern int lockf (int, int, off_t);
             ^
In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include-fixed/fcntl.h:234:0,
                 from ../../../include/sysinc.h:157,
                 from ../../../include/common.h:23,
                 from sha512crypt.c:21:
/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include-fixed/unistd.h:936:14: error: conflicting types for 'ftruncate64'
  extern int  ftruncate64(int, off64_t);
              ^~~~~~~~~~~
In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include-fixed/fcntl.h:234:0,
                 from ../../../include/sysinc.h:157,
                 from ../../../include/common.h:23,
                 from sha512crypt.c:21:
/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include-fixed/unistd.h:934:14: note: previous declaration of 'ftruncate64' was here
  extern int  ftruncate(int, off_t);
              ^
In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include-fixed/fcntl.h:234:0,
                 from ../../../include/sysinc.h:157,
                 from ../../../include/common.h:23,
                 from sha512crypt.c:21:
/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include-fixed/unistd.h:993:14: error: conflicting types for 'truncate64'
  extern int  truncate64(const char *, off64_t);
              ^~~~~~~~~~
In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include-fixed/fcntl.h:234:0,
                 from ../../../include/sysinc.h:157,
                 from ../../../include/common.h:23,
                 from sha512crypt.c:21:
/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include-fixed/unistd.h:991:14: note: previous declaration of 'truncate64' was here
  extern int  truncate(const char *, off_t);
              ^
In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include-fixed/fcntl.h:234:0,
                 from ../../../include/sysinc.h:157,
                 from ../../../include/common.h:23,
                 from sha512crypt.c:21:
/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include-fixed/unistd.h:1012:18: error: conflicting types for 'pread64'
  extern ssize_t  pread64(int, void *, size_t, off64_t);
                  ^~~~~~~
/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include-fixed/unistd.h:1009:18: note: previous declaration of 'pread64' was here
  extern ssize_t  pread(int, void *, size_t, off_t);
                  ^
/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include-fixed/unistd.h:1013:18: error: conflicting types for 'pwrite64'
  extern ssize_t  pwrite64(int, const void *, size_t, off64_t);
                  ^~~~~~~~
/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include-fixed/unistd.h:1010:18: note: previous declaration of 'pwrite64' was here
  extern ssize_t  pwrite(int, const void *, size_t, off_t);
                  ^
/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include-fixed/unistd.h:1098:17: error: conflicting types for 'fclear64'
  extern off64_t fclear64(int, off64_t);
                 ^~~~~~~~
/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include-fixed/unistd.h:1095:15: note: previous declaration of 'fclear64' was here
  extern off_t fclear(int, off_t);
               ^
/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include-fixed/unistd.h:1099:13: error: conflicting types for 'fsync_range64'
  extern int fsync_range64(int, int, off64_t, off64_t);
             ^~~~~~~~~~~~~
/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include-fixed/unistd.h:1096:13: note: previous declaration of 'fsync_range64' was here
  extern int fsync_range(int, int, off_t, off_t);
             ^
make: The error code from the last command is 1.
Stop.
make: The error code from the last command is 1.
Stop.
make: The error code from the last command is 1.
Stop.
make: The error code from the last command is 1.
Stop. 

Expected:
Success build in AIX.



 Comments   
Comment by Vladislavs Sokurenko [ 2022 Feb 01 ]

Could you please check the patch ZBX-20515.diff, there have been redundant includes recently removed in 0ca2b2b1bbc

Comment by Andris Mednis [ 2022 Feb 01 ]

Not sure about CFLAGS="-lpthread".

I'm using

$ OBJECT_MODE=64 ; export OBJECT_MODE

and then -maix64:
CFLAGS="-Wall -Wextra -maix64 -g -O2 -DLIBICONV_PLUG"
to build a 64-bit agent (pcre2 and OpenSSL should be 64-bit, too).

Comment by Andris Mednis [ 2022 Feb 02 ]

Successfully compiled Zabbix agent 6.0.0rc1 with pcre2, with and without OpenSSL 1.1.1m on AIX 7.1 with CFLAGS="-Wall -Wextra -maix64 -g -O2 -DLIBICONV_PLUG".

$ sbin/zabbix_agentd --version

zabbix_agentd (daemon) (Zabbix) 6.0.0rc1

Revision 4e1124cdeb 1 February 2022, compilation time: Feb  2 2022 07:12:10
...
This product includes software developed by the OpenSSL Project
for use in the OpenSSL Toolkit (http://www.openssl.org/).

Compiled with OpenSSL 1.1.1m  14 Dec 2021
Running with OpenSSL 1.1.1m  14 Dec 2021

Supported technology levels: 6100 and above

 

Comment by Yuji Kamada [ 2022 Feb 03 ]

Thank you for your comment.

I have successfully compiled zabbix agent with pcre2(64-bit), without OpenSSL.

But, OpenSSL 64-bit building is faild.

The procedure is as follows.

#  OBJECT_MODE=64 ; export OBJECT_MODE
#  ./config CFLAGS=-maix64 no-shared --prefix=/usr/local/openssl-1.1.1m
# make install_sw

Result.

        gcc  -I. -Iinclude -Iapps -maix64 -pthread -maix64 -DNDEBUG  -MMD -MF apps/version.d.tmp -MT apps/version.o -c -o apps/version.o a
pps/version.c
        gcc  -I. -Iinclude -Iapps -maix64 -pthread -maix64 -DNDEBUG  -MMD -MF apps/x509.d.tmp -MT apps/x509.o -c -o apps/x509.o apps/x509.
c
        rm -f apps/openssl
        ${LDCMD:-gcc} -maix64 -pthread -maix64 -L. -Wl,-bsvr4   -o apps/openssl apps/asn1pars.o apps/ca.o apps/ciphers.o apps/cms.o apps/c
rl.o apps/crl2p7.o apps/dgst.o apps/dhparam.o apps/dsa.o apps/dsaparam.o apps/ec.o apps/ecparam.o apps/enc.o apps/engine.o apps/errstr.o a
pps/gendsa.o apps/genpkey.o apps/genrsa.o apps/nseq.o apps/ocsp.o apps/openssl.o apps/passwd.o apps/pkcs12.o apps/pkcs7.o apps/pkcs8.o app
s/pkey.o apps/pkeyparam.o apps/pkeyutl.o apps/prime.o apps/rand.o apps/rehash.o apps/req.o apps/rsa.o apps/rsautl.o apps/s_client.o apps/s
_server.o apps/s_time.o apps/sess_id.o apps/smime.o apps/speed.o apps/spkac.o apps/srp.o apps/storeutl.o apps/ts.o apps/verify.o apps/vers
ion.o apps/x509.o  apps/libapps.a -lssl -lcrypto -pthread
ld: 0711-712 ERROR: Archive member ./libcrypto.a[ecp_nistz256-ppc64.o]
        is stripped. The member is being ignored.
ld: 0711-712 ERROR: Archive member ./libcrypto.a[x25519-ppc64.o]
        is stripped. The member is being ignored.
ld: 0711-712 ERROR: Archive member ./libcrypto.a[keccak1600-ppc64.o]
        is stripped. The member is being ignored.
collect2: error: ld returned 8 exit status
make: The error code from the last command is 1.


Stop.
make: The error code from the last command is 2.


Stop. 

I don't know how to fix this problem.

What is the procedure for OpenSSL (64-bit) build in the Andris environment.

Comment by Andris Mednis [ 2022 Feb 03 ]

Hi, yuji_kamada!

Here are steps I used to compile OpenSSL from source which is located in the home directory of 'cecuser'.
Unpack OpenSSL source:

$ OBJECT_MODE=64 ; export OBJECT_MODE
$ cd
$ gunzip -c ~/openssl-1.1.1m.tar.gz | tar xf -
$ cd openssl-1.1.1m

Configure to build 64-bit OpenSSL with GCC:

$ ./Configure aix64-gcc no-shared no-threads no-srp no-dgram no-dtls1-method no-dtls1_2-method --api=1.1.0 --prefix=/home/cecuser/openssl-1.1.1m-install64

Run make and tests:

$ make 2>&1 | tee my_make.out
...
Target "_all" is up to date

$ make test 2>&1 | tee my_make_test.out
...
../test/recipes/99-test_fuzz.t ..................... ok
All tests successful.
Files=158, Tests=2424, 152 wallclock secs ( 0.36 usr  0.10 sys + 36.69 cusr  9.43 csys = 46.58 CPU)
Result: PASS
Target "test" is up to date.

Install:

$ make install 2>&1 | tee my_make_install.out

Compile Zabbix agent with statically linked OpenSSL:

$ CC=gcc CFLAGS="-Wall -Wextra -maix64 -g -O2 -DLIBICONV_PLUG" ./configure --enable-agent --enable-ipv6 --sysconfdir=/etc/zabbix --with-libpcre2 --with-openssl=/home/cecuser/openssl-1.1.1m-install64 --prefix=`pwd` 2>&1 | tee my_configure.out
$ make clean
$ make install 2>&1 | tee my_make_install.out

Use your own choice of '--sysconfdir' and '--prefix' values.

Comment by Yuji Kamada [ 2022 Feb 04 ]

Hi, Andris Mednis!

I tried compiling OpenSSL with the steps Andris taught me.

But, OpenSSL(64-bit) compiling was faild on my environment. 

# ./Configure aix64-gcc no-shared no-threads no-srp no-dgram no-dtls1-method no-dtls1_2-method --api=1.1.0 --prefix=/usr/local/openssl-1.1.1m-install64
...
        gcc  -I. -Iinclude -maix64 -O -DB_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DAES_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/usr/local/openssl-1.1.1m-install64/ssl\"" -DENGINESDIR="\"/usr/local/openssl-1.1.1m-install64/lib/engines-1.1\"" -DNDEBUG -DOPENSSL_API_COMPAT=0x10100000L  -MMD -MF crypto/aes/aes_wrap.d.tmp -MT crypto/aes/aes_wrap.o -c -o crypto/aes/aes_wrap.o crypto/aes/aes_wrap.c
        CC="gcc" perl crypto/aes/asm/aesp8-ppc.pl aix64 crypto/aes/aesp8-ppc.s
        gcc -maix64 -O -DB_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DAES_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/usr/local/openssl-1.1.1m-install64/ssl\"" -DENGINESDIR="\"/usr/local/openssl-1.1.1m-install64/lib/engines-1.1\"" -DNDEBUG -DOPENSSL_API_COMPAT=0x10100000L  -c -o crypto/aes/aesp8-ppc.o crypto/aes/aesp8-ppc.s
crypto/aes/aesp8-ppc.s: Assembler messages:
crypto/aes/aesp8-ppc.s:471: Error: invalid conditional option
crypto/aes/aesp8-ppc.s:1206: Error: invalid conditional option
crypto/aes/aesp8-ppc.s:1835: Error: invalid conditional option
crypto/aes/aesp8-ppc.s:2046: Error: invalid conditional option
make: The error code from the last command is 1.


Stop.
make: The error code from the last command is 2.


Stop.

Environment infomation:

bash-4.4# uname -a
AIX soaxp438 1 7 00CADA644C00
bash-4.4# oslevel -s
7100-02-01-1245 

 
Therefore, I tried OpenSSL compiling with no-asm option. Successfully compiled OpenSSL(64-bit).

# OBJECT_MODE=64 ; export OBJECT_MODE
# ./Configure aix64-gcc no-shared no-threads no-srp no-dgram no-asm no-dtls1-method no-dtls1_2-method --api=1.1.0 --prefix=/usr/local/openssl-1.1.1m-install64
# make install_sw
...
        perl "-I." -Mconfigdata "util/dofile.pl"  "-oMakefile" apps/tsget.in > "apps/tsget.pl"
        chmod a+x apps/tsget.pl
        perl "-I." -Mconfigdata "util/dofile.pl"  "-oMakefile" tools/c_rehash.in > "tools/c_rehash"
        chmod a+x tools/c_rehash
        perl "-I." -Mconfigdata "util/dofile.pl"  "-oMakefile" util/shlib_wrap.sh.in > "util/shlib_wrap.sh"
        chmod a+x util/shlib_wrap.sh
Target "_build_programs" is up to date.
created directory `/usr/local/openssl-1.1.1m-install64/bin'
*** Installing runtime programs
install apps/openssl -> /usr/local/openssl-1.1.1m-install64/bin/openssl
install ./tools/c_rehash -> /usr/local/openssl-1.1.1m-install64/bin/c_rehash
Target "install_sw" is up to date.

And, successfully compiled Zabbix agent 6.0.0rc1 with pcre2 and OpenSSL 1.1.1m on AIX 7.1.

# CC=gcc CFLAGS="-Wall -Wextra -maix64 -g -O2 -DLIBICONV_PLUG" ./configure --enable-agent --enable-ipv6 --sysconfdir=/etc/zabbix --with-libpcre2 --with-libpcre2 --with-libpcre2-lib=/usr/local/pcre2-10.39-install64/lib --with-libpcre2-include=/usr/local/pcre2-10.39-install64/include --with-openssl=/usr/local/openssl-1.1.1m-install64 --prefix=/usr/local/zabbix6.0.0rc1 2>&1 | tee my_configure.out
# make
...
        gcc  -Wall -Wextra -maix64 -g -O2 -DLIBICONV_PLUG  -I/usr/local/pcre2-10.39-install64/include  -L/usr/local/openssl-1.1.1m-install64/lib   -L/usr/local/pcre2-10.39-install64/lib  -o zabbix_sender zabbix_sender.o ../../src/libs/zbxjson/libzbxjson.a  ../../src/libs/zbxalgo/libzbxalgo.a  ../../src/libs/zbxregexp/libzbxregexp.a  ../../src/libs/zbxcommshigh/libzbxcommshigh.a  ../../src/libs/zbxcomms/libzbxcomms.a  ../../src/libs/zbxcommon/libzbxcommon.a  ../../src/libs/zbxlog/libzbxlog.a  ../../src/libs/zbxsys/libzbxsys.a  ../../src/libs/zbxnix/libzbxnix.a  ../../src/libs/zbxcrypto/libzbxcrypto.a  ../../src/libs/zbxconf/libzbxconf.a  ../../src/libs/zbxcompress/libzbxcompress.a  -lssl -lcrypto   -lm -lperfstat    -lpcre2-8 -liconv
ld: 0711-224 WARNING: Duplicate symbol: sig_exiting
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
ld: 0711-224 WARNING: Duplicate symbol: sig_exiting
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
Target "all" is up to date.
Target "all-am" is up to date.
Target "all" is up to date.
Making all in database
Making all in mysql
Target "all" is up to date.
Making all in oracle
Target "all" is up to date.
Making all in postgresql
Target "all" is up to date.
Making all in sqlite3
Target "all" is up to date.
Target "all-am" is up to date.
Target "all" is up to date.
Making all in man
Target "all" is up to date.
Making all in misc
Target "all" is up to date.
Target "all-am" is up to date.
Target "all" is up to date. 
Comment by Andris Mednis [ 2022 Feb 04 ]

Thanks, Yuji !
Nice to hear that You built it successfully.

Generated at Tue Apr 29 08:35:02 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.