Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue Compiling nagios plugins in AIX #40

Closed
abrist opened this Issue Jun 5, 2014 · 3 comments

Comments

Projects
None yet
2 participants
@abrist
Copy link

abrist commented Jun 5, 2014

Import from the forums (user: rajasegar):
http://support.nagios.com/forum/viewtopic.php?f=16&t=27526
Text of Post below:

AIX 6.1
Nagios plugins 2.0.1

Can you please advice what are the environment variables to set to compile in AIX?
Seem to get some conflict errors during make

ld: 0711-224 WARNING: Duplicate symbol: .bcopy
ld: 0711-224 WARNING: Duplicate symbol: .memmove
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
ld: 0711-224 WARNING: Duplicate symbol: .bcopy
ld: 0711-224 WARNING: Duplicate symbol: .memmove
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
gcc -DLOCALEDIR=\"/usr/local/nagios/share/locale\" -DHAVE_CONFIG_H -I. -I.. -I.. -I../lib -I../gl -I../intl -I/usr/include/ldap -I/usr/include -D_THREAD_SAFE -DNP_VERSION='"2.0.1"' -g -O2 -MT check_ssh.o -MD -MP -MF .deps/check_ssh.Tpo -c -o check_ssh.o check_ssh.c
mv -f .deps/check_ssh.Tpo .deps/check_ssh.Po
/bin/sh ../libtool --tag=CC --mode=link gcc -DNP_VERSION='"2.0.1"' -g -O2 -L. -o check_ssh check_ssh.o libnpcommon.a ../lib/libnagiosplug.a ../gl/libgnu.a -lnsl -lpthread -ldl
libtool: link: gcc -DNP_VERSION=\"2.0.1\" -g -O2 -o check_ssh check_ssh.o -L. libnpcommon.a ../lib/libnagiosplug.a ../gl/libgnu.a -lnsl -lpthread -ldl
gcc -DLOCALEDIR=\"/usr/local/nagios/share/locale\" -DHAVE_CONFIG_H -I. -I.. -I.. -I../lib -I../gl -I../intl -I/usr/include/ldap -I/usr/include -D_THREAD_SAFE -DNP_VERSION='"2.0.1"' -g -O2 -MT check_tcp.o -MD -MP -MF .deps/check_tcp.Tpo -c -o check_tcp.o check_tcp.c
In file included from ../gl/stdio.h:43:0,
from common.h:40,
from check_tcp.c:37:
/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.2/include-fixed/stdio.h:512:12: error: conflicting types for 'fgetpos64'
extern int fgetpos64(FILE *, fpos64_t *);
^
In file included from ../gl/stdio.h:43:0,
from common.h:40,
from check_tcp.c:37:
/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.2/include-fixed/stdio.h:311:12: note: previous declaration of 'fgetpos64' was here
extern int fgetpos(FILE *__restrict__, fpos_t *__restrict__);
^
In file included from ../gl/stdio.h:43:0,
from common.h:40,
from check_tcp.c:37:
/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.2/include-fixed/stdio.h:515:12: error: conflicting types for 'fseeko64'
extern int fseeko64(FILE *, off64_t, int);
^
In file included from ../gl/stdio.h:43:0,
from common.h:40,
from check_tcp.c:37:
/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.2/include-fixed/stdio.h:455:12: note: previous declaration of 'fseeko64' was here
extern int fseeko(FILE *, off_t, int);
^
In file included from ../gl/stdio.h:43:0,
from common.h:40,
from check_tcp.c:37:
/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.2/include-fixed/stdio.h:516:12: error: conflicting types for 'fsetpos64'
extern int fsetpos64(FILE *, const fpos64_t *);
^
In file included from ../gl/stdio.h:43:0,
from common.h:40,
from check_tcp.c:37:
/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.2/include-fixed/stdio.h:313:12: note: previous declaration of 'fsetpos64' was here
extern int fsetpos(FILE *, const fpos_t *);
^
In file included from ../gl/stdio.h:43:0,
from common.h:40,
from check_tcp.c:37:
/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.2/include-fixed/stdio.h:517:16: error: conflicting types for 'ftello64'
extern off64_t ftello64(FILE *);
^
In file included from ../gl/stdio.h:43:0,
from common.h:40,
from check_tcp.c:37:
/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.2/include-fixed/stdio.h:456:14: note: previous declaration of 'ftello64' was here
extern off_t ftello(FILE *);
^
In file included from ../gl/unistd.h:27:0,
from common.h:51,
from check_tcp.c:37:
/usr/include/unistd.h:171:16: error: conflicting types for 'lseek64'
extern off64_t lseek64(int, off64_t, int);
^
/usr/include/unistd.h:169:14: note: previous declaration of 'lseek64' was here
extern off_t lseek(int, off_t, int);
^
In file included from /usr/include/unistd.h:746:0,
from ../gl/unistd.h:27,
from common.h:51,
from check_tcp.c:37:
/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 ../gl/unistd.h:27:0,
from common.h:51,
from check_tcp.c:37:
/usr/include/unistd.h:809:14: error: conflicting types for 'ftruncate64'
extern int ftruncate64(int, off64_t);
^
In file included from ../gl/unistd.h:27:0,
from common.h:51,
from check_tcp.c:37:
/usr/include/unistd.h:807:14: note: previous declaration of 'ftruncate64' was here
extern int ftruncate(int, off_t);
^
In file included from ../gl/unistd.h:27:0,
from common.h:51,
from check_tcp.c:37:
/usr/include/unistd.h:845:14: error: conflicting types for 'truncate64'
extern int truncate64(const char *, off64_t);
^
In file included from ../gl/unistd.h:27:0,
from common.h:51,
from check_tcp.c:37:
/usr/include/unistd.h:843:14: note: previous declaration of 'truncate64' was here
extern int truncate(const char *, off_t);
^
In file included from ../gl/unistd.h:27:0,
from common.h:51,
from check_tcp.c:37:
/usr/include/unistd.h:862:18: error: conflicting types for 'pread64'
extern ssize_t pread64(int, void *, size_t, off64_t);
^
/usr/include/unistd.h:859:18: note: previous declaration of 'pread64' was here
extern ssize_t pread(int, void *, size_t, off_t);
^
/usr/include/unistd.h:863:18: error: conflicting types for 'pwrite64'
extern ssize_t pwrite64(int, const void *, size_t, off64_t);
^
/usr/include/unistd.h:860:18: note: previous declaration of 'pwrite64' was here
extern ssize_t pwrite(int, const void *, size_t, off_t);
^
/usr/include/unistd.h:942:17: error: conflicting types for 'fclear64'
extern off64_t fclear64(int, off64_t);
^
/usr/include/unistd.h:939:15: note: previous declaration of 'fclear64' was here
extern off_t fclear(int, off_t);
^
/usr/include/unistd.h:943:13: error: conflicting types for 'fsync_range64'
extern int fsync_range64(int, int, off64_t, off64_t);
^
/usr/include/unistd.h:940:13: note: previous declaration of 'fsync_range64' was here
extern int fsync_range(int, int, off_t, off_t);
^
make: 1254-004 The error code from the last command is 1.


