Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DragonFly thread lib selection #9905

Closed
p5pRT opened this issue Oct 9, 2009 · 14 comments
Closed

Fix DragonFly thread lib selection #9905

p5pRT opened this issue Oct 9, 2009 · 14 comments

Comments

@p5pRT
Copy link

p5pRT commented Oct 9, 2009

Migrated from rt.perl.org#69686 (status was 'resolved')

Searchable as RT69686$

@p5pRT
Copy link
Author

p5pRT commented Oct 9, 2009

From corecode@fs.ei.tum.de

Hey,

attached patch fixes the thread library detection in DragonFly. All
versions of DragonFly can be used threaded with -pthread. libc_r must
not be used directly.

Please let me know if you have any questions.

Thanks,
  simon

--
  <3 the future +++ RENT this banner advert +++ ASCII Ribbon /"\
  rock the past +++ space for low CHF NOW!1 +++ Campaign \ /
Party Enjoy Relax | http​://dragonflybsd.org Against HTML \
Dude 2c 2 the max ! http​://golden-apple.biz Mail + News / \

@p5pRT
Copy link
Author

p5pRT commented Oct 9, 2009

From corecode@fs.ei.tum.de

perl-dragonfly-threads.diff
$NetBSD$

--- hints/dragonfly.sh.orig	2009-10-09 15:28:17 +0200
+++ hints/dragonfly.sh
@@ -19,18 +19,10 @@ esac
 # out here to avoid duplicating them everywhere.
 case "$osvers" in
 *)  objformat=`/usr/bin/objformat`
-    if [ x$objformat = xelf ]; then
-	libpth="/usr/lib /usr/local/lib"
-	glibpth="/usr/lib /usr/local/lib"
-	ldflags="-Wl,-E "
-	lddlflags="-shared "
-    else
-	if [ -e /usr/lib/aout ]; then
-	    libpth="/usr/lib/aout /usr/local/lib /usr/lib"
-	    glibpth="/usr/lib/aout /usr/local/lib /usr/lib"
-	fi
-	lddlflags='-Bshareable'
-    fi
+    libpth="/usr/lib /usr/local/lib"
+    glibpth="/usr/lib /usr/local/lib"
+    ldflags="-Wl,-E "
+    lddlflags="-shared "
     cccdlflags='-DPIC -fPIC'
     ;;
 esac
@@ -67,43 +59,16 @@ d_voidsig='define'
 cat > UU/usethreads.cbu <<'EOCBU'
 case "$usethreads" in
 $define|true|[yY]*)
-    lc_r=`/sbin/ldconfig -r|grep ':-lc_r'|awk '{print $NF}'|sed -n '$p'`
     case "$osvers" in
-    *)  if [ ! -r "$lc_r" ]; then
-	    cat <<EOM >&4
-POSIX threads should be supported by FreeBSD $osvers --
-but your system is missing the shared libc_r.
-(/sbin/ldconfig -r doesn't find any).
+    *)  ldflags="-pthread $ldflags"
 
-Consider using the latest STABLE release.
-EOM
-	    exit 1
-	fi
-	case "$osvers" in
-	    *)  ldflags="-pthread $ldflags"
-		;;
-	esac
 	# Both in 4.x and 5.x gethostbyaddr_r exists but
 	# it is "Temporary function, not threadsafe"...
 	# Presumably earlier it didn't even exist.
 	d_gethostbyaddr_r="undef"
 	d_gethostbyaddr_r_proto="0"
-	;;
-    esac
 
-    set `echo X "$libswanted "| sed -e 's/ c / c_r /'`
-    shift
-    libswanted="$*"
-    # Configure will probably pick the wrong libc to use for nm scan.
-    # The safest quick-fix is just to not use nm at all...
-    usenm=false
-
-    unset lc_r
-
-    # Even with the malloc mutexes the Perl malloc does not
-    # seem to be threadsafe in FreeBSD?
-    case "$usemymalloc" in
-    '')  usemymalloc=n ;;
+	;;
     esac
 esac
 EOCBU

@p5pRT
Copy link
Author

p5pRT commented Oct 10, 2009

From @bingos

On Fri, Oct 09, 2009 at 10​:49​:56AM -0700, Simon 'corecode' Schubert (via RT) wrote​:

# New Ticket Created by Simon 'corecode' Schubert
# Please include the string​: [perl #69686]
# in the subject line of all future correspondence about this issue.
# <URL​: http​://rt.perl.org/rt3/Ticket/Display.html?id=69686 >

Hey,

attached patch fixes the thread library detection in DragonFly. All
versions of DragonFly can be used threaded with -pthread. libc_r must
not be used directly.

