From jylefort@brutele.be  Thu Oct 28 10:15:04 2004
Return-Path: <jylefort@brutele.be>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP
	id AB8F316A4CE; Thu, 28 Oct 2004 10:15:04 +0000 (GMT)
Received: from gateway.lefort.net (212.68.242.203.brutele.be [212.68.242.203])
	by mx1.FreeBSD.org (Postfix) with ESMTP
	id 183B943D3F; Thu, 28 Oct 2004 10:15:04 +0000 (GMT)
	(envelope-from jylefort@brutele.be)
Received: from jsite.lefort.net (jsite.lefort.net [192.168.1.2])
	by gateway.lefort.net (Postfix) with ESMTP id B0F2154F2;
	Thu, 28 Oct 2004 12:15:02 +0200 (CEST)
Received: by jsite.lefort.net (Postfix, from userid 1000)
	id 4BD7E22E09; Thu, 28 Oct 2004 12:15:02 +0200 (CEST)
Message-Id: <20041028101502.4BD7E22E09@jsite.lefort.net>
Date: Thu, 28 Oct 2004 12:15:02 +0200 (CEST)
From: Jean-Yves Lefort <jylefort@brutele.be>
Reply-To: Jean-Yves Lefort <jylefort@brutele.be>
To: FreeBSD-gnats-submit@freebsd.org
Cc: tobez@FreeBSD.org
Subject: Update port: lang/perl5.8 (fix threads support)
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         73233
>Category:       ports
>Synopsis:       Update port: lang/perl5.8 (fix threads support)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    tobez
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 28 10:20:24 GMT 2004
>Closed-Date:    Wed Feb 02 10:56:57 CET 2005
>Last-Modified:  Wed Feb 02 10:56:57 CET 2005
>Originator:     Jean-Yves Lefort
>Release:        FreeBSD 5.3-BETA6 i386
>Organization:
>Environment:
System: FreeBSD jsite.lefort.net 5.3-BETA6 FreeBSD 5.3-BETA6 #0: Tue Oct 26 11:26:46 CEST 2004 jylefort@jsite.lefort.net:/usr/obj/usr/src/sys/JSITE i386
>Description:
Uses PTHREAD_CFLAGS and PTHREADS_LIBS when WITH_THREADS is used, as
suggested by marcus.

This fixes various problems with both non-threaded and threaded Perl
programs.
>How-To-Repeat:
>Fix:
diff -ruN /usr/ports/lang/perl5.8/Makefile perl5.8/Makefile
--- /usr/ports/lang/perl5.8/Makefile	Fri Jul 30 12:36:09 2004
+++ perl5.8/Makefile	Thu Oct 28 11:55:43 2004
@@ -7,6 +7,7 @@
 
 PORTNAME=	perl
 PORTVERSION=	${PERL_VER}
+PORTREVISION=	1
 CATEGORIES=	lang devel perl5
 MASTER_SITES=	${MASTER_SITE_PERL_CPAN} \
 		${MASTER_SITE_LOCAL:S/$/:local/} \
@@ -26,6 +27,10 @@
 USE_BZIP2=	yes
 HAS_CONFIGURE=	yes
 CONFIGURE_SCRIPT=Configure
+
+CCFLAGS=	-DAPPLLIB_EXP=\"${BSDPAN_DEST}\"
+LIBS=		-lm
+
 CONFIGURE_ARGS=	-sde -Dprefix=${PREFIX} \
 	-Darchlib=${PREFIX}/lib/perl5/${PERL_VER}/${PERL_ARCH} \
 	-Dprivlib=${PREFIX}/lib/perl5/${PERL_VER} \
@@ -37,7 +42,7 @@
 	-Dsiteman1dir=${PREFIX}/man/man1 \
 	-Ui_malloc -Ui_iconv -Uinstallusrbinperl \
 	-Dcc="${CC}" -Doptimize="${CFLAGS}" -Duseshrplib \
-	-Dccflags=-DAPPLLIB_EXP=\"${BSDPAN_DEST}\"
+	-Dccflags="${CCFLAGS}" -Dlibs="${LIBS}"
 
 INCLUDEDIR=	/usr/include
 
@@ -70,6 +75,8 @@
 
 .if defined(WITH_THREADS)
 CONFIGURE_ARGS+=	-Dusethreads=y
