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

Re: [perl #41590] [PATCH] 5.8.8 Remove THREADS_HAVE_PIDS hint for NPTL enabled

Thread Previous
From:
Rafael Garcia-Suarez
Date:
March 26, 2007 03:10
Subject:
Re: [perl #41590] [PATCH] 5.8.8 Remove THREADS_HAVE_PIDS hint for NPTL enabled
Message ID:
b77c1dce0703260310m3673903bj36f5ec7e136e658d@mail.gmail.com
On 23/02/07, Rafael Garcia-Suarez <rgarciasuarez@gmail.com> wrote:
> > As NPTL is the default for modern Linux (2.6), this patch seems
> > reasonable.
> > Older Linux distributions could simply readd the -DTHREADS_HAVE_PIDS
> > hint
> > to their compile flags.
>
> What about testing the threading model in the hints file with
> something like getconf GNU_LIBPTHREAD_VERSION ? Well, that's not
> perfect either, since you can run perl with a different kernel than
> the one you've compiled it with...

I've now commited this after some testing.

Change 30758 by rgs@stcosmo on 2007/03/26 10:09:21

        On Linux, don't compile with -DTHREADS_HAVE_PIDS if the
        kernel uses the NPTL threading model

Affected files ...

... //depot/perl/hints/linux.sh#64 edit

Differences ...

==== //depot/perl/hints/linux.sh#64 (text) ====

@@ -308,9 +308,15 @@
 # This script UU/usethreads.cbu will get 'called-back' by Configure
 # after it has prompted the user for whether to use threads.
 cat > UU/usethreads.cbu <<'EOCBU'
+if getconf GNU_LIBPTHREAD_VERSION | grep NPTL >/dev/null 2>/dev/null
+then
+    threadshavepids=""
+else
+    threadshavepids="-DTHREADS_HAVE_PIDS"
+fi
 case "$usethreads" in
 $define|true|[yY]*)
-        ccflags="-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS $ccflags"
+        ccflags="-D_REENTRANT -D_GNU_SOURCE $threadshavepids $ccflags"
         if echo $libswanted | grep -v pthread >/dev/null
         then
             set `echo X "$libswanted "| sed -e 's/ c / pthread c /'`

Thread Previous


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