# Issues with Threaded perl-5.16 and `PL_thr_key'



## sadsfae (Mar 18, 2014)

Hello,

I'm having issues with some installed ports (namely building vim or the Perl plugin in irc/weechat) after following /usr/ports/UPDATING and switching to threaded Perl, with any associated modules built against Perl complaining about `PL_thr_key'. While everything seems to build besides Vim, usage of Perl related modules fail with the `PL_thr_key' error.
For example, irc/weechat I get: 

```
Error: unable to load plugin "/usr/local/lib/weechat/plugins/perl.so": /usr/local/lib/weechat/plugins/perl.so: Undefined symbol "PL_thr_key"
```

While building editors/vim with Perl support enabled I get:

```
if_perl.c:(.text+0x23f8): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x2404): undefined reference to `Perl_croak_nocontext'
objects/if_perl.o: In function `newWINrv':
if_perl.c:(.text+0x2428): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x246a): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x2487): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x24b5): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x24d2): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0x2504): more undefined references to `PL_thr_key' follow
link.sh: Linking failed
*** [vim] Error code 1
```

I've rebuilt my ports depending on lang/perl5.16 using the following portmaster or portupgrade variations hoping to solve the issue:
`portmaster -r perl5-`
`portupgrade -rfb perl*`
`portmaster -r perl`

I've used `portsnap fetch extract` so I am working with a clean ports structure.

My perl make options are default, using:

```
[X] PERL_64BITINT - Use 64bit integers (on i386)
[X] PTHREADS - Build with -pthread
[X] THREADS - Build threaded perl
[X] USE_PERL - Rewrite links in /usr/bin
```
I have set the following in /etc/make.conf as well to be safe:

```
DEFAULT_VERSIONS= perl5=5.16
```

Are there library issues afoot?  I've tried to be diligent about following /usr/ports/UPDATING.

I am running `portmaster -r perl5-` one more time (after temporarily removing perl support from vim) and I'll swing back and see if I can get vim to build successfully with perl support and weechat to properly load the perl.so without the PL_thr_key issue. I'd really like to avoid running `portmaster -af` or similar to rebuild everything but I must be missing something here.


----------



## sadsfae (Mar 18, 2014)

After running `portmaster -r perl5-` I am still getting the PL_thr_key errors in irc/weechat.

```
= 11:52:30  weechat =!= | Error: unable to load plugin "/usr/local/lib/weechat/plugins/perl.so": /usr/local/lib/weechat/plugins/perl.so: Undefined symbol "PL_thr_key"
```

The following pastebin has the actions performed/upgraded

```
===>>> The following actions were performed:
        Re-installation of perl5-5.16.3_8
        Upgrade of vim-7.4.193_1 to vim-7.4.205_1
        Re-installation of rpm2cpio-1.3_2
        Re-installation of tmake-1.13
        Re-installation of p5-Parse-RecDescent-1.967.009_1
        Re-installation of p5-Mail-Transport-Dbx-0.07
        Re-installation of p5-YAML-Syck-1.27
        Re-installation of p5-Date-Manip-6.34
        Re-installation of p5-Parse-Yapp-1.05
        Re-installation of p5-Object-Realize-Later-0.19
        Re-installation of p5-XML-RegExp-0.04
        Re-installation of p5-MIME-Types-2.04
        Re-installation of p5-Encode-Locale-1.03
        Re-installation of p5-Sub-Name-0.05
        Re-installation of p5-Task-Weaken-1.04
        Re-installation of p5-Algorithm-C3-0.09
        Re-installation of p5-Archive-Zip-1.37
        Re-installation of p5-IO-HTML-1.00
        Re-installation of autoconf213-2.13.000227_6
        Re-installation of p5-HTTP-Date-6.02
        Re-installation of p5-File-Listing-6.04
        Re-installation of p5-Filter-1.49
        Re-installation of p5-LWP-MediaTypes-6.02
        Re-installation of p5-String-ShellQuote-1.04
        Re-installation of p5-Term-ReadKey-2.31
        Re-installation of a2ps-4.13b_5
        Re-installation of p5-Locale-gettext-1.05_3
        Re-installation of p5-XML-NamespaceSupport-1.11
        Re-installation of help2man-1.43.3_1
        Re-installation of p5-XML-SAX-Base-1.08
        Re-installation of p5-XML-SAX-0.99_1
        Re-installation of p5-XML-Filter-BufferText-1.01
        Re-installation of p5-XML-SAX-Writer-0.54
        Re-installation of p5-XSLoader-0.16
        Re-installation of p5-Switch-2.16
        Re-installation of p5-URI-1.60
        Re-installation of texi2html-5.0_1,1
        Re-installation of p5-WWW-RobotRules-6.02
        Re-installation of ipcalc-0.41_2
        Re-installation of p5-Digest-HMAC-1.03
        Re-installation of p5-GSSAPI-0.28
        Re-installation of p5-Math-BigInt-1.997
        Re-installation of p5-Socket-2.013
        Re-installation of p5-Net-SSLeay-1.58
        Re-installation of p5-IO-Socket-IP-0.29
        Re-installation of p5-Convert-ASN1-0.26
        Re-installation of p5-Convert-BinHex-1.123
        Re-installation of p5-CPAN-Meta-YAML-0.012
        Re-installation of p5-ReadLine-Gnu-1.20
        Re-installation of hunspell-1.3.2_4
        Re-installation of p5-Params-Util-1.07
        Re-installation of p5-Class-C3-0.26
        Re-installation of p5-ReadLine-Perl-1.0303_1
        Re-installation of p5-ExtUtils-Depends-0.306
        Re-installation of p5-type1inst-0.6.1_5
        Re-installation of p5-B-Hooks-OP-Check-0.19
        Re-installation of p5-Email-FolderType-0.8.13_1
        Re-installation of p5-Try-Tiny-0.18
        Re-installation of p5-Test-Harness-3.30
        Re-installation of texinfo-5.2.20140216
        Re-installation of p5-Lexical-SealRequireHints-0.007
        Re-installation of p5-bareword-filehandles-0.003
        Re-installation of p5-indirect-0.29
        Re-installation of znc-1.2
        Re-installation of p5-multidimensional-0.011
        Re-installation of p5-strictures-1.005003
        Re-installation of p5-CPAN-Meta-Requirements-2.125
        Re-installation of p5-List-MoreUtils-0.33
        Re-installation of p5-Devel-StackTrace-1.31
        Re-installation of p5-MRO-Compat-0.12
        Re-installation of p5-Encode-2.55
        Re-installation of p5-Package-Stash-XS-0.28
        Re-installation of p5-Error-0.17022
        Re-installation of p5-Dist-CheckConflicts-0.09
        Re-installation of imake-1.0.6_1,1
        Re-installation of p5-Email-Date-Format-1.002
        Re-installation of p5-ExtUtils-MakeMaker-6.90
        Re-installation of p5-File-Which-1.09
        Re-installation of p5-Authen-NTLM-1.09
        Re-installation of p5-Font-AFM-1.20
        Re-installation of p5-Geography-Countries-2009041301
        Re-installation of p5-File-Remove-1.52
        Re-installation of llvm32-3.2_2
        Re-installation of p5-HTML-Tagset-3.20
        Re-installation of p5-ExtUtils-Helpers-0.022
        Re-installation of p5-Eval-Closure-0.11
        Re-installation of p5-Sub-Install-0.927
        Re-installation of p5-HTML-Parser-3.71
        Re-installation of p5-Sys-Hostname-Long-1.4
        Re-installation of glib-2.36.3_2
        Re-installation of p5-Import-Into-1.002001
        Re-installation of doxygen-1.8.3.1_1
        Re-installation of p5-Socket6-0.25_1
        Re-installation of p5-File-Path-Expand-1.02
        Re-installation of p5-IO-Socket-INET6-2.69
        Re-installation of p5-Email-Address-1.90.0
        Re-installation of p5-XML-Parser-2.41_1
        Re-installation of intltool-0.50.2
        Re-installation of p5-libxml-0.08
        Re-installation of p5-Module-Build-0.4205
        Re-installation of p5-IO-String-1.08
        Re-installation of p5-HTML-Tree-5.03
        Re-installation of p5-HTML-Format-2.11_1
        Re-installation of p5-HTTP-Message-6.06_2
        Re-installation of clang32-3.2_3
        Re-installation of p5-Term-ReadLine-Zoid-0.07
        Re-installation of p5-JSON-PP-2.27203
        Re-installation of p5-IO-stringy-2.110
        Re-installation of p5-TimeDate-2.30_1,1
        Re-installation of llvm33-3.3_8
        Re-installation of p5-Mail-Tools-2.13
        Re-installation of p5-MIME-Tools-5.505,2
        Re-installation of p5-User-Identity-0.94
        Re-installation of openpgm-5.2.122
        Re-installation of mc-4.8.11
        Re-installation of junit-4.11
        Re-installation of clang33-3.3_6
        Re-installation of windowmaker-0.95.5_2
        Re-installation of p5-Email-Simple-2.203
        Re-installation of aspell-0.60.6.1_4
        Re-installation of p5-Text-Aspell-0.09_1
        Re-installation of p5-Text-SpellChecker-0.11
        Re-installation of p5-XML-LibXML-2.0108,1
        Re-installation of p5-Package-DeprecationManager-0.13
        Re-installation of p5-Font-TTF-1.04
        Re-installation of p5-PDF-API2-2.021
        Re-installation of p5-ExtUtils-Config-0.007
        Re-installation of p5-ExtUtils-InstallPaths-0.010
        Re-installation of p5-Module-Build-Tiny-0.035
        Re-installation of p5-Class-Method-Modifiers-2.09
        Re-installation of p5-Email-LocalDelivery-1.200
        Re-installation of p5-Role-Tiny-1.003.002
        Re-installation of p5-Locale-libintl-1.23_1
        Re-installation of p5-Net-DNS-0.74_1
        Re-installation of pdfoutline-3.2
        Re-installation of fntsample-3.2_1
        Re-installation of autoconf-2.69
        Re-installation of apache22-2.2.26
        Re-installation of automake-1.14
        Re-installation of glibmm-2.36.2,1
        Re-installation of netpbm-10.35.89
        Re-installation of libxfce4util-4.10.1
        Re-installation of automake14-1.4.6_6
        Re-installation of p5-Email-Abstract-3.006
        Re-installation of p5-Scalar-List-Utils-1.35,1
        Re-installation of p5-Parse-CPAN-Meta-1.44.14
        Re-installation of libexo-0.10.2_2
        Re-installation of hyphen-2.8.6_1
        Re-installation of xfce4-panel-4.10.1
        Re-installation of gtk-doc-1.18_1
        Re-installation of mousepad-0.3.0
        Re-installation of p5-CPAN-Meta-2.140640
        Re-installation of webkit-gtk2-1.8.3_3
        Re-installation of p5-Data-OptList-0.109
        Re-installation of thunar-vfs-1.2.0_5
        Re-installation of p5-Module-Runtime-0.014
        Re-installation of p5-MooX-Types-MooseLike-0.25
        Re-installation of p5-Sub-Exporter-0.987
        Re-installation of p5-Sub-Exporter-Progressive-0.001.011
        Re-installation of p5-Devel-GlobalDestruction-0.12
        Re-installation of p5-Moo-1.004002
        Re-installation of ImageMagick-6.8.0.7_5,1
        Re-installation of p5-XML-SAX-Expat-0.50
        Re-installation of p5-Module-Implementation-0.07
        Re-installation of p5-XML-Simple-2.20
        Re-installation of p5-HTTP-Cookies-6.01
        Re-installation of p5-Package-Stash-0.36
        Re-installation of p5-Class-Load-0.20
        Re-installation of icon-naming-utils-0.8.90_1
        Re-installation of p5-Throwable-0.200009
        Re-installation of foomatic-db-engine-4.0.9,2
        Re-installation of p5-Email-Sender-1.300006
        Re-installation of Thunar-1.6.3_1
        Re-installation of p5-HTTP-Negotiate-6.01
        Re-installation of p5-HTTP-Daemon-6.01
        Re-installation of p5-Class-Load-XS-0.08
        Re-installation of p5-Moose-2.1204,1
        Re-installation of libwpg-0.2.2_1
        Re-installation of p5-Authen-SASL-2.16
        Re-installation of p5-IO-Socket-SSL-1.968
        Re-installation of p5-perl-ldap-0.5800
        Re-installation of p5-Mail-IMAPClient-3.35
        Re-installation of p5-Mail-Box-2.109_1
        Re-installation of p5-Net-SMTP-SSL-1.01_2
        Re-installation of p5-Net-HTTP-6.06
        Re-installation of p5-libwww-6.05
        Re-installation of p5-XML-DOM-1.44
        Re-installation of p5-XML-XQL-0.68
        Re-installation of inkscape-0.48.4_4
        Re-installation of weechat-0.4.3_1
```

I am still receiving an error related to `PL_thr_key' while trying to rebuild editors/vim again while enabling perl support.

```
objects/if_perl.o: In function `boot_VIM':
if_perl.c:(.text+0x4): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x11): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x2a): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x38): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x52): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0x76): more undefined references to `PL_thr_key' follow
objects/if_perl.o: In function `XS_VIBUF_DESTROY':
if_perl.c:(.text+0x597): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x5a3): undefined reference to `Perl_croak_nocontext'
objects/if_perl.o: In function `XS_VIBUF_Append':
if_perl.c:(.text+0x5c3): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x5ce): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x5f0): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x623): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x636): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0x668): more undefined references to `PL_thr_key' follow
objects/if_perl.o: In function `XS_VIBUF_Append':
if_perl.c:(.text+0x902): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x90e): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x914): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x935): undefined reference to `Perl_croak_nocontext'
objects/if_perl.o: In function `XS_VIBUF_Delete':
if_perl.c:(.text+0x953): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x95e): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x97f): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x9ad): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x9bf): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0x9f1): more undefined references to `PL_thr_key' follow
objects/if_perl.o: In function `XS_VIBUF_Delete':
if_perl.c:(.text+0xcdf): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0xce5): undefined reference to `PL_thr_key'
if_perl.c:(.text+0xd06): undefined reference to `Perl_croak_nocontext'
objects/if_perl.o: In function `XS_VIBUF_Set':
if_perl.c:(.text+0xd23): undefined reference to `PL_thr_key'
if_perl.c:(.text+0xd2e): undefined reference to `PL_thr_key'
if_perl.c:(.text+0xd50): undefined reference to `PL_thr_key'
if_perl.c:(.text+0xd83): undefined reference to `PL_thr_key'
if_perl.c:(.text+0xd96): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0xdc8): more undefined references to `PL_thr_key' follow
objects/if_perl.o: In function `XS_VIBUF_Set':
if_perl.c:(.text+0x1041): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x104d): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x1053): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1074): undefined reference to `Perl_croak_nocontext'
objects/if_perl.o: In function `XS_VIBUF_Get':
if_perl.c:(.text+0x1093): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x109e): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x10c1): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x10ec): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x10ff): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0x112c): more undefined references to `PL_thr_key' follow
objects/if_perl.o: In function `XS_VIBUF_Get':
if_perl.c:(.text+0x132b): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x1337): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x133d): undefined reference to `PL_thr_key'
objects/if_perl.o: In function `XS_VIBUF_Name':
if_perl.c:(.text+0x1364): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1374): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1390): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x13b9): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0x13cb): more undefined references to `PL_thr_key' follow
objects/if_perl.o: In function `XS_VIBUF_Name':
if_perl.c:(.text+0x15ac): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x15b6): undefined reference to `Perl_croak_nocontext'
objects/if_perl.o: In function `XS_VIBUF_Count':
if_perl.c:(.text+0x15c4): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x15d4): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x15f0): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1619): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x162b): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0x1655): more undefined references to `PL_thr_key' follow
objects/if_perl.o: In function `XS_VIBUF_Count':
if_perl.c:(.text+0x1796): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x17a0): undefined reference to `Perl_croak_nocontext'
objects/if_perl.o: In function `XS_VIBUF_Number':
if_perl.c:(.text+0x17b4): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x17c4): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x17e0): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1809): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x181b): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0x1845): more undefined references to `PL_thr_key' follow
objects/if_perl.o: In function `XS_VIBUF_Number':
if_perl.c:(.text+0x1989): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x1993): undefined reference to `Perl_croak_nocontext'
objects/if_perl.o: In function `XS_VIWIN_DESTROY':
if_perl.c:(.text+0x19a4): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x19b4): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x19d0): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x19f6): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1a08): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0x1a3a): more undefined references to `PL_thr_key' follow
objects/if_perl.o: In function `XS_VIWIN_DESTROY':
if_perl.c:(.text+0x1b17): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x1b23): undefined reference to `Perl_croak_nocontext'
objects/if_perl.o: In function `XS_VIWIN_Cursor':
if_perl.c:(.text+0x1b34): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1b48): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1b64): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1b90): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1ba2): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0x1bd4): more undefined references to `PL_thr_key' follow
objects/if_perl.o: In function `XS_VIWIN_Cursor':
if_perl.c:(.text+0x1e83): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x1e8f): undefined reference to `Perl_croak_nocontext'
objects/if_perl.o: In function `XS_VIWIN_SetHeight':
if_perl.c:(.text+0x1eaf): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1eba): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1ed6): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1eff): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1f2b): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0x1f3a): more undefined references to `PL_thr_key' follow
objects/if_perl.o: In function `XS_VIWIN_SetHeight':
if_perl.c:(.text+0x20b7): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x20c1): undefined reference to `Perl_croak_nocontext'
objects/if_perl.o: In function `perl_buf_free':
if_perl.c:(.text+0x20df): undefined reference to `PL_thr_key'
objects/if_perl.o: In function `perl_win_free':
if_perl.c:(.text+0x210f): undefined reference to `PL_thr_key'
objects/if_perl.o: In function `newBUFrv':
if_perl.c:(.text+0x2148): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x218a): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x21a7): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0x21d5): more undefined references to `PL_thr_key' follow
objects/if_perl.o: In function `XS_VIWIN_Buffer':
if_perl.c:(.text+0x23f8): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x2404): undefined reference to `Perl_croak_nocontext'
objects/if_perl.o: In function `newWINrv':
if_perl.c:(.text+0x2428): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x246a): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x2487): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x24b5): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x24d2): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0x2504): more undefined references to `PL_thr_key' follow
link.sh: Linking failed
*** [vim] Error code 1
```


----------



## sadsfae (Mar 18, 2014)

Should I try cleaning out things in `/usr/local/include` or shared libraries that might be left over from when lang/perl5.16 was not built with threads?

irc/weechat and others do build perl modules based on the C library _e.g._ when irc/weechat builds it does so successfully
but trying to load the perl.so module is what fails (similar to the vim build failure).

```
Linking C shared module perl.so
[100%] Built target perl
```


----------



## sadsfae (Mar 24, 2014)

I've been able to workaround the weechat perl plugin issue by using Ruby or Lua.
Does anyone else have any ideas?  I'm stuck and not sure what I am doing wrong.


----------



## acheron (Mar 24, 2014)

What does `pkg which /usr/local/lib/weechat/plugins/perl.so` returns? Try to rebuild the port listed in the previous command.


----------



## sadsfae (Mar 25, 2014)

acheron said:
			
		

> What does `pkg which /usr/local/lib/weechat/plugins/perl.so` returns? Try to rebuild the port listed in the previous command.



Thanks for the reply, Acheron.  Rebuilding irc/weechat  still gives the same errors:

```
# pkg which /usr/local/lib/weechat/plugins/perl.so
/usr/local/lib/weechat/plugins/perl.so was installed by package weechat-0.4.3_1
# cd /usr/ports/irc/weechat
# make clean
===>  Cleaning for perl5-5.16.3_8
===>  Cleaning for weechat-0.4.3_1
# portmaster irc/weechat
```

There are still `PL_thr_key' issues afoot:

```
★= 13:41:09     | python scripts loaded: grep, lnotify, otr
 ★= 13:41:09     | lua scripts loaded: launcher
 ★= 13:41:09 =!= | Error: unable to load plugin "/usr/local/lib/weechat/plugins/perl.so": /usr/local/lib/weechat/plugins/perl.so: Undefined symbol "PL_thr_key"
```

Trying to test building editors/vim I still unfortunately get the same issues when building the associated Perl C libraries:

```
if_perl.c:(.text+0x4): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x11): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x2a): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x38): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x52): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0x76): more undefined references to `PL_thr_key' follow
objects/if_perl.o: In function `XS_VIBUF_DESTROY':
if_perl.c:(.text+0x597): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x5a3): undefined reference to `Perl_croak_nocontext'
objects/if_perl.o: In function `XS_VIBUF_Append':
if_perl.c:(.text+0x5c3): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x5ce): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x5f0): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x623): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x636): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0x668): more undefined references to `PL_thr_key' follow
objects/if_perl.o: In function `XS_VIBUF_Append':
if_perl.c:(.text+0x902): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x90e): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x914): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x935): undefined reference to `Perl_croak_nocontext'
objects/if_perl.o: In function `XS_VIBUF_Delete':
if_perl.c:(.text+0x953): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x95e): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x97f): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x9ad): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x9bf): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0x9f1): more undefined references to `PL_thr_key' follow
objects/if_perl.o: In function `XS_VIBUF_Delete':
if_perl.c:(.text+0xcdf): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0xce5): undefined reference to `PL_thr_key'
if_perl.c:(.text+0xd06): undefined reference to `Perl_croak_nocontext'
objects/if_perl.o: In function `XS_VIBUF_Set':
if_perl.c:(.text+0xd23): undefined reference to `PL_thr_key'
if_perl.c:(.text+0xd2e): undefined reference to `PL_thr_key'
if_perl.c:(.text+0xd50): undefined reference to `PL_thr_key'
if_perl.c:(.text+0xd83): undefined reference to `PL_thr_key'
if_perl.c:(.text+0xd96): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0xdc8): more undefined references to `PL_thr_key' follow
objects/if_perl.o: In function `XS_VIBUF_Set':
if_perl.c:(.text+0x1041): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x104d): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x1053): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1074): undefined reference to `Perl_croak_nocontext'
objects/if_perl.o: In function `XS_VIBUF_Get':
if_perl.c:(.text+0x1093): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x109e): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x10c1): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x10ec): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x10ff): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0x112c): more undefined references to `PL_thr_key' follow
objects/if_perl.o: In function `XS_VIBUF_Get':
if_perl.c:(.text+0x132b): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x1337): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x133d): undefined reference to `PL_thr_key'
objects/if_perl.o: In function `XS_VIBUF_Name':
if_perl.c:(.text+0x1364): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1374): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1390): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x13b9): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0x13cb): more undefined references to `PL_thr_key' follow
objects/if_perl.o: In function `XS_VIBUF_Name':
if_perl.c:(.text+0x15ac): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x15b6): undefined reference to `Perl_croak_nocontext'
objects/if_perl.o: In function `XS_VIBUF_Count':
if_perl.c:(.text+0x15c4): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x15d4): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x15f0): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1619): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x162b): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0x1655): more undefined references to `PL_thr_key' follow
objects/if_perl.o: In function `XS_VIBUF_Count':
if_perl.c:(.text+0x1796): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x17a0): undefined reference to `Perl_croak_nocontext'
objects/if_perl.o: In function `XS_VIBUF_Number':
if_perl.c:(.text+0x17b4): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x17c4): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x17e0): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1809): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x181b): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0x1845): more undefined references to `PL_thr_key' follow
objects/if_perl.o: In function `XS_VIBUF_Number':
if_perl.c:(.text+0x1989): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x1993): undefined reference to `Perl_croak_nocontext'
objects/if_perl.o: In function `XS_VIWIN_DESTROY':
if_perl.c:(.text+0x19a4): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x19b4): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x19d0): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x19f6): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1a08): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0x1a3a): more undefined references to `PL_thr_key' follow
objects/if_perl.o: In function `XS_VIWIN_DESTROY':
if_perl.c:(.text+0x1b17): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x1b23): undefined reference to `Perl_croak_nocontext'
objects/if_perl.o: In function `XS_VIWIN_Cursor':
if_perl.c:(.text+0x1b34): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1b48): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1b64): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1b90): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1ba2): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0x1bd4): more undefined references to `PL_thr_key' follow
objects/if_perl.o: In function `XS_VIWIN_Cursor':
if_perl.c:(.text+0x1e83): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x1e8f): undefined reference to `Perl_croak_nocontext'
objects/if_perl.o: In function `XS_VIWIN_SetHeight':
if_perl.c:(.text+0x1eaf): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1eba): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1ed6): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1eff): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x1f2b): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0x1f3a): more undefined references to `PL_thr_key' follow
objects/if_perl.o: In function `XS_VIWIN_SetHeight':
if_perl.c:(.text+0x20b7): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x20c1): undefined reference to `Perl_croak_nocontext'
objects/if_perl.o: In function `perl_buf_free':
if_perl.c:(.text+0x20df): undefined reference to `PL_thr_key'
objects/if_perl.o: In function `perl_win_free':
if_perl.c:(.text+0x210f): undefined reference to `PL_thr_key'
objects/if_perl.o: In function `newBUFrv':
if_perl.c:(.text+0x2148): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x218a): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x21a7): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0x21d5): more undefined references to `PL_thr_key' follow
objects/if_perl.o: In function `XS_VIWIN_Buffer':
if_perl.c:(.text+0x23f8): undefined reference to `Perl_croak_nocontext'
if_perl.c:(.text+0x2404): undefined reference to `Perl_croak_nocontext'
objects/if_perl.o: In function `newWINrv':
if_perl.c:(.text+0x2428): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x246a): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x2487): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x24b5): undefined reference to `PL_thr_key'
if_perl.c:(.text+0x24d2): undefined reference to `PL_thr_key'
objects/if_perl.o:if_perl.c:(.text+0x2504): more undefined references to `PL_thr_key' follow
link.sh: Linking failed
*** [vim] Error code 1
```


----------