+CCFLAGS+=		${PTHREAD_CFLAGS}
+LIBS+=			${PTHREAD_LIBS}
 PKGNAMESUFFIX=		-threaded
 # it seems perl malloc has problems with threaded perl on FreeBSD
 .undef WITH_PERL_MALLOC
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->tobez 
Responsible-Changed-By: tobez 
Responsible-Changed-When: Thu Oct 28 12:30:42 CEST 2004 
Responsible-Changed-Why:  
Grab. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=73233 

From: Jean-Yves Lefort <jylefort@brutele.be>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: ports/73233: Update port: lang/perl5.8 (fix threads support)
Date: Thu, 28 Oct 2004 12:31:30 +0200

 Actually, I think PTHREAD_CFLAGS and PTHREADS_LIBS must be moved out
 of the WITH_THREADS section, since they're also needed when a
 non-threaded Perl uses threaded bindings.
 
 Joe Marcus Clark says:
 
 "It seems to me, the fact that Perl itself is not linked to
 ${PTHREAD_LIBS} should cause a big problem.  The thread guys have
 already said (and I've seen this) that one cannot dynamically load a
 threaded module into a non-threaded running program (which I think
 sucks, but that's life as it were)."
 
 In such case this PR also applies to the lang/perl5 port.
 
 -- 
 Jean-Yves Lefort
 
 jylefort@brutele.be
 http://lefort.be.eu.org/

From: Edwin Groothuis <edwin@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org, jylefort@brutele.be
Cc:  
Subject: Re: ports/73233: Update port: lang/perl5.8 (fix threads support)
Date: Wed, 22 Dec 2004 02:13:22 +0000

 This PR is blocking ports/73063 and ports/73062.
 Any idea when this is going to be commited?
 (I trust Jean-Yves enough to commit it myself if you prefer that)

From: Anton Berezin <tobez@FreeBSD.org>
To: Jean-Yves Lefort <jylefort@brutele.be>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: ports/73233: Update port: lang/perl5.8 (fix threads support)
Date: Mon, 31 Jan 2005 13:44:54 +0100

 On Thu, Oct 28, 2004 at 12:15:02PM +0200, Jean-Yves Lefort wrote:
 
 > >Description:
 > Uses PTHREAD_CFLAGS and PTHREADS_LIBS when WITH_THREADS is used, as
 > suggested by marcus.
 > 
 > This fixes various problems with both non-threaded and threaded Perl
 > programs.
 > >How-To-Repeat:
 > >Fix:
 > diff -ruN /usr/ports/lang/perl5.8/Makefile perl5.8/Makefile
 > --- /usr/ports/lang/perl5.8/Makefile	Fri Jul 30 12:36:09 2004
 > +++ perl5.8/Makefile	Thu Oct 28 11:55:43 2004
 > @@ -7,6 +7,7 @@
 >  
 >  PORTNAME=	perl
 >  PORTVERSION=	${PERL_VER}
 > +PORTREVISION=	1
 >  CATEGORIES=	lang devel perl5
 >  MASTER_SITES=	${MASTER_SITE_PERL_CPAN} \
 >  		${MASTER_SITE_LOCAL:S/$/:local/} \
 > @@ -26,6 +27,10 @@
 >  USE_BZIP2=	yes
 >  HAS_CONFIGURE=	yes
 >  CONFIGURE_SCRIPT=Configure
 > +
 > +CCFLAGS=	-DAPPLLIB_EXP=\"${BSDPAN_DEST}\"
 > +LIBS=		-lm
 > +
 >  CONFIGURE_ARGS=	-sde -Dprefix=${PREFIX} \
 >  	-Darchlib=${PREFIX}/lib/perl5/${PERL_VER}/${PERL_ARCH} \
 >  	-Dprivlib=${PREFIX}/lib/perl5/${PERL_VER} \
 > @@ -37,7 +42,7 @@
 >  	-Dsiteman1dir=${PREFIX}/man/man1 \
 >  	-Ui_malloc -Ui_iconv -Uinstallusrbinperl \
 >  	-Dcc="${CC}" -Doptimize="${CFLAGS}" -Duseshrplib \
 > -	-Dccflags=-DAPPLLIB_EXP=\"${BSDPAN_DEST}\"
 > +	-Dccflags="${CCFLAGS}" -Dlibs="${LIBS}"
 >  
 >  INCLUDEDIR=	/usr/include
 >  
 > @@ -70,6 +75,8 @@
 >  
 >  .if defined(WITH_THREADS)
 >  CONFIGURE_ARGS+=	-Dusethreads=y
 > +CCFLAGS+=		${PTHREAD_CFLAGS}
 > +LIBS+=			${PTHREAD_LIBS}
 >  PKGNAMESUFFIX=		-threaded
 >  # it seems perl malloc has problems with threaded perl on FreeBSD
 >  .undef WITH_PERL_MALLOC
 
 Actually, there is a much better way to do it, since using -Dlibs breaks
 a lot of things that a probed by perl Configure.
 
 Regardless, have you actually tested this patch on FreeBSD 5.X and or
 -CURRENT?  I am having substantial problems with threaded perl (5.8.6)
 that uses correct thread libraries.  I realize that the current way of
 blindly link with libc_r is broken, but at least it sort of worked.  :-)
 
 \Anton.
 -- 
 The moronity of the universe is a monotonically increasing function. --
 Jarkko Hietaniemi

From: Jean-Yves Lefort <jylefort@brutele.be>
To: Anton Berezin <tobez@FreeBSD.org>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: ports/73233: Update port: lang/perl5.8 (fix threads support)
Date: Mon, 31 Jan 2005 14:03:55 +0100

 On Mon, 31 Jan 2005 13:44:54 +0100
 Anton Berezin <tobez@FreeBSD.org> wrote:
 
 > On Thu, Oct 28, 2004 at 12:15:02PM +0200, Jean-Yves Lefort wrote:
 > 
 > > >Description:
 > > Uses PTHREAD_CFLAGS and PTHREADS_LIBS when WITH_THREADS is used, as
 > > suggested by marcus.
 > > 
 > > This fixes various problems with both non-threaded and threaded Perl
 > > programs.
 > > >How-To-Repeat:
 > > >Fix:
 > > diff -ruN /usr/ports/lang/perl5.8/Makefile perl5.8/Makefile
 > > --- /usr/ports/lang/perl5.8/Makefile	Fri Jul 30 12:36:09 2004
 > > +++ perl5.8/Makefile	Thu Oct 28 11:55:43 2004
 > > @@ -7,6 +7,7 @@
 > >  
 > >  PORTNAME=	perl
 > >  PORTVERSION=	${PERL_VER}
 > > +PORTREVISION=	1
 > >  CATEGORIES=	lang devel perl5
 > >  MASTER_SITES=	${MASTER_SITE_PERL_CPAN} \
 > >  		${MASTER_SITE_LOCAL:S/$/:local/} \
 > > @@ -26,6 +27,10 @@
 > >  USE_BZIP2=	yes
 > >  HAS_CONFIGURE=	yes
 > >  CONFIGURE_SCRIPT=Configure
 > > +
 > > +CCFLAGS=	-DAPPLLIB_EXP=\"${BSDPAN_DEST}\"
 > > +LIBS=		-lm
 > > +
 > >  CONFIGURE_ARGS=	-sde -Dprefix=${PREFIX} \
 > >  	-Darchlib=${PREFIX}/lib/perl5/${PERL_VER}/${PERL_ARCH} \
 > >  	-Dprivlib=${PREFIX}/lib/perl5/${PERL_VER} \
 > > @@ -37,7 +42,7 @@
 > >  	-Dsiteman1dir=${PREFIX}/man/man1 \
 > >  	-Ui_malloc -Ui_iconv -Uinstallusrbinperl \
 > >  	-Dcc="${CC}" -Doptimize="${CFLAGS}" -Duseshrplib \
 > > -	-Dccflags=-DAPPLLIB_EXP=\"${BSDPAN_DEST}\"
 > > +	-Dccflags="${CCFLAGS}" -Dlibs="${LIBS}"
 > >  
 > >  INCLUDEDIR=	/usr/include
 > >  
 > > @@ -70,6 +75,8 @@
 > >  
 > >  .if defined(WITH_THREADS)
 > >  CONFIGURE_ARGS+=	-Dusethreads=y
 > > +CCFLAGS+=		${PTHREAD_CFLAGS}
 > > +LIBS+=			${PTHREAD_LIBS}
 > >  PKGNAMESUFFIX=		-threaded
 > >  # it seems perl malloc has problems with threaded perl on FreeBSD
 > >  .undef WITH_PERL_MALLOC
 > 
 > Actually, there is a much better way to do it, since using -Dlibs breaks
 > a lot of things that a probed by perl Configure.
 
 I don't see what it breaks, but if you have a better way just use
 it. I'm not exactly proficient with the Perl build system.
 
 > Regardless, have you actually tested this patch on FreeBSD 5.X and or
 > -CURRENT?  I am having substantial problems with threaded perl (5.8.6)
 > that uses correct thread libraries.  I realize that the current way of
 > blindly link with libc_r is broken, but at least it sort of worked.  :-)
 
 I've been running the patched port (perl-threaded-5.8.5_1) for months
 on 5.3 without any problem.
 
 Please note that some bindings simply do not run at all without this
 patch (73062 for instance).
 
 -- 
 Jean-Yves Lefort
 
 jylefort@brutele.be
 http://lefort.be.eu.org/

