develooper Front page | perl.perl5.porters | Postings from July 2008

Re: [perl #57458] Threads support in FreeBSD 7.0

Thread Previous | Thread Next
Anton Berezin
July 31, 2008 08:35
Re: [perl #57458] Threads support in FreeBSD 7.0
Message ID:
On Thu, Jul 31, 2008 at 04:07:18PM +0100, Nicholas Clark wrote:
> On Thu, Jul 31, 2008 at 02:44:51AM -0700, Kidney Bingos wrote:
> > Threads support appears to be broken with FreeBSD 7.0 on perl-current, perl-5.8.x and perl-5.10.x
> > 
> > The output from ./Configure on blead for instance:
> > If this doesn't make any sense to you, just accept the default 'y'.
> > Build a threading Perl? [y]  
> > Your platform has some specific hints regarding threaded builds, using them...
> > POSIX threads should be supported by FreeBSD 7.0-release --
> > but your system is missing the shared libc_r.
> > (/sbin/ldconfig -r doesn't find any).
> > 
> > Consider using the latest STABLE release.
> > =====
> > 
> > It appears that libc_r was deprecated with FreeBSD 5.x and completely removed with FreeBSD 7.0.
> > 
> > A look through the hints file for FreeBSD seems to suggest that -lpthread should just be added to the
> > libs line, but my Configure/hints foo is too weak to work out a suitable solution.
> "Works on MY machine" ( )
> $ /sbin/ldconfig -r | grep libc_r
>         247:-lc_r.6 => /usr/local/lib/compat/
> $ uname -a
> FreeBSD 7.0-STABLE FreeBSD 7.0-STABLE #7: Sat Jul 26 20:39:26 BST 2008  i386
> So, I'm not sure why it differs from what you see.
> As I can't replicate this, I'm not sure what to do. Hopefully Anton knows.

Actually we patch up hints/ in the ports version.  We avoid the
whole UU/usethreads.cbu mess altogether - but mainly because the ports
collection does not have an obligation to support anything older than
FreeBSD 5.X, hence this was not propagated back to you - the proper fix that
will still DTRT on, say, 2.2.7, will be more complicated.

We also have an advantage that the ports infrastructure knows pretty well
what the thread libs and cflags should be - on any supported OS version, so
we just take those vars from there.

On my 8.0-CURRENT system, as well as on 7.0, just adding -pthread in ldflags
is enough ($PTHREAD_LIBS is "-pthread", while $PTHREAD_CFLAGS is empty).

for what we changed.  Some of those changes are already in 5.10 (the
aout reordering, for example).

Please note that FreeBSD has a problem of main thread stack size being
pretty small (2MB on 32-bit systems and 4MB on 64-bit systems).
Unfortunately as it stands it is not possible to control that even at
compile time - you would have to patch up and rebuild threading libs.
Thus, threaded perl might have a problem with some applications (amavisd,
for example).

We're going for 'working' here. 'clean' is for people with skills...
-- Flemming Jacobsen

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About