Please let me know if you have any questions.

Thanks,
simon

Thanks, applied as http​://perl5.git.perl.org/perl.git/commit/6c1b5ced

I will test when I have access to a Dragonfly BSD system on Monday.

Cheers,

--
Chris Williams
aka BinGOs
PGP ID 0x4658671F
http​://www.gumbynet.org.uk

@p5pRT
Copy link
Author

p5pRT commented Oct 10, 2009

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Oct 12, 2009

From @bingos

On Sat, Oct 10, 2009 at 07​:31​:34PM +0100, Chris 'BinGOs' Williams wrote​:

On Fri, Oct 09, 2009 at 10​:49​:56AM -0700, Simon 'corecode' Schubert (via RT) wrote​:

# New Ticket Created by Simon 'corecode' Schubert
# Please include the string​: [perl #69686]
# in the subject line of all future correspondence about this issue.
# <URL​: http​://rt.perl.org/rt3/Ticket/Display.html?id=69686 >

Hey,

attached patch fixes the thread library detection in DragonFly. All
versions of DragonFly can be used threaded with -pthread. libc_r must
not be used directly.

Please let me know if you have any questions.

Thanks,
simon

Thanks, applied as http​://perl5.git.perl.org/perl.git/commit/6c1b5ced

I will test when I have access to a Dragonfly BSD system on Monday.

Okay, managed to get a Dragonfly BSD 2.0.1 system going today to test
blead on, after finally getting git installed from pkgsrc.

Builds fine with ./Configure -de -Dusedevel -Dusethreads && make

make test though hangs on

cpan/libnet/t/hostname.t

had to eventually give up on it after an hour.

Don't know if this is a Dragonfly thing, or a dfly running under vmware thing.

Maybe someone else with a dfly system on 'real' hardware would like to pitch in

Cheers,

--
Chris Williams
aka BinGOs
PGP ID 0x4658671F
http​://www.gumbynet.org.uk

@p5pRT
Copy link
Author

p5pRT commented Oct 13, 2009

From corecode@fs.ei.tum.de

Chris 'BinGOs' Williams wrote​:

attached patch fixes the thread library detection in DragonFly. All
versions of DragonFly can be used threaded with -pthread. libc_r must
not be used directly.

Please let me know if you have any questions.

Thanks,
simon

Thanks, applied as http​://perl5.git.perl.org/perl.git/commit/6c1b5ced

I will test when I have access to a Dragonfly BSD system on Monday.
Okay, managed to get a Dragonfly BSD 2.0.1 system going today to test
blead on, after finally getting git installed from pkgsrc.

Thanks for trying to test!

The most recent version is 2.4.1, which is over a year newer - it might
be that 2.0.1 had problems with compiling perl natively.

Maybe someone else with a dfly system on 'real' hardware would like to pitch in

Well, I am running multiple DragonFly systems :) The thread patch for
sure is correct (I'm the one who architected most threading changes in
DragonFly).

Let me know if you need some other testing.

cheers
  simon

--
  <3 the future +++ RENT this banner advert +++ ASCII Ribbon /"\
  rock the past +++ space for low CHF NOW!1 +++ Campaign \ /
Party Enjoy Relax | http​://dragonflybsd.org Against HTML \
Dude 2c 2 the max ! http​://golden-apple.biz Mail + News / \

@p5pRT
Copy link
Author

p5pRT commented Oct 13, 2009

From @bingos

On Tue, Oct 13, 2009 at 01​:12​:26AM +0200, Simon 'corecode' Schubert wrote​:

Thanks for trying to test!

The most recent version is 2.4.1, which is over a year newer - it might
be that 2.0.1 had problems with compiling perl natively.

o.O not noticed that. Cool. I'll have to try that out when I get the tuits.

Maybe someone else with a dfly system on 'real' hardware would like to
pitch in

Well, I am running multiple DragonFly systems :) The thread patch for
sure is correct (I'm the one who architected most threading changes in
DragonFly).

Let me know if you need some other testing.

Yeah, I should be grateful if you could find the time to test blead perl
on these systems.

$ git clone git​://perl5.git.perl.org/perl.git perl
$ cd perl
$ ./Configure -de -Dusedevel -Dusethreads && make && make test

Many thanks,

--
Chris Williams
aka BinGOs
PGP ID 0x4658671F
http​://www.gumbynet.org.uk

@p5pRT
Copy link
Author

p5pRT commented Oct 16, 2009

From @doughera88

On Mon, 12 Oct 2009, Chris 'BinGOs' Williams wrote​:

Okay, managed to get a Dragonfly BSD 2.0.1 system going today to test
blead on, after finally getting git installed from pkgsrc.

Builds fine with ./Configure -de -Dusedevel -Dusethreads && make

make test though hangs on

cpan/libnet/t/hostname.t

had to eventually give up on it after an hour.

Don't know if this is a Dragonfly thing, or a dfly running under vmware thing.

I saw something similar a while ago with NetBSD (or maybe it was OpenBSD)
under vmware with NAT. I vaguely suspect it's a combination of the BSD
installation procedure and vmware's DHCP server, but I wasn't able to find
the ultimate cause at the time.

In any case, I don't think it's related to this patch at all.

--
  Andy Dougherty doughera@​lafayette.edu

@p5pRT
Copy link
Author

p5pRT commented Oct 17, 2009

From corecode@fs.ei.tum.de

Chris 'BinGOs' Williams wrote​:

Yeah, I should be grateful if you could find the time to test blead perl
on these systems.

$ git clone git​://perl5.git.perl.org/perl.git perl
$ cd perl
$ ./Configure -de -Dusedevel -Dusethreads && make && make test

Failed 5 tests out of 1709, 99.71% okay.
  ../cpan/Parse-CPAN-Meta/t/21_bom.t
  ../lib/File/Copy.t
  op/magic.t
  re/pat_special_cc.t
  re/pat_special_cc_thr.t

Please let me know whether and how I should investigate this further.

cheers
  simon

@p5pRT
Copy link
Author

p5pRT commented Oct 20, 2009

From @obra

On Fri, Oct 16, 2009 at 06​:55​:47PM +0200, Simon 'corecode' Schubert wrote​:

Chris 'BinGOs' Williams wrote​:

Yeah, I should be grateful if you could find the time to test blead perl
on these systems.

$ git clone git​://perl5.git.perl.org/perl.git perl
$ cd perl
$ ./Configure -de -Dusedevel -Dusethreads && make && make test

Failed 5 tests out of 1709, 99.71% okay.
../cpan/Parse-CPAN-Meta/t/21_bom.t
../lib/File/Copy.t
op/magic.t
re/pat_special_cc.t
re/pat_special_cc_thr.t

Please let me know whether and how I should investigate this further.

Simon,

I'd be curious to know how the just-released 5.11.1 does for you.

Thanks!
Jesse

cheers
simon

--

@p5pRT
Copy link
Author

p5pRT commented Feb 22, 2016

From @mauke

On Tue Oct 20 11​:36​:03 2009, jesse wrote​:

On Fri, Oct 16, 2009 at 06​:55​:47PM +0200, Simon 'corecode' Schubert wrote​:

Failed 5 tests out of 1709, 99.71% okay.
../cpan/Parse-CPAN-Meta/t/21_bom.t
../lib/File/Copy.t
op/magic.t
re/pat_special_cc.t
re/pat_special_cc_thr.t

Please let me know whether and how I should investigate this further.

Simon,

I'd be curious to know how the just-released 5.11.1 does for you.

Thanks!
Jesse

This ticket is listed in perl5120delta​:

  DragonFly BSD

  * Fix thread library selection [perl #69686]

I think it can be closed. Objections?

@p5pRT
Copy link
Author

p5pRT commented May 21, 2016

From @ap

* l.mai@​web.de via RT <perlbug-followup@​perl.org> [2016-02-22 22​:20]​:

I think it can be closed. Objections?

The patch was applied in 6c1b5ce

Not sure why Jesse wanted feedback from the OP on whether his own patch
worked for him, but since we’ve not heard back in 6½ years and the perl
package in DragonFly BSD does not patch hints/dragonfly.sh (I just went
and looked), my guess is the answer would be “just fine, thank you”.

I say close.

@p5pRT
Copy link
Author

p5pRT commented May 21, 2016

From @jkeenan

On Fri May 20 23​:09​:31 2016, aristotle wrote​:

* l.mai@​web.de via RT <perlbug-followup@​perl.org> [2016-02-22 22​:20]​:

I think it can be closed. Objections?

The patch was applied in 6c1b5ce

Not sure why Jesse wanted feedback from the OP on whether his own patch
worked for him, but since we’ve not heard back in 6½ years and the perl
package in DragonFly BSD does not patch hints/dragonfly.sh (I just went
and looked), my guess is the answer would be “just fine, thank you”.

I say close.

Closing.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT p5pRT closed this as completed May 21, 2016
@p5pRT
Copy link
Author

p5pRT commented May 21, 2016

@jkeenan - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant