Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.88k stars 531 forks source link

Threads support in FreeBSD 7.0 #9434

Closed p5pRT closed 15 years ago

p5pRT commented 15 years ago

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

Searchable as RT57458$

p5pRT commented 15 years ago

From @bingos

Hi\,

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​:

====== ./Configure -de -Dusethreads -Duse64bitint -Dusedevel

Beginning of configuration questions for perl5.

Checking echo to see how to suppress newlines... ...using -n. The star should be here-->*

First let's make sure your kit is complete. Checking... Looks good...

Would you like to see the instructions? [n]

Locating common programs... awk is in /usr/bin/awk. cat is in /bin/cat. chmod is in /bin/chmod. comm is in /usr/bin/comm. cp is in /bin/cp. echo is in /bin/echo. expr is in /bin/expr. grep is in /usr/bin/grep. ls is in /bin/ls. mkdir is in /bin/mkdir. rm is in /bin/rm. sed is in /usr/bin/sed. sort is in /usr/bin/sort. touch is in /usr/bin/touch. tr is in /usr/bin/tr. uniq is in /usr/bin/uniq.

Don't worry if any of the following aren't found... ar is in /usr/bin/ar. I don't see bison out there\, offhand. byacc is in /usr/bin/byacc. cpp is in /usr/bin/cpp. csh is in /bin/csh. date is in /bin/date. egrep is in /usr/bin/egrep. gmake is in /usr/local/bin/gmake. gzip is in /usr/bin/gzip. less is in /usr/bin/less. ln is in /bin/ln. make is in /usr/bin/make. more is in /usr/bin/more. nm is in /usr/bin/nm. nroff is in /usr/bin/nroff. I don't see pg out there\, either. test is in /bin/test. uname is in /usr/bin/uname. I don't see zip out there\, either. Using the test built into your sh.

Checking compatibility between /bin/echo and builtin echo (if any)... They are compatible. In fact\, they may be identical. The following message is sponsored by

  Dresden.pm\<--The stars should be here.

Dear Perl user\, system administrator or package maintainer\, the Perl community sends greetings to you. Do you (emblematical) greet back [Y/n]? n

Symbolic links are supported.

Checking how to test for symbolic links... You can test for symbolic links with 'test -h'.

Good\, your tr supports [​:lower​:] and [​:upper​:] to convert case. Using [​:upper​:] and [​:lower​:] to convert case.

First time through\, eh? I have some defaults handy for some systems that need some extra help getting the Configure answers right​:

3b1 dos_djgpp irix_6_0 nonstopux sunos_4_0
aix dragonfly irix_6_1 openbsd sunos_4_1
aix_3 dynix isc opus super-ux
aix_4 dynixptx isc_2 os2 svr4
altos486 epix linux os390 svr5
amigaos esix4 lynxos os400 ti1500
apollo fps machten posix-bc titanos
atheos freebsd machten_2 powerux ultrix_4
aux_3 genix midnightbsd qnx umips
beos gnu mint rhapsody unicos
bsdos gnukfreebsd mips riscos unicosmk
catamount gnuknetbsd mpc sco unisysdynix
convexos greenhills mpeix sco_2_3_0 utekv
cxux hpux ncr_tower sco_2_3_1 uts
cygwin i386 netbsd sco_2_3_2 uwin
darwin interix newsos4 sco_2_3_3 vmesa
dcosx irix_4 next_3 sco_2_3_4 vos
dec_osf irix_5 next_3_0 solaris_2
dgux irix_6 next_4 stellar

You may give one or more space-separated answers\, or "none" if appropriate. If you have a handcrafted Policy.sh file or a Policy.sh file generated by a previous run of Configure\, you may specify it as well as or instead of OS-specific hints. If hints are provided for your OS\, you should use them​: although Perl can probably be built without hints on many platforms\, using hints often improve performance and may enable features that Configure can't set up on its own. If there are no hints that match your OS\, specify "none"; DO NOT give a wrong version or a wrong OS.

Which of these apply\, if any? [freebsd]
./hints/freebsd.sh​: /usr/bin/objformat​: not found

Some users have reported that Configure halts when testing for the O_NONBLOCK symbol with a syntax error. This is apparently a sh error. Rerunning Configure with ksh apparently fixes the problem. Try   ksh Configure [your options]

