PERL-NET-SSH2 0.28 on AIX with cc_r

I have been working on compiling a localized PERL installation on AIX 5.3. Long story short, we don't have root to these boxes, and the root owners won't guarantee support for PERL modules that we need. As an old RedHat guy, I like to use RPM to maintain custom packages. I have been working on compiling PERL and the associate modules.
I hit a stumbling block with perl-Net-SSH2 version 0.28. The commercial AIX compiler kept choking on the compile.


AutoSplitting blib/lib/Net/SSH2.pm (blib/lib/auto/Net/SSH2)
/opt/builder/local/bin/perl "-Iinc" -e 'use ExtUtils::Mksymlists; \
Mksymlists("NAME" => "Net::SSH2", "DL_FUNCS" => { }, "FUNCLIST" => [], "DL_VARS" => []);'
/opt/builder/local/bin/perl "-Iinc" /opt/builder/local/lib/perl5/5.8.9/ExtUtils/xsubpp -typemap /opt/builder/local/lib/perl5/5.8.9/ExtUtils/typemap -typemap typemap SSH2.xs > SSH2.xsc && mv SSH2.xsc SSH2.c
cc_r -q32 -c -I/usr/local/include -I/usr/include -I/opt/builder/local/include -I. -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -I/usr/local/include -q32 -D_LARGE_FILES -qlonglong -O -DVERSION=\"0.28\" -DXS_VERSION=\"0.28\" "-I/opt/builder/local/lib/perl5/5.8.9/ppc-thread-multi/CORE" SSH2.c
"ppport.h", line 3042.11: 1506-236 (W) Macro name PERL_UNUSED_DECL has been redefined.
"ppport.h", line 3042.11: 1506-358 (I) "PERL_UNUSED_DECL" is defined on line 204 of /opt/builder/local/lib/perl5/5.8.9/ppc-thread-multi/CORE/perl.h.
"SSH2.xs", line 707.23: 1506-280 (W) Function argument assignment between types "void*" and "void(*)()" is not allowed.
"SSH2.xs", line 1005.18: 1506-046 (S) Syntax error.
make: *** [SSH2.o] Error 1
Bad exit status from /var/tmp/rpm-tmp.25842 (%build)


After looking at the source, I could not find the obvious syntax error. I am pretty familiar with GCC but cc_r was a new beast. Luckily, cc_r spits out a fairly decent help. So I was able to find the exact problem by adding additional verbose flags to the compile, namely: "-v -V -qsrcmsg -qreport". Re-running make manually in the BUILD/Net-SSH2-0.28 directory yielded this:

cc_r -q32 -v -V -qsrcmsg -qreport -c -I/usr/local/include -I/usr/include -I/opt/builder/local/include -I. -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -I/usr/local/include -q32 -D_LARGE_FILES -qlonglong -O -DVERSION=\"0.28\" -DXS_VERSION=\"0.28\" "-I/opt/builder/local/lib/perl5/5.8.9/ppc-thread-multi/CORE" SSH2.c
export XL_CONFIG=/etc/vac.cfg.53:cc_r
export XL_ASMOBJFILES=/tmp/..tmpfiles..builder..11/xlcASJyMpEd
export "XL_DIS=/usr/vac/exe/dis -o "SSH2.s" "SSH2.o""
/usr/vac/exe/xlcentry -qosvar=aix.5.3 -qlanglvl=extended -qnoro -qnoroconst -qthreaded -D_THREAD_SAFE -D__VACPP_MULTI__ -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX50 -D_AIX51 -D_AIX52 -D_AIX53 -D_IBMR2 -D_POWER -q32 -qsrcmsg -I/usr/local/include -I/usr/include -I/opt/builder/local/include -I. -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -I/usr/local/include -q32 -D_LARGE_FILES -qlonglong -O -DVERSION="0.28" -DXS_VERSION="0.28" -I/opt/builder/local/lib/perl5/5.8.9/ppc-thread-multi/CORE -qasm_as=/bin/as -qc_stdinc=/usr/vac/include:/usr/include -qvac_include_path=/usr/vac/include -oSSH2.o SSH2.c /tmp/..tmpfiles..builder..11/xlcW0JpMpEa /tmp/..tmpfiles..builder..11/xlcW1JpMpEb /dev/null /tmp/..tmpfiles..builder..11/xlcLJyMpEeF.lst /dev/null /tmp/..tmpfiles..builder..11/xlcW2JpMpEc
"ppport.h", line 3042.11: 1506-236 (W) Macro name PERL_UNUSED_DECL has been redefined.
"ppport.h", line 3042.11: 1506-358 (I) "PERL_UNUSED_DECL" is defined on line 204 of /opt/builder/local/lib/perl5/5.8.9/ppc-thread-multi/CORE/perl.h.
707 | i_type, callback ? msg_cb[i_type] : 0);
......................a.....................
a - 1506-280 (W) Function argument assignment between types "void*" and "void(*)()" is not allowed.
1005 | if (!count) // some architectures return null for malloc(0)
.................a..............................................
a - 1506-046 (S) Syntax error.
rm /tmp/..tmpfiles..builder..11/xlcASJyMpEd
rm /tmp/..tmpfiles..builder..11/xlcLJyMpEe
rm /tmp/..tmpfiles..builder..11/xlcW0JpMpEa
rm /tmp/..tmpfiles..builder..11/xlcW1JpMpEb
rm /tmp/..tmpfiles..builder..11/xlcW2JpMpEc
make: *** [SSH2.o] Error 1

I guess GCC is more flexible with comments. This being a C file and all, cc_r didn't like the '//', a quick patch later, and voila, successful compile. Now to see if the output is actually useful.

Comments

Popular posts from this blog

Xubuntu Home Server on Dell XPS 13 9370

Cygwin + syslog-ng

Installing Fedora 21 on a (late 2014) Mac Mini