h2xs woes

From: Tim X (timx_at_spamto.devnul.com)
Date: 06/15/04

  • Next message: Peter Scott: "Re: Problems loading packages with taint checking on"
    Date: Tue, 15 Jun 2004 19:31:11 +1000
    
    

    I've been tyring to use h2xs to create a module which uses some C code
    I have in a shared library. However, when I try to run h2xs on the
    header file which accompanies the library, h2xs gives a segmentation
    fault. I then tried pre-processing the header file with cpp to create
    a new header file, but then h2xs has problems parsing some of the
    contexts in the header file.

    I have successfully compiled C code which uses this header file and
    shared libraries with no problems using the same versions of gcc.

    I'm new to h2xs, though have done considerable amounts of perl (though
    I'm a bit rusty - perl was at 5.005 when I last coded with it!). I've
    worked through the xs tutorial and all the examples worked fine (minor
    differences, but I believe they are down to documentation lag). I've
    gone through perlguts, perlxs and a few other perl pages, but have not
    found anything to give me a clue on how to solve the issue.

    I suspect that as h2xs is seg faulting the problem could be a
    bug. However, I wanted to check here to see if anyone else has
    experienced anything similar or if perhaps there are some cpp defines
    I need to pass to h2xs in order to get it to pass my header file
    correctly (the header file is from code which is ported to multiple
    platforms and uses the --linux-- define for OS specific sections -
    something which seems related to the h2xs problem as "playing around"
    seems to indicate h2xs may be tyring to parse MS or borland code,
    despite ensuring __linux__ is defined.

    I've also tried pre-processing the header file to get a new header
    file with all the non-linux bits removed. However, then h2xs reports
    it cannot parse some of the constructs in the header file. I thought
    h2xs uses cpp to parse the header, but obviously I'm missing something
    here.

    Any suggestions would be greatly appreciated. I suspect I've
    overlooked something somewhere, but have been looking so hard now I
    could be missing the tree for the proverbial forest.

    My platform details are

    Debian Linux "testing" distribution (Sid)

    Perl Version
    Summary of my perl5 (revision 5.0 version 8 subversion 3) configuration:
      Platform:
        osname=linux, osvers=2.4.25-ti1211, archname=i386-linux-thread-multi
        uname='linux kosh 2.4.25-ti1211 #1 thu feb 19 18:20:12 est 2004 i686 gnulinux '
        config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=i386-linux -Dprefix=/usr -Dprivlib=/usr/share/perl/5.8 -Darchlib=/usr/lib/perl/5.8 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.8.3 -Dsitearch=/usr/local/lib/perl/5.8.3 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Uusesfio -Uusenm -Duseshrplib -Dlibperl=libperl.so.5.8.3 -Dd_dosuid -des'
        hint=recommended, useposix=true, d_sigaction=define
        usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
        useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
        use64bitint=undef use64bitall=undef uselongdouble=undef
        usemymalloc=n, bincompat5005=undef
      Compiler:
        cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS
        -DDEBIAN -
    fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
        optimize='-O3',
        cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -I/usr/local/include'
        ccversion='', gccversion='3.3.3 (Debian 20040314)', gccosandvers=''
        intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
        d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
        ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
        alignbytes=4, prototype=define
      Linker and Libraries:
        ld='cc', ldflags =' -L/usr/local/lib'
        libpth=/usr/local/lib /lib /usr/lib
        libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt
        perllibs=-ldl -lm -lpthread -lc -lcrypt
        libc=/lib/libc-2.3.2.so, so=so, useshrplib=true, libperl=libperl.so.5.8.3
        gnulibc_version='2.3.2'
      Dynamic Linking:
        dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
        cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'

    Characteristics of this binary (from libperl):
      Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
      Built under linux
      Compiled at Mar 27 2004 16:21:10
      @INC:
        /etc/perl
        /usr/local/lib/perl/5.8.3
        /usr/local/share/perl/5.8.3
        /usr/lib/perl5
        /usr/share/perl5
        /usr/lib/perl/5.8
        /usr/share/perl/5.8
        /usr/local/lib/site_perl
     

    Gcc version - Reading specs from
    /usr/lib/gcc-lib/i486-linux/3.3.3/specs Configured with:
    ../src/configure -v
    --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang
    --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
    --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared
    --with-system-zlib --enable-nls --without-included-gettext
    --enable-__cxa_atexit --enable-clocale=gnu --enable-debug
    --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc
    i486-linux Thread model: posix gcc version 3.3.3 (Debian 20040422)

    -- 
    Tim Cross
    The e-mail address on this message is FALSE (obviously!). My real e-mail is
    to a company in Australia called rapttech and my login is tcross - if you 
    really need to send mail, you should be able to work it out!
    

  • Next message: Peter Scott: "Re: Problems loading packages with taint checking on"

    Relevant Pages

    • h2xs difficulties
      ... At some point in the past somebody has used h2xs to create a Perl module ... According to the manpage this should create Exim/LocalScan but it ... I include the directory above as the header file relies on certain files ...
      (perl.beginners)
    • Re: use strict; and O_WRONLY
      ... When I created a new XS module with h2xs, ... > constants I wanted to export to Perl. ... I wonder about the necessity of dlsym(). ... be mentioned in the header which has to be included in the XS file. ...
      (comp.lang.perl.misc)
    • FW: Re: Urgent help in h2xs
      ... I have installed activeperl version 5.8.7 for win32 applications on windows 2000. ... I am using MSVC for compiling the programs and after running h2xs.bat when i run the makefile.pl command it gives me the following error message: ... Can you be more precise in telling how to use VC++ for h2xs as i dont have ... project using perl h2xs. ...
      (perl.beginners)
    • [opensuse] Where do I find perl module C::Scan?
      ... To build a perl XS module with h2xs, ... I could not find this module with zypper, but h2xs suggests to install ...
      (SuSE)
    • Re: Need help with ExtUtils::MakeMaker
      ... > they can be installed using Perl's standard sequence (perl Makefile.PL ... This does all of the "nasty" work for you. ... You may also want to look over perltoot, perlboot, perlmod and h2xs. ... incorporate packages into your install. ...
      (comp.lang.perl.misc)