Configure uses the operating system name and version to set some defaults. The default value is probably right if the name rings a bell. Otherwise\, since spelling matters for me\, either accept the default or answer "none" to leave it blank.

Operating system name? [freebsd]

Operating system version? [7.0-release]

By default\, perl5 will be installed in /usr/local/bin\, manual pages under /usr/local/man\, etc...\, i.e. with /usr/local as prefix for all installation directories. Typically this is something like /usr/local. If you wish to have binaries under /usr/bin but other parts of the installation under /usr/local\, that's ok​: you will be prompted separately for each of the installation directories\, the prefix being only used to set the defaults.

Installation prefix to use? (~name ok) [/usr/local]

AFS does not seem to be running...

In some special cases\, particularly when building perl5 for distribution\, it is convenient to distinguish the directory in which files should be installed from the directory (/usr/local) in which they will eventually reside. For most users\, these two directories are the same.

What installation prefix should I use for installing files? (~name ok) [/usr/local]

Perl can be built to use the SOCKS proxy protocol library. To do so\, Configure must be run with -Dusesocks. If you use SOCKS you also need to use the PerlIO abstraction layer\, this will be implicitly selected.

If this doesn't make any sense to you\, just accept the default 'n'. Build Perl for SOCKS? [n]

Previous version of perl5 used the standard IO mechanisms as defined in \<stdio.h>. Versions 5.003_02 and later of perl5 allow alternate IO mechanisms via the PerlIO abstraction layer\, but the stdio mechanism is still available if needed. The abstraction layer can use AT&T's sfio (if you already have sfio installed) or regular stdio. Using PerlIO with sfio may cause problems with some extension modules.

If this doesn't make any sense to you\, just accept the default 'y'. Use the PerlIO abstraction layer? [y]

Getting the current patchlevel... (You have perl5 version 11 subversion 0 patch 34166.)

Perl can be built to take advantage of threads on some systems. To do so\, Configure can be run with -Dusethreads.

Note that Perl built with threading support runs slightly slower and uses more memory than plain Perl. The current implementation is believed to be stable\, but it is fairly new\, and so should be treated with caution.

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.

Many thanks\,

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

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

p5pRT commented 15 years ago

From @nwc10

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" ( http​://www.codinghorror.com/blog/archives/000818.html )

$ /sbin/ldconfig -r | grep libc_r   247​:-lc_r.6 => /usr/local/lib/compat/libc_r.so.6 $ uname -a FreeBSD plum.flirble.org 7.0-STABLE FreeBSD 7.0-STABLE #7​: Sat Jul 26 20​:39​:26 BST 2008 root@​plum.flirble.org​:/usr/obj/usr/src/sys/PLUM 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.

Nicholas Clark

p5pRT commented 15 years ago

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

p5pRT commented 15 years ago

From @tobez

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" ( http​://www.codinghorror.com/blog/archives/000818.html )

$ /sbin/ldconfig -r | grep libc_r 247​:-lc_r.6 => /usr/local/lib/compat/libc_r.so.6 $ uname -a FreeBSD plum.flirble.org 7.0-STABLE FreeBSD 7.0-STABLE #7​: Sat Jul 26 20​:39​:26 BST 2008 root@​plum.flirble.org​:/usr/obj/usr/src/sys/PLUM 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/freebsd.sh 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).

See http​://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/ports/lang/perl5.8/files/patch-freebsd.sh?rev=1.3;content-type=text%2Fplain 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).

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

p5pRT commented 15 years ago

From @bingos

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​:

"Works on MY machine" ( http​://www.codinghorror.com/blog/archives/000818.html )

$ /sbin/ldconfig -r | grep libc_r 247​:-lc_r.6 => /usr/local/lib/compat/libc_r.so.6 $ uname -a FreeBSD plum.flirble.org 7.0-STABLE FreeBSD 7.0-STABLE #7​: Sat Jul 26 20​:39​:26 BST 2008 root@​plum.flirble.org​:/usr/obj/usr/src/sys/PLUM 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.

Nicholas Clark

On a brand new FreeBSD 7.0 install without any of the binary compatibility options libc_r isn't available.

"Your machine" appears to have a FreeBSD 6 (?) binary compatibility option installed.

It doesn't seem reasonable to expect people to have to enable binary compat in order to have threads support.

But thanks for looking. Yes\, hopefully Anton does know >​:)

