Nicholas Clark wrote:

>==== //depot/perl/regcomp.c#340 (text) ====
>
>@@ -4983,9 +4983,14 @@
>                    (SvTYPE(new_comppad) == SVt_PVAV) ?
>                                new_comppad : Null(PAD *)
>                );
>+               OP_REFCNT_LOCK;
>                if (!OpREFCNT_dec((OP_4tree*)r->data->data[n])) {
>+                   OP_REFCNT_UNLOCK;
>                     op_free((OP_4tree*)r->data->data[n]);
>                }
>+               else {
>+                   OP_REFCNT_UNLOCK;
>+               }
> 
>                PAD_RESTORE_LOCAL(old_comppad);
>                SvREFCNT_dec((SV*)new_comppad);
>  
>
The above seems to be the cause of the problem, since now re.dll doesn't 
link:

        link -out:..\..\lib\auto\re\re.dll -dll -nologo -nodefaultlib 
-debug -opt:ref,icf  -libpath:"c:\perl\lib\CORE"  -machine:x86 
re_exec.obj re_comp.obj re.obj   ..\..\lib\CORE\perl59.lib oldnames.lib 
kernel32.lib user32.lib gdi32.lib winspool.lib  comdlg32.lib 
advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib uuid.lib 
ws2_32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib 
msvcrt.lib -def:re.def
   Creating library ..\..\lib\auto\re\re.lib and object 
..\..\lib\auto\re\re.exp

re_comp.obj : error LNK2001: unresolved external symbol __imp__PL_op_mutex
..\..\lib\auto\re\re.dll : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: 'link' : return code '0x460'
Stop.
Unsuccessful make(re): code=512 at buildext.pl line 146.
NMAKE : fatal error U1077: '..\miniperl.exe' : return code '0x2'
Stop.

Reverting the above regcomp.c change fixes things.

Note that ext/re/re_comp.c is copied from regcomp.c, which didn't cause 
any problems when built into the main Perl library.  Likewise, similar 
changes to pad.c and sv.c didn't cause any problem, so I am guessing 
that the use of OP_REFCNT_(UN)LOCK is OK in the core (PERL_CORE?), but 
not within extensions?

So it probably comes down to needing to export PL_op_mutex?

My perl59.lib definitely doesn't have the symbol exported, so how do I 
make that happen (or would that not be the right thing to do anyway)?  
makedef.pl already skips it for non-ithreads builds, but it doesn't seem 
to be getting included for ithreads builds anyway :(

Grepping around a bit, I found an old change for a possibly similar 
problem (19484) which mentions that "PL_op_mutex [...] isn't exported as 
such", but it doesn't elaborate.

- Steve



------------------------------------------------
This email has been scanned for viruses and content by the Radan Computational 
Webshield Appliances.

Reply via email to