[SUMMARY] Problems with compiled perl modules (perl 5.8.0)

From: David Foster (foster@dim.ucsd.edu)
Date: Fri Apr 25 2003 - 18:17:35 EDT


Once I added -shared to the link line for Perl 5.8.0, eg.

   LDDLFLAGS = -Wl,-E -G -L/usr/local/lib -L/usr/lib/pic/sparcv9 -shared

I was able to get Perl to build successfully and install.

Adding this option also adds it to the default Makefile settings for
subsequently compiled perl modules:

      lddlflags=' -Wl,-E -G -L/usr/local/lib -L/usr/lib/pic/sparcv9 -shared'

and this together with a properly configured 64-bit Perl made
everything work. (Presumably a 32-bit perl with modules compiled
32-bit would work as well, just have to make sure to include -shared)

Dave Foster

>
> Perl: 5.8.0 (32-bit binary from www.sunfreeware.com)
> Gcc: 3.2.1
>
> When I try to use a compiled module:
>
> #!/usr/local/bin/perl
> use Date::Calc qw(Delta_Days);
>
> I get a segmentation fault, truss gives:
>
>
open("/usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris/auto/Date/Calc/Calc.so",
> O_RDON
> LY) = 4
> fstat(4, 0xFFBEDCEC) = 0
> mmap(0x00000000, 8192, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0xFF360000
> mmap(0x00000000, 155648, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0xFF110000
> mmap(0xFF134000, 6488, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED,
4,
> 81920)
> = 0xFF134000
> munmap(0xFF126000, 57344) = 0
> memcntl(0xFF110000, 13904, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
> close(4) = 0
> mprotect(0xFF110000, 85893, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
> mprotect(0xFF110000, 85893, PROT_READ|PROT_EXEC) = 0
> munmap(0xFF360000, 8192) = 0
> Incurred fault #6, FLTBOUNDS %pc = 0xFF120708
> siginfo: SIGSEGV SEGV_MAPERR addr=0xFF10FFFC
> Received signal #11, SIGSEGV [default]
> siginfo: SIGSEGV SEGV_MAPERR addr=0xFF10FFFC
> *** process killed ***
>
> Module was compiled using "-mcpu=v7 -m32" gcc flags to compile 32-bit,
> since my perl is 32-bit. (If I compile it 64-bit I get the ELFCLASS64
> error.) I've also tried compiling 32-bit using gcc 2.95.3 as I'm
> painfully aware how broken gcc 3.x+ is, same results. Is this just
> a broken perl?
>
> Sorry for posting a perl issue, didn't get much help from those lists
> and I REALLY need to get this resolved soon.
>

  =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
   David Foster National Center for Microscopy and Imaging Research
    Programmer/Analyst University of California, San Diego
    dfoster[at]ucsd[dot]edu Department of Neuroscience, Mail 0608
    (858) 534-7968 http://ncmir.ucsd.edu/
  =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:26:17 EDT