Cheers\,

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

p5pRT commented 15 years ago

From @nwc10

On Thu\, Jul 31\, 2008 at 04​:43​:44PM +0100\, Kidney Bingos wrote​:

On a brand new FreeBSD 7.0 install without any of the binary compatibility options libc_r isn't available.

"Your machine" appears to have a FreeBSD 6 (?) binary compatibility option installed.

Which isn't actually "mine"\, but I get to play on it.

It doesn't seem reasonable to expect people to have to enable binary compat in order to have threads support.

Agree.

But thanks for looking. Yes\, hopefully Anton does know >​:)

Yes\, he did. But I don't see a patch happening yet. :-(

Nicholas Clark

p5pRT commented 15 years ago

From @rurban

Kidney Bingos (via RT) schrieb​:

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

Hi\,

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​:

====== ./Configure -de -Dusethreads -Duse64bitint -Dusedevel

Beginning of configuration questions for perl5.

Checking echo to see how to suppress newlines... ...using -n. The star should be here-->*

First let's make sure your kit is complete. Checking... Looks good...

Would you like to see the instructions? [n]

Locating common programs... awk is in /usr/bin/awk. cat is in /bin/cat. chmod is in /bin/chmod. comm is in /usr/bin/comm. cp is in /bin/cp. echo is in /bin/echo. expr is in /bin/expr. grep is in /usr/bin/grep. ls is in /bin/ls. mkdir is in /bin/mkdir. rm is in /bin/rm. sed is in /usr/bin/sed. sort is in /usr/bin/sort. touch is in /usr/bin/touch. tr is in /usr/bin/tr. uniq is in /usr/bin/uniq.

Don't worry if any of the following aren't found... ar is in /usr/bin/ar. I don't see bison out there\, offhand. byacc is in /usr/bin/byacc. cpp is in /usr/bin/cpp. csh is in /bin/csh. date is in /bin/date. egrep is in /usr/bin/egrep. gmake is in /usr/local/bin/gmake. gzip is in /usr/bin/gzip. less is in /usr/bin/less. ln is in /bin/ln. make is in /usr/bin/make. more is in /usr/bin/more. nm is in /usr/bin/nm. nroff is in /usr/bin/nroff. I don't see pg out there\, either. test is in /bin/test. uname is in /usr/bin/uname. I don't see zip out there\, either. Using the test built into your sh.

Checking compatibility between /bin/echo and builtin echo (if any)... They are compatible. In fact\, they may be identical. The following message is sponsored by

Dresden.pm\<--The stars should be here.

Dear Perl user\, system administrator or package maintainer\, the Perl community sends greetings to you. Do you (emblematical) greet back [Y/n]? n

Symbolic links are supported.

Checking how to test for symbolic links... You can test for symbolic links with 'test -h'.

Good\, your tr supports [​:lower​:] and [​:upper​:] to convert case. Using [​:upper​:] and [​:lower​:] to convert case.

First time through\, eh? I have some defaults handy for some systems that need some extra help getting the Configure answers right​:

3b1 dos_djgpp irix_6_0 nonstopux sunos_4_0
aix dragonfly irix_6_1 openbsd sunos_4_1
aix_3 dynix isc opus super-ux
aix_4 dynixptx isc_2 os2 svr4
altos486 epix linux os390 svr5
amigaos esix4 lynxos os400 ti1500
apollo fps machten posix-bc titanos
atheos freebsd machten_2 powerux ultrix_4
aux_3 genix midnightbsd qnx umips
beos gnu mint rhapsody unicos
bsdos gnukfreebsd mips riscos unicosmk
catamount gnuknetbsd mpc sco unisysdynix
convexos greenhills mpeix sco_2_3_0 utekv
cxux hpux ncr_tower sco_2_3_1 uts
cygwin i386 netbsd sco_2_3_2 uwin
darwin interix newsos4 sco_2_3_3 vmesa
dcosx irix_4 next_3 sco_2_3_4 vos
dec_osf irix_5 next_3_0 solaris_2
dgux irix_6 next_4 stellar

