develooper Front page | perl.perl5.porters | Postings from March 2013

[perl #117319] Can't include perl.h without linking to libperl

Thread Previous | Thread Next
From:
Dagfinn Ilmari Mannsåker
Date:
March 24, 2013 13:58
Subject:
[perl #117319] Can't include perl.h without linking to libperl
Message ID:
rt-3.6.HEAD-28177-1364132826-201.117319-75-0@perl.org
# New Ticket Created by  Dagfinn Ilmari Mannsåker 
# Please include the string:  [perl #117319]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=117319 >



This is a bug report for perl from ilmari@ilmari.org,
generated with the help of perlbug 1.39 running under perl 5.17.10.


-----------------------------------------------------------------
[Please describe your issue here]

perl.h includes inline.h, which has inline functions referencing real
funcitons in libperl, breaking linkin any program that includes perl.h
but doesn't link against libperl.  This breaks Time::HiRes' configure
probes, causing it to lack functionality like clock_gettime even if it's
supported by the OS.

ilmari@nurket:~/src/Time-HiRes-1.9725$ VERBOSE=1 perl Makefile.PL 
Configuring Time::HiRes...
Using hints hints/linux.pl...
Extra libraries: -lrt...
Have syscall()... looking for syscall.h... cccmd = cc -o tmp28721 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/home/ilmari/perl5/perlbrew/perls/perl-5.17.10/lib/5.17.10/x86_64-linux/CORE tmp28721.c -lrt 
/tmp/ccH7Tt2Z.o: In function `S_croak_memory_wrap':
tmp28721.c:(.text+0x5): undefined reference to `PL_memory_wrap'
tmp28721.c:(.text+0x14): undefined reference to `Perl_croak'
collect2: error: ld returned 1 exit status
cccmd = cc -o tmp28721 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/home/ilmari/perl5/perlbrew/perls/perl-5.17.10/lib/5.17.10/x86_64-linux/CORE tmp28721.c -lrt 
/tmp/ccZ5Fkz0.o: In function `S_croak_memory_wrap':
tmp28721.c:(.text+0x5): undefined reference to `PL_memory_wrap'
tmp28721.c:(.text+0x14): undefined reference to `Perl_croak'
collect2: error: ld returned 1 exit status
NOT found.
Looking for gettimeofday()... found.
Looking for setitimer()... found.
Looking for getitimer()... found.
You have interval timers (both setitimer and getitimer).
Looking for ualarm()... found.
Looking for usleep()... found.
Looking for nanosleep()... testing... cccmd = cc -o tmp28721 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/home/ilmari/perl5/perlbrew/perls/perl-5.17.10/lib/5.17.10/x86_64-linux/CORE tmp28721.c -lrt 
Running ./tmp28721...found.
You can mix subsecond sleeps with signals, if you want to.
(It's still not portable, though.)
Looking for clock_gettime()... cccmd = cc -o tmp28721 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/home/ilmari/perl5/perlbrew/perls/perl-5.17.10/lib/5.17.10/x86_64-linux/CORE tmp28721.c -lrt 
/tmp/ccRvKBJ3.o: In function `S_croak_memory_wrap':
tmp28721.c:(.text+0x5): undefined reference to `PL_memory_wrap'
tmp28721.c:(.text+0x14): undefined reference to `Perl_croak'
collect2: error: ld returned 1 exit status
NOT found.
Looking for clock_getres()... cccmd = cc -o tmp28721 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/home/ilmari/perl5/perlbrew/perls/perl-5.17.10/lib/5.17.10/x86_64-linux/CORE tmp28721.c -lrt 
/tmp/cc3exavg.o: In function `S_croak_memory_wrap':
tmp28721.c:(.text+0x5): undefined reference to `PL_memory_wrap'
tmp28721.c:(.text+0x14): undefined reference to `Perl_croak'
collect2: error: ld returned 1 exit status
NOT found.
Looking for clock_nanosleep()... cccmd = cc -o tmp28721 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/home/ilmari/perl5/perlbrew/perls/perl-5.17.10/lib/5.17.10/x86_64-linux/CORE tmp28721.c -lrt 
/tmp/cc7hXQss.o: In function `S_croak_memory_wrap':
tmp28721.c:(.text+0x5): undefined reference to `PL_memory_wrap'
tmp28721.c:(.text+0x14): undefined reference to `Perl_croak'
collect2: error: ld returned 1 exit status
NOT found.
Looking for clock()... cccmd = cc -o tmp28721 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/home/ilmari/perl5/perlbrew/perls/perl-5.17.10/lib/5.17.10/x86_64-linux/CORE tmp28721.c -lrt 
/tmp/ccq16SGE.o: In function `S_croak_memory_wrap':
tmp28721.c:(.text+0x5): undefined reference to `PL_memory_wrap'
tmp28721.c:(.text+0x14): undefined reference to `Perl_croak'
collect2: error: ld returned 1 exit status
NOT found.
Looking for stat() subsecond timestamps...
Trying struct stat st_atimespec.tv_nsec...cccmd = cc -o tmp28721 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/home/ilmari/perl5/perlbrew/perls/perl-5.17.10/lib/5.17.10/x86_64-linux/CORE tmp28721.c -lrt 
tmp28721.c: In function ‘main’:
tmp28721.c:17:7: error: ‘struct stat’ has no member named ‘st_atimespec’
NOT found.
Trying struct stat st_atimensec...cccmd = cc -o tmp28721 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/home/ilmari/perl5/perlbrew/perls/perl-5.17.10/lib/5.17.10/x86_64-linux/CORE tmp28721.c -lrt 
tmp28721.c: In function ‘main’:
tmp28721.c:17:7: error: ‘struct stat’ has no member named ‘st_atimensec’
NOT found.
Trying struct stat st_atime_n...cccmd = cc -o tmp28721 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/home/ilmari/perl5/perlbrew/perls/perl-5.17.10/lib/5.17.10/x86_64-linux/CORE tmp28721.c -lrt 
tmp28721.c: In function ‘main’:
tmp28721.c:17:7: error: ‘struct stat’ has no member named ‘st_atime_n’
NOT found.
Trying struct stat st_atim.tv_nsec...cccmd = cc -o tmp28721 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/home/ilmari/perl5/perlbrew/perls/perl-5.17.10/lib/5.17.10/x86_64-linux/CORE tmp28721.c -lrt 
/tmp/ccpnxcyb.o: In function `S_croak_memory_wrap':
tmp28721.c:(.text+0x5): undefined reference to `PL_memory_wrap'
tmp28721.c:(.text+0x14): undefined reference to `Perl_croak'
collect2: error: ld returned 1 exit status
NOT found.
Trying struct stat st_uatime...cccmd = cc -o tmp28721 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/home/ilmari/perl5/perlbrew/perls/perl-5.17.10/lib/5.17.10/x86_64-linux/CORE tmp28721.c -lrt 
tmp28721.c: In function ‘main’:
tmp28721.c:17:7: error: ‘struct stat’ has no member named ‘st_uatime’
NOT found.
You do not seem to have stat subsecond timestamps.
Checking if your kit is complete...
Looks good
Processing hints file hints/linux.pl
Writing Makefile for Time::HiRes
Writing MYMETA.yml and MYMETA.json
Now you may issue 'make'.  Do not forget also 'make test'.
ilmari@nurket:~/src/Time-HiRes-1.9725$ 


[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=high
---
Site configuration information for perl 5.17.10:

Configured by ilmari at Sat Mar 23 15:33:12 GMT 2013.

Summary of my perl5 (revision 5 version 17 subversion 10) configuration:
   
  Platform:
    osname=linux, osvers=3.5.0-25-generic, archname=x86_64-linux
    uname='linux nurket 3.5.0-25-generic #38-ubuntu smp mon feb 18 23:27:42 utc 2013 x86_64 x86_64 x86_64 gnulinux '
    config_args='-de -Dprefix=/home/ilmari/perl5/perlbrew/perls/perl-5.17.10 -Dusedevel -Aeval:scriptdir=/home/ilmari/perl5/perlbrew/perls/perl-5.17.10/bin'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.7.2', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /usr/lib
    libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.15'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector'

Locally applied patches:
    

---
@INC for perl 5.17.10:
    /home/ilmari/perl5/perlbrew/perls/perl-5.17.10/lib/site_perl/5.17.10/x86_64-linux
    /home/ilmari/perl5/perlbrew/perls/perl-5.17.10/lib/site_perl/5.17.10
    /home/ilmari/perl5/perlbrew/perls/perl-5.17.10/lib/5.17.10/x86_64-linux
    /home/ilmari/perl5/perlbrew/perls/perl-5.17.10/lib/5.17.10
    .

---
Environment for perl 5.17.10:
    HOME=/home/ilmari
    LANG=en_GB.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/ilmari/perl5/perlbrew/bin:/home/ilmari/perl5/perlbrew/perls/perl-5.17.10/bin:/home/ilmari/perls/v5.12.2/bin:/home/ilmari/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
    PERLBREW_BASHRC_VERSION=0.60
    PERLBREW_HOME=/home/ilmari/.perlbrew
    PERLBREW_MANPATH=/home/ilmari/perl5/perlbrew/perls/perl-5.17.10/man
    PERLBREW_PATH=/home/ilmari/perl5/perlbrew/bin:/home/ilmari/perl5/perlbrew/perls/perl-5.17.10/bin
    PERLBREW_PERL=perl-5.17.10
    PERLBREW_ROOT=/home/ilmari/perl5/perlbrew
    PERLBREW_VERSION=0.60
    PERL_AUTOINSTALL_PREFER_CPAN=1
    PERL_BADLANG (unset)
    PERL_MM_PREFER_CPAN=1
    PERL_MM_USE_DEFAULT=1
    SHELL=/bin/bash


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About