Nick Ing-Simmons wrote:
> 
> Marc Mettes <[EMAIL PROTECTED]> writes:
> >I'm working on a project embedding and extending perl ...
> >I've had great success on Solaris8/gcc with the external executable
> >using a statically built perl
> 
> Can you send us the perl -V of that perl?
> ...  use Config;  print Config::myconfig();  ...


Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
    osname=solaris, osvers=2.6, archname=sun4-solaris
    uname='sunos penq 5.6 generic_105181-21 sun4u sparc sunw,ultra-60 '
    config_args='-Dinstallprefix=/usr/perl -Dprefix=/usr/perl -des'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
    cc='gcc', ccflags =' -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O',
    cppflags=''
    ccversion='', gccversion='2.8.1', gccosandvers='solaris2.6'
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib '
    libpth=/usr/local/lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc
    perllibs=-lsocket -lnsl -ldl -lm -lc
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'


> And if you have "customized" the link step can you explain what you did?

The compile and link lines look like this:

gcc -c -fPIC -DPRO_MACHINE=19 -DPRO_OS=3 -DSOLARIS -I. -Iincludes 
    -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
    -I/usr/perl/lib/5.6.1/sun4-solaris/CORE properl.c

ld -G -Bsymbolic -o properl.dll properl.o ./protk_dll.a
   /usr/perl/lib/5.6.1/sun4-solaris/auto/DynaLoader/DynaLoader.a 
   -L/usr/perl/lib/5.6.1/sun4-solaris/CORE -lperl 
   -L/opt/gcc-2.95.3/lib/gcc-lib/sparc-sun-solaris2.6/2.95.3 -lgcc 
   -lsocket -lnsl -lw -lm -ldl -lc

The link step (using ld) is modified by setting '-G -Bsymbolic', then linking 
in the cad api library (protk_dll.a), 'libgcc' (probably should just use gcc 
for linking), and 'libw'.


My perl says this (which you probably already know):

% perl -MExtUtils::Embed -e ccopts 
  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/perl/lib/5.6.1/sun4-solaris/CORE 

% perl -MExtUtils::Embed -e ldopts 
  -L/usr/local/lib /usr/perl/lib/5.6.1/sun4-solaris/auto/DynaLoader/DynaLoader.a 
  -L/usr/perl/lib/5.6.1/sun4-solaris/CORE -lperl -lsocket -lnsl -ldl -lm -lc


> >I get the following error message:
> >
> >Can't load '/usr/perl/lib/5.6.1/sun4-solaris/auto/Data/Dumper/Dumper.so'
> > for module Data::Dumper: ld.so.1: /opt/pro/sun4_solaris/obj/pro: fatal:
> > relocation error: file
> >/usr/perl/lib/5.6.1/sun4-solaris/auto/Data/Dumper/Dumper.so:
> > symbol main: referenced symbol not found at
> >/usr/perl/lib/5.6.1/sun4-solaris/XSLoader.pm line 75.
> > at /usr/perl/lib/5.6.1/sun4-solaris/Data/Dumper.pm line 27
> >Compilation failed in require at go.pl line 5.
> >BEGIN failed--compilation aborted at go.pl line 5.
> 
> That is not a failure mode that I remember.
> I do seem to recall having to define a main() for some dynamic loaded
> thing on Solaris a few years back - but not the details.
> The SunPro run-time and/or C++ was involved in some way ...


> >With just the print statement, the script runs just fine.  Can someone
> >give me some suggestions on resolving this problem?
> 
> Dynamic loading and embedded perls is a little tricky but you seem
> to have got past the first few hurdles (as you are getting messages
> from XSLoader

Simple perl scripts run great, so I'm very happy with that.  The 
XS module portion is a piece of cake in comparison.


Thanks for the help,

Marc
-- 
Marc Mettes
CAD Support
Bic Corporation

Reply via email to