You may give one or more space-separated answers\, or "none" if appropriate. If you have a handcrafted Policy.sh file or a Policy.sh file generated by a previous run of Configure\, you may specify it as well as or instead of OS-specific hints. If hints are provided for your OS\, you should use them​: although Perl can probably be built without hints on many platforms\, using hints often improve performance and may enable features that Configure can't set up on its own. If there are no hints that match your OS\, specify "none"; DO NOT give a wrong version or a wrong OS.

Which of these apply\, if any? [freebsd]
./hints/freebsd.sh​: /usr/bin/objformat​: not found

Some users have reported that Configure halts when testing for the O_NONBLOCK symbol with a syntax error. This is apparently a sh error. Rerunning Configure with ksh apparently fixes the problem. Try ksh Configure [your options]

Configure uses the operating system name and version to set some defaults. The default value is probably right if the name rings a bell. Otherwise\, since spelling matters for me\, either accept the default or answer "none" to leave it blank.

Operating system name? [freebsd]

Operating system version? [7.0-release]

By default\, perl5 will be installed in /usr/local/bin\, manual pages under /usr/local/man\, etc...\, i.e. with /usr/local as prefix for all installation directories. Typically this is something like /usr/local. If you wish to have binaries under /usr/bin but other parts of the installation under /usr/local\, that's ok​: you will be prompted separately for each of the installation directories\, the prefix being only used to set the defaults.

Installation prefix to use? (~name ok) [/usr/local]

AFS does not seem to be running...

In some special cases\, particularly when building perl5 for distribution\, it is convenient to distinguish the directory in which files should be installed from the directory (/usr/local) in which they will eventually reside. For most users\, these two directories are the same.

What installation prefix should I use for installing files? (~name ok) [/usr/local]

Perl can be built to use the SOCKS proxy protocol library. To do so\, Configure must be run with -Dusesocks. If you use SOCKS you also need to use the PerlIO abstraction layer\, this will be implicitly selected.

If this doesn't make any sense to you\, just accept the default 'n'. Build Perl for SOCKS? [n]

Previous version of perl5 used the standard IO mechanisms as defined in \<stdio.h>. Versions 5.003_02 and later of perl5 allow alternate IO mechanisms via the PerlIO abstraction layer\, but the stdio mechanism is still available if needed. The abstraction layer can use AT&T's sfio (if you already have sfio installed) or regular stdio. Using PerlIO with sfio may cause problems with some extension modules.

If this doesn't make any sense to you\, just accept the default 'y'. Use the PerlIO abstraction layer? [y]

Getting the current patchlevel... (You have perl5 version 11 subversion 0 patch 34166.)

Perl can be built to take advantage of threads on some systems. To do so\, Configure can be run with -Dusethreads.

Note that Perl built with threading support runs slightly slower and uses more memory than plain Perl. The current implementation is believed to be stable\, but it is fairly new\, and so should be treated with caution.

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.

$ Configure -de -A append​:ld=-lpthread

  -A : manipulate symbol after the platform specific hints have been applied​:   -A append​:symbol=value append value to symbol   -A symbol=value like append​:\, but with a separating space   -A define​:symbol=value define symbol to have value   -A clear​:symbol define symbol to be ''   -A define​:symbol define symbol to be 'define'   -A eval​:symbol=value define symbol to be eval of value   -A prepend​:symbol=value prepend value to symbol   -A undef​:symbol define symbol to be 'undef'   -A undef​:symbol= define symbol to be ''   e.g.​: -A prepend​:libswanted='cl pthread '   -A ccflags=-DSOME_MACRO

I'm also tyring it out right now. I was also pissed that freebsd 7 only has 5.8.8

-- Reini Urban http​://phpwiki.org/ http​://murbreak.at/

p5pRT commented 15 years ago

From @nwc10

On Thu\, Jul 31\, 2008 at 05​:35​:04PM +0200\, Anton Berezin wrote​:

Actually we patch up hints/freebsd.sh 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.

How much more complicated?

Isn't it basically a job of making the changes that FreeBSD ports patch makes run conditionally on the FreeBSD version?

Nicholas Clark

p5pRT commented 15 years ago

From module@renee-baecker.de

This is fixed with Change 34542\, isn't it? Can someone check this?

p5pRT commented 15 years ago

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