From: Jean-Yves Lefort <jylefort@brutele.be>
To: Anton Berezin <tobez@FreeBSD.org>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: ports/73233: Update port: lang/perl5.8 (fix threads support)
Date: Mon, 31 Jan 2005 16:19:07 +0100

 On Mon, 31 Jan 2005 16:09:51 +0100
 Anton Berezin <tobez@FreeBSD.org> wrote:
 
 > On Mon, Jan 31, 2005 at 02:03:55PM +0100, Jean-Yves Lefort wrote:
 > > On Mon, 31 Jan 2005 13:44:54 +0100
 > > Anton Berezin <tobez@FreeBSD.org> wrote:
 > 
 > > > Actually, there is a much better way to do it, since using -Dlibs breaks
 > > > a lot of things that a probed by perl Configure.
 > > 
 > > I don't see what it breaks, but if you have a better way just use
 > > it. I'm not exactly proficient with the Perl build system.
 > 
 > It breaks WITH_GDBM, for example.  The problem is that explicit -Dlibs
 > are not very nice.
 
 All the tests but one succeed:
 
 lib/ExtUtils/t/Embed......................Unrecognized argument in LIBS ignored: '-pthread'
 FAILED at test 2
 
 > Anyway, it seems I found what I was doing wrong, so after a bit more
 > testing I am doing an update which will incorporate the proper threading
 > model.
 
 Great. :)
 
 > I am a bit uneasy with regard to enabling compilation with thread
 > libraries even for non-threaded perl.  I think this should work fine on
 > 5.X and -CURRENT, but I am not so sure about 4.X.  That is, while it is
 > true that using non-thread-aware perl with thread-aware extensions might
 > lead to problems, it also seems true that using thread-aware perl with
 > non-thread-aware extensions might lead to problems as well.
 
 Good point. Perhaps a solution would be to IGNORE the port on 4.x.
 
 -- 
 Jean-Yves Lefort
 
 jylefort@brutele.be
 http://lefort.be.eu.org/