Stop.
make: 1254-004 The error code from the last command is 1.


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


Stop.
bash-4.2#

I have installed all the required gcc libraries
-rw------- 1 nagios nagios 18087017 Jan 09 10:42 gcc-4.8.2-1.aix6.1.ppc.rpm
-rw------- 1 nagios nagios 6571520 Jan 09 10:41 gcc-c++-4.8.2-1.aix6.1.ppc.rpm
-rw------- 1 nagios nagios 5866258 Jan 09 10:42 gcc-cpp-4.8.2-1.aix6.1.ppc.rpm
-rw------- 1 nagios nagios 9934241 Jan 09 10:42 gcc-gfortran-4.8.2-1.aix6.1.ppc.rpm
-rw------- 1 nagios nagios 1518681 Jan 09 10:54 gmp-5.1.3-1.aix5.1.ppc.rpm
-rw------- 1 nagios nagios 186807 Jan 09 10:53 gmp-devel-5.1.3-1.aix5.1.ppc.rpm
-rw------- 1 nagios nagios 886300 Jan 09 10:42 libgcc-4.8.2-1.aix6.1.ppc.rpm
-rw------- 1 nagios nagios 517814 Jan 09 10:42 libgomp-4.8.2-1.aix6.1.ppc.rpm
-rw------- 1 nagios nagios 414917 Jan 09 10:53 libmpc-1.0.1-2.aix5.1.ppc.rpm
-rw------- 1 nagios nagios 30653 Jan 09 10:53 libmpc-devel-1.0.1-2.aix5.1.ppc.rpm
-rw------- 1 nagios nagios 10022361 Jan 09 10:42 libstdc++-4.8.2-1.aix6.1.ppc.rpm
-rw------- 1 nagios nagios 2667103 Jan 09 10:42 libstdc++-devel-4.8.2-1.aix6.1.ppc.rpm
-rw------- 1 nagios nagios 801716 Jan 09 10:53 mpfr-3.1.2-1.aix5.1.ppc.rpm
-rw------- 1 nagios nagios 68407 Jan 09 10:53 mpfr-devel-3.1.2-1.aix5.1.ppc.rpm

Thanks

@emislivec

This comment has been minimized.

Copy link
Contributor

emislivec commented Jun 5, 2014

These problems seem to be common when building with GCC on AIX. GNU coreutils has run into similar issues: https://sourceware.org/bugzilla/show_bug.cgi?id=13558

I think we need to #include "common.h" before any system headers. This is the case for check_ssh.c which does compile, but not for check_tcp.c which fails.

@abrist

This comment has been minimized.

Copy link
Author

abrist commented Jun 5, 2014

Thanks for the heads up Eric[1] ! :P
Report back shortly.
It looks like check_tcp.c and negate.c are both affected. Eric[1] is pursuing the issue on the forums. If reordering the includes fixes the issue, I suspect Eric[1] will make a pull request.

@abrist

This comment has been minimized.

Copy link
Author

abrist commented Jun 6, 2014

Include reordered with commit: b9c764f

Thanks Eric[1]!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.