Como faço para compilar o Perl 5.10 com o suporte do thread no FreeBSD 7.1?
-
03-07-2019 - |
Pergunta
Estou tentando compilar o Perl 5.10 no meu servidor FreeBSD 7.1 (BSD), mas quando executo o script de configuração e respondo às perguntas, recebo o seguinte erro:
...POSTIX threads should be supported by FreeBSD 7.1 ... but your system is missing the shared libc_r.
Pesquisando a resposta surgiu com a instalação do Gethostnamadr.C, o que é bom, exceto por duas coisas:
- Não sei onde colocar este arquivo e
- Como isso resolve meu problema se a configuração deseja ver libc_r?
Solução
Para ativar os threads Perl 5.10 no FreeBSD 7.* Tudo o que você precisa fazer é aplicar o seguinte patch usando patch
. Você pode então construir Perl com -DuseThreads ou responder ao Configure
Arquive as perguntas para ativar a rosqueamento e você estará pronto. Ainda não fiz testes ou comparações significativas, mas tudo compila bem, incluindo o Libs Thread e todos os meus programas Perl funcionam bem.
--- hints/freebsd.sh 2008/10/20 04:59:30 1.1
+++ hints/freebsd.sh 2008/10/20 22:49:29
@@ -211,6 +211,14 @@
exit 1
;;
+ 7.*)
+ # 7.x doesn't install libc_r by default, and Configure
+ # would fail in the code following
+ #
+ # gethostbyaddr_r() appears to have been implemented in 6.x+
+ ldflags="-pthread $ldflags"
+ ;;
+
*)
if [ ! -r "$lc_r" ]; then
cat <<EOM >&4
Edit: esqueci minha referência; Verifique aqui mais informações: http://www.gossamer-threads.com/lists/perl/porters/232518?nohighlight=1#232518.
Outras dicas
Contrary to Spolsky who said "perl is pretty much forgotten"... perl is very much alive.
You have not indicated which version of FreeBSD you have installed... But assuming that you have installed a min of FreeBSD 7.1 then you failed to install the threads libraries or the thread libs are not in the library path.
NOTE that libc is a general 'c' library and that libc_r is the thread-safe version of that file. Some of the 2005 google results suggest that libc_r has been deprecated.
With that in mind it is likely that you are in the middle of a "revision collision". Sadly FreeBSD does not provide the thread safe version of perl natively, however, they do package perl 5.10 and several later revisions. I found this link to be useful:
http://www.nabble.com/How---where-to-get-a-Perl-that-has-threads--td22270858.html
you might also want to try installing the p5-fork library which is included with FreeBSD
http://www.nabble.com/How---where-to-get-a-Perl-that-has-threads--td22270858.html