Steve,

Thanks for your response. I was tired with trying all the options. But after
seeing y'r mail I am encouraged to try your suggestions. Please find the
inline answers for your questions.

___Nagesh.
"Steven N. Hirsch" wrote:

> On Thu, 6 Dec 2001, Nagesh Ayyagari wrote:
>
> > I am using AIX 4.3.3.0 and Perl 5.6.1. I am having some issues using
> > dynamically loading shared library inside a perl program.
> >
> > I have a shared library called Repos.so.This has few XS functions that
> > call Oracle OCI calls. From my perl program I could load the shared
> > libraries using the Perl's Dynaloader module. When I call these
> > functions from Perl  I get a SEGV at the first line of XS source code.
> > The first line in the Repos.c file is dXSARGS;
> >
> > Just FYI, the same XS code works on Solaris, HP, TRU & Linux platforms
> > and fails for AIX. Any known issues with XS code on AIX 4.3.3.0 ?
>
> In real life, I code an enormous amount of XS code under AIX 4.3.3, both
> in 32-bit and 64-bit mode.  There are no inherent problems with AIX, other
> than its bizarre approach to dynamic libs and objects.
>
> A few questions:
>
> 1. What compiler was used to build Perl, xlC C-Set, xlC VAC or GNU?

==> xlC VAC Version 5

>
> 2. Was the same tool set used to build the module?

===> Yes

>
> 3. Is the module compiled as C++ code?  Is OCI using C++ linkage?

===> No we are not using any C++ linkage. All the modules in shared library
are coded in C.

>
> 4. Can you post the output of 'perl -V'?

===>

$ perl5.6 -version

This is perl, v5.6.1 built for aix

Copyright 1987-2001, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the

GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'.  If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.


>
> 5. Can you post the expanded commands issued during the module build for
>    both compiling and linking?

===> Compile time options and command
cc -g -DDEBUG -DDEBUG1 -DAIX -c -I/usr/local/..... -I/usr/local...
 -I/usr/local/..../zlib -I/usr/local/....xdelta -I/...../serv8171/rdbms/demo
-I/..../serv8171/rdbms/public -I/...../serv8171/plsql/public
-I/..../serv8171/network/public -D_ALL_SOURCE -D_ANSI_C
_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -I/usr/local/include -q32
-D_LARGE_FILES -q
longlong    -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" -I
/...../perl5.6.1/lib/5.6.1/aix/CORE /usr/local/....../collFil
eVersions.c

====> Link time options
LD_RUN_PATH="/.../serv8171/lib:/lib:/usr/local/..../li
b/aix" ld -o blib/arch/auto/Repos/Repos.so -L/.../serv8171/lib
-L/usr/local/lib -L/lib -L/usr/lib -L/usr/ccs/lib -L/usr/local/../lib/aix
-bhalt:4 -bM:SRE -bI:/.../perl5.6.1/lib/5.6.1/aix/CORE/perl.exp -bE:Repos.exp
-b noentry -lC -lc -L/usr/local/lib Repos.o  collFileVersions.o
-L/.../serv8171/lib -lclntsh -lnbeq8 -lnhost
8 -lnus8 -lnldap8 -lldapclnt8 -lnsslb8 -ln8 -lnoname8 -lntcp8 -lntcps8
-lnsslb8 -l
ntcp8 -lntns8 -ln8 -lnl8 -lnro8 -lnbeq8 -lnhost8 -lnus8 -lnldap8 -lldapclnt8
-lnss
lb8 -ln8 -lnoname8 -lntcp8 -lntcps8 -lnsslb8 -lntcp8 -lntns8 -ln8 -lnl8
-lclient8
-lvsn8 -lcommon8 -lskgxp8 -lgeneric8 -lmm -lnls8 -lcore8 -lnls8 -lcore8
-lnls8 -ln
beq8 -lnhost8 -lnus8 -lnldap8 -lldapclnt8 -lnsslb8 -ln8 -lnoname8 -lntcp8
-lntcps8
 -lnsslb8 -lntcp8 -lntns8 -ln8 -lnl8 -lnro8 -lnbeq8 -lnhost8 -lnus8 -lnldap8
-llda
pclnt8 -lnsslb8 -ln8 -lnoname8 -lntcp8 -lntcps8 -lnsslb8 -lntcp8 -lntns8 -ln8
-lnl
8 -lclient8 -lvsn8 -lcommon8 -lskgxp8 -lgeneric8 -ltrace8 -lnls8 -lcore8
-lnls8 -l
core8 -lnls8 -lclient8 -lvsn8 -lcommon8 -lskgxp8 -lgeneric8 -lnls8 -lcore8
-lnls8
-lcore8 -lnls8 -lnsl -L/usr/local/.../lib/aix -lxdelta -lz -lrepos_ade -lbind

-lnsl -ldbm -ldl -lld -lm -lC -lc -lcrypt -lbsd -lPW -liconv

Note : I have replaced some product specific directories with ...  These make
files are generated by the MakeMaker utility (version  5.45) of Perl 5.6.1.
The only change we had to do for AIX was to generate a Repos.exp file so that
we can export the symbols.

The Repos.exp file contents are as below.

-----
#!
CollGetFileVersionContents
CollGetLatestVersionNums
CollPutCurrFileVersions
CollPutNewFileVersions
XS_Repos_commit
XS_Repos_connect
XS_Repos_connect_to_repos_session
XS_Repos_constant
XS_Repos_disconnect
XS_Repos_fetch_version
XS_Repos_get_latest_versions_info
XS_Repos_put_new_file_versions
XS_Repos_rollback
XS_Repos_save_curr_file_versions
XS_Repos_set_repos_product_name
boot_Repos
-----

>
> 6. Are you able to get a trivial XS function (e.g. 'Hello, World') to
>    build and run in the AIX environment?

==> I have not tried compiling trivial XS function. However,  in Repos.so I
could see that few functions like connect(), commit() & rollback() are
working when called from "test.pl" program. However, when we call
fetch_version() it dumps core. I have tried putting fprintf(stderr..)
statements in Repos.c and could see that it fails after the line "dXSARGS;"
gets executed.

Reply via email to