From: Anton Berezin <tobez@FreeBSD.org>
To: Jean-Yves Lefort <jylefort@brutele.be>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: ports/73233: Update port: lang/perl5.8 (fix threads support)
Date: Mon, 31 Jan 2005 16:39:17 +0100

 On Mon, Jan 31, 2005 at 04:19:07PM +0100, Jean-Yves Lefort wrote:
 > On Mon, 31 Jan 2005 16:09:51 +0100
 > Anton Berezin <tobez@FreeBSD.org> wrote:
 
 > > I am a bit uneasy with regard to enabling compilation with thread
 > > libraries even for non-threaded perl.  I think this should work fine on
 > > 5.X and -CURRENT, but I am not so sure about 4.X.  That is, while it is
 > > true that using non-thread-aware perl with thread-aware extensions might
 > > lead to problems, it also seems true that using thread-aware perl with
 > > non-thread-aware extensions might lead to problems as well.
 > 
 > Good point. Perhaps a solution would be to IGNORE the port on 4.x.
 
 That is obviously a bad idea.  :-)
 
 Anyway, I discussed this with a couple of people, so for now - fixed
 WITH_THREADS are in, thread libraries for non-threaded perl are out.
 
 Cheers,
 \Anton.
 -- 
 The moronity of the universe is a monotonically increasing function. --
 Jarkko Hietaniemi
State-Changed-From-To: open->closed 
State-Changed-By: tobez 
State-Changed-When: Wed Feb 2 10:55:41 CET 2005 
State-Changed-Why:  
A different fix applied to lang/perl5.8.  It is still an open question 
whether to always compile perl with threaded libraries (even for a 
non-threaded perl). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=73233 
>Unformatted:
