NetBSD Problem Report #40302

From www@NetBSD.org  Tue Dec 30 21:46:22 2008
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id C678B63B8C6
	for <gnats-bugs@gnats.netbsd.org>; Tue, 30 Dec 2008 21:46:22 +0000 (UTC)
Message-Id: <20081230214622.5036163B884@narn.NetBSD.org>
Date: Tue, 30 Dec 2008 21:46:22 +0000 (UTC)
From: cirnatdan@gmail.com
Reply-To: cirnatdan@gmail.com
To: gnats-bugs@NetBSD.org
Subject: Compiling pkgsrc perl on linux-amd64 with support for threads
X-Send-Pr-Version: www-1.0

>Number:         40302
>Category:       pkg
>Synopsis:       Compiling pkgsrc perl on linux-amd64 with support for threads
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          feedback
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 30 21:50:00 +0000 2008
>Closed-Date:    
>Last-Modified:  Sun Mar 07 06:08:03 +0000 2010
>Originator:     Cirnat Dan
>Release:        
>Organization:
home
>Environment:
Linux desktop 2.6.27-ARCH #1 SMP PREEMPT Sun Dec 21 09:13:30 UTC 2008 x86_64 Intel(R) Core(TM)2 CPU 4300 @ 1.80GHz GenuineIntel GNU/Linux
>Description:
I am trying to compile perl5 on a fresh pkgsrc install. My linux distro is ArchLinux x86_64. (If I remember correctly, I had the same problem on a FreeBSD 7 machine).
The process fails with the following output:
#
:/usr/pkgsrc/lang/perl5$ bmake
#
=> Bootstrap dependency digest>=20010302: found digest-20080510
#
=> Bootstrap dependency tnftp-[0-9]*: found tnftp-20070806
#
===> Skipping vulnerability checks.
#
WARNING: No /var/db/pkg/pkg-vulnerabilities file found.
#
WARNING: To fix run: `/usr/pkg/sbin/download-vulnerability-list'.
#
===> Building for perl-5.10.0nb4
#
LD_LIBRARY_PATH=/usr/work/lang/perl5/work/perl-5.10.0 gcc -Wl,-R/usr/pkg/lib  -L/usr/pkg/lib -o miniperl  `echo   gv.o toke.o perly.o op.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro.o hv.o av.o perl.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o xsutils.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o  | sed 's/ op.o / /'`  miniperlmain.o opmini.o -lm -lcrypt -ldl -lnsl
#
util.o: In function `Perl_safesysmalloc':
#
util.c:(.text+0x22eb): undefined reference to `pthread_getspecific'
#
util.o: In function `Perl_safesysrealloc':
#
util.c:(.text+0x2ff3): undefined reference to `pthread_getspecific'
#
util.o: In function `Perl_safesyscalloc':
#
util.c:(.text+0x3683): undefined reference to `pthread_getspecific'
#
util.o: In function `Perl_warn_nocontext':
#
util.c:(.text+0x3bfd): undefined reference to `pthread_getspecific'
#
util.o: In function `Perl_warner_nocontext':
#
util.c:(.text+0x452d): undefined reference to `pthread_getspecific'
#
util.o:util.c:(.text+0x4883): more undefined references to `pthread_getspecific' follow
#
util.o: In function `Perl_set_context':
#
util.c:(.text+0x77a1): undefined reference to `pthread_setspecific'
#
util.o: In function `Perl_die_nocontext':
#
util.c:(.text+0x7a0d): undefined reference to `pthread_getspecific'
#
util.o: In function `Perl_mess_nocontext':
#
util.c:(.text+0x7b4d): undefined reference to `pthread_getspecific'
#
util.o: In function `Perl_form_nocontext':
#
util.c:(.text+0x7d0d): undefined reference to `pthread_getspecific'
#
util.o: In function `Perl_get_context':
#
util.c:(.text+0x117a): undefined reference to `pthread_getspecific'
#
mg.o: In function `Perl_sighandler':
#
mg.c:(.text+0x4d3): undefined reference to `pthread_getspecific'
#
mg.o:mg.c:(.text+0xdad): more undefined references to `pthread_getspecific' follow
#
perl.o: In function `perl_alloc':
#
perl.c:(.text+0x7b0d): undefined reference to `pthread_setspecific'
#
perl.c:(.text+0x7b40): undefined reference to `pthread_key_create'
#
perl.c:(.text+0x7b53): undefined reference to `pthread_setspecific'
#
perl.o: In function `perl_fini':
#
perl.c:(.text+0x603a): undefined reference to `pthread_key_delete'
#
sv.o: In function `Perl_sv_catpvf_mg_nocontext':
#
sv.c:(.text+0x705d): undefined reference to `pthread_getspecific'
#
sv.o: In function `perl_clone':
#
sv.c:(.text+0x101f8): undefined reference to `pthread_setspecific'
#
sv.o: In function `Perl_sv_catpvf_nocontext':
#
sv.c:(.text+0x1529d): undefined reference to `pthread_getspecific'
#
sv.o: In function `Perl_sv_setpvf_mg_nocontext':
#
sv.c:(.text+0x1552d): undefined reference to `pthread_getspecific'
#
sv.o: In function `Perl_sv_setpvf_nocontext':
#
sv.c:(.text+0x156ed): undefined reference to `pthread_getspecific'
#
sv.o: In function `Perl_newSVpvf_nocontext':
#
sv.c:(.text+0x158ed): undefined reference to `pthread_getspecific'
#
perlio.o: In function `PerlIO_vsprintf':
#
perlio.c:(.text+0x2ad): undefined reference to `pthread_getspecific'
#
perlio.o:perlio.c:(.text+0x10d3): more undefined references to `pthread_getspecific' follow
#
miniperlmain.o: In function `main':
#
miniperlmain.c:(.text+0x56): undefined reference to `pthread_atfork'
#
opmini.o: In function `Perl_load_module_nocontext':
#
opmini.c:(.text+0xe687): undefined reference to `pthread_getspecific'
#
collect2: ld returned 1 exit status
#
*** Error code 1
#

#
Stop.
#
bmake: stopped in /usr/work/lang/perl5/work/perl-5.10.0
#
*** Error code 1
#

#
Stop.
#
bmake: stopped in /usr/pkgsrc/lang/perl5
#
*** Error code 1
#

>How-To-Repeat:
cd /usr/pkgsr/lang/perl5
bmake
>Fix:
Compiling a non-threaded version.
(PKG_OPTIONS.perl= -threads)

>Release-Note:

>Audit-Trail:
From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/40302: Compiling pkgsrc perl on linux-amd64 with support
	for threads
Date: Sun, 7 Mar 2010 05:29:07 +0000

 On Tue, Dec 30, 2008 at 09:50:00PM +0000, cirnatdan@gmail.com wrote:
  > LD_LIBRARY_PATH=/usr/work/lang/perl5/work/perl-5.10.0 gcc -Wl,-R/usr/pkg/lib  -L/usr/pkg/lib -o miniperl  `echo   gv.o toke.o perly.o op.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro.o hv.o av.o perl.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o xsutils.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o  | sed 's/ op.o / /'`  miniperlmain.o opmini.o -lm -lcrypt -ldl -lnsl
  > #
  > util.c:(.text+0x22eb): undefined reference to `pthread_getspecific'

 On the Linux box I have accessible right now, some pthread functions
 are in libc but pthread_getspecific apparently requires -pthread or
 -lpthread. Since neither of those appears on the link line above, it's
 not surprising that it fails.

 Probably the configure script is checking for pthread_self or
 pthread_mutex_init or something that's in libc to figure out whether
 it needs -pthread, and getting the wrong answer.

 Can you paste the sections from the build log that report what it's
 doing/finding about compiler flags for threads?

 (Also, check with the latest perl just in case this was fixed in 5.10.1)

 -- 
 David A. Holland
 dholland@netbsd.org

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/40302: Compiling pkgsrc perl on linux-amd64 with support
	for threads
Date: Sun, 7 Mar 2010 05:39:00 +0000

 On Sun, Mar 07, 2010 at 05:30:06AM +0000, David Holland wrote:
  >  On the Linux box I have accessible right now, some pthread functions
  >  are in libc but pthread_getspecific apparently requires -pthread or
  >  -lpthread. Since neither of those appears on the link line above, it's
  >  not surprising that it fails.
  >  
  >  Probably the configure script is checking for pthread_self or
  >  pthread_mutex_init or something that's in libc to figure out whether
  >  it needs -pthread, and getting the wrong answer.
  >  
  >  Can you paste the sections from the build log that report what it's
  >  doing/finding about compiler flags for threads?
  >  
  >  (Also, check with the latest perl just in case this was fixed in 5.10.1)

 On the machine I cited, 5.10.1 comes up with -lpthread and miniperl
 links ok. FWIW.

 -- 
 David A. Holland
 dholland@netbsd.org

State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 07 Mar 2010 06:08:03 +0000
State-Changed-Why:
A question was asked...


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.