Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 4770653

Browse files
author
Reini Urban
committed
B-C: updated from 1.54_05 to 1.54_08
Many Windows and cygwin fixes, for the old MSVC compiler, and PERL_CORE test integration. Use many new core exports needed for windows. Update perlcc to 2.21, handle multiple -I and -L arguments. Handle cperl OP_SIGNATURE for 5.24. Fix refcount of cop hints hashes with 5.22-nt L<[cperl #220]|#220> Better UVX L and U suffices. Handle shared IV and UV xpv structs, fixed 5.24 specific assertions, with shared xpviv/xpvuv. fixed wrong 32 bit ptr offset. re-enabled all 32bit tests. Handle changed subdirs-test target with newer EUMM.
1 parent 5b5c359 commit 4770653

File tree

21 files changed

+732
-244
lines changed

21 files changed

+732
-244
lines changed

cpan/B-C/ByteLoader/ByteLoader.xs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ MODULE = ByteLoader PACKAGE = ByteLoader
149149
PROTOTYPES: ENABLE
150150

151151
void
152-
import(package="ByteLoader", ...)
153-
char *package
152+
import(...)
154153
PREINIT:
155154
SV *sv = newSVpvn ("", 0);
156155
PPCODE:

cpan/B-C/ByteLoader/Makefile.PL

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ sub MY::depend {
3434
ByteLoader.pm \$(INST_LIB)/ByteLoader.pm
3535
3636
byterun.c : $bytecode_pl Makefile bytecode.h
37-
cd $up && \$(PERL) bytecode.pl && cd ByteLoader
37+
cd $up && \$(MAKE) \$(USEMAKEFILE) \$(FIRST_MAKEFILE) ByteLoader/byterun.c \$(PASTHRU)
3838
3939
byterun.h : $bytecode_pl Makefile
40-
cd $up && \$(PERL) bytecode.pl && cd ByteLoader
40+
cd $up && \$(MAKE) \$(USEMAKEFILE) \$(FIRST_MAKEFILE) ByteLoader/byterun.h \$(PASTHRU)
4141
4242
ByteLoader.c: byterun.h Makefile
4343

cpan/B-C/ByteLoader/bytecode.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ typedef U16 pmflags;
1313
#else
1414
typedef U32 pmflags;
1515
#endif
16-
16+
#if PERL_VERSION < 10
17+
typedef U32 SVTYPE_t;
18+
#else
19+
typedef svtype SVTYPE_t;
20+
#endif
1721

1822
static int force = 0;
1923
/* need to swab bytes to the target byteorder */
@@ -233,7 +237,7 @@ static int bget_swab = 0;
233237
BSET_OBJ_STOREX(sv); \
234238
} STMT_END
235239
#define BSET_gv_fetchpvn_flags(sv, arg) STMT_START { \
236-
int flags = (arg & 0xff80) >> 7; int type = arg & 0x7f; \
240+
int flags = (arg & 0xff80) >> 7; SVTYPE_t type = (SVTYPE_t)(arg & 0x7f); \
237241
sv = (SV*)gv_fetchpv(savepv(bstate->bs_pv.pv), flags, type); \
238242
BSET_OBJ_STOREX(sv); \
239243
} STMT_END
@@ -271,7 +275,7 @@ static int bget_swab = 0;
271275
(mg->mg_ptr = (char*)SvREFCNT_inc((SV*)arg), \
272276
mg->mg_len = HEf_SVKEY)
273277
#define BSET_xmg_stash(sv, arg) *(SV**)&(((XPVMG*)SvANY(sv))->xmg_stash) = (arg)
274-
#define BSET_sv_upgrade(sv, arg) (void)SvUPGRADE(sv, arg)
278+
#define BSET_sv_upgrade(sv, arg) (void)SvUPGRADE(sv, (SVTYPE_t)arg)
275279
#define BSET_xrv(sv, arg) SvRV_set(sv, arg)
276280
#define BSET_xpv(sv) do { \
277281
SvPV_set(sv, bstate->bs_pv.pv); \
@@ -426,7 +430,6 @@ static int bget_swab = 0;
426430
? CALLREGCOMP(aTHX_ arg, arg + bstate->bs_pv.cur, ((PMOP*)o)) : 0
427431
#endif
428432

429-
430433
#define BSET_newsv(sv, arg) \
431434
switch(arg) { \
432435
case SVt_PVAV: \
@@ -437,7 +440,7 @@ static int bget_swab = 0;
437440
break; \
438441
default: \
439442
sv = newSV(0); \
440-
SvUPGRADE(sv, (arg)); \
443+
SvUPGRADE(sv, (SVTYPE_t)(arg)); \
441444
} \
442445
SvREFCNT(sv) = 1
443446
#define BSET_newsvx(sv, arg) STMT_START { \

cpan/B-C/C.xs

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,8 @@ aux_list_thr(o)
353353
bool last = 0;
354354
bool is_hash = FALSE;
355355

356-
EXTEND(SP, len);
356+
assert(len <= SSize_t_MAX);
357+
EXTEND(SP, (SSize_t)len);
357358
mPUSHu(actions);
358359

359360
while (!last) {
@@ -434,6 +435,69 @@ aux_list_thr(o)
434435
XSRETURN(len);
435436

436437
} /* OP_MULTIDEREF */
438+
#if PERL_VERSION > 23 && defined(OP_SIGNATURE)
439+
case OP_SIGNATURE:
440+
{
441+
UNOP_AUX_item *items = cUNOP_AUXo->op_aux;
442+
UV len = items[-1].uv;
443+
UV actions = items[1].uv;
444+
445+
assert(len <= SSize_t_MAX);
446+
EXTEND(SP, (SSize_t)len);
447+
mPUSHu(items[0].uv);
448+
mPUSHu(actions);
449+
items++;
450+
451+
while (1) {
452+
switch (actions & SIGNATURE_ACTION_MASK) {
453+
454+
case SIGNATURE_reload:
455+
actions = (++items)->uv;
456+
mPUSHu(actions);
457+
continue;
458+
459+
case SIGNATURE_end:
460+
goto finish;
461+
462+
case SIGNATURE_padintro:
463+
mPUSHu((++items)->uv);
464+
break;
465+
466+
case SIGNATURE_arg:
467+
case SIGNATURE_arg_default_none:
468+
case SIGNATURE_arg_default_undef:
469+
case SIGNATURE_arg_default_0:
470+
case SIGNATURE_arg_default_1:
471+
case SIGNATURE_arg_default_op:
472+
case SIGNATURE_array:
473+
case SIGNATURE_hash:
474+
break;
475+
476+
case SIGNATURE_arg_default_iv:
477+
mPUSHu((++items)->iv);
478+
break;
479+
480+
case SIGNATURE_arg_default_const:
481+
PUSH_SV(++items);
482+
break;
483+
484+
case SIGNATURE_arg_default_padsv:
485+
mPUSHu((++items)->pad_offset);
486+
break;
487+
488+
case SIGNATURE_arg_default_gvsv:
489+
PUSH_SV(++items);
490+
break;
491+
492+
} /* switch */
493+
494+
actions >>= SIGNATURE_SHIFT;
495+
} /* while */
496+
finish:
497+
XSRETURN(len);
498+
499+
} /* OP_SIGNATURE */
500+
#endif
437501
} /* switch */
438502

439503
#endif

cpan/B-C/Makefile.PL

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ unless (-e 'lib/B/C/Config.pm') {
1717
# my $X = $^X =~ / / ? qq("$^X") : $^X;
1818
if ($CORE) {
1919
$ENV{PERL_CORE} = 1;
20-
system($^X,"-I".File::Spec->catfile(qw(.. .. regen)),
21-
"-I".File::Spec->catfile(qw(.. .. lib)),
20+
system($^X,"-I".File::Spec->catfile(qw(.. .. lib)),
21+
"-I".File::Spec->catfile(qw(.. .. regen)),
2222
"bytecode.pl");
2323
} else {
2424
my $asmdata = File::Spec->catfile('lib', 'B', 'Asmdata.pm');
@@ -167,7 +167,7 @@ WriteMakefile(
167167
NAME => "B::C",
168168
VERSION_FROM => "lib/B/C.pm",
169169
PL_FILES => { $perlcc.'.PL' => $perlcc },
170-
EXE_FILES => [qw(script/perlcc script/cc_harness script/assemble script/disassemble)],
170+
EXE_FILES => [$perlcc, qw(script/cc_harness script/assemble script/disassemble)],
171171
PREREQ_PM => {'Opcodes' => '0', # optional
172172
'IPC::Run' => '0', # optional
173173
'B::Flags' => '0.15', # optional
@@ -432,19 +432,25 @@ sub depend {
432432
my $byterun_h = File::Spec->catfile('ByteLoader', 'byterun.h');
433433
my $result = "
434434
$asmdata : Makefile bytecode.pl @headers
435-
\$(PERL) bytecode.pl
435+
\$(PERLRUN) bytecode.pl
436436
437437
$byterun_c : Makefile bytecode.pl @headers
438-
\$(PERL) bytecode.pl
438+
\$(PERLRUN) bytecode.pl
439439
440440
$byterun_h : Makefile bytecode.pl @headers
441-
\$(PERL) bytecode.pl
441+
\$(PERLRUN) bytecode.pl
442442
443443
TAGS : $asmdata
444444
etags --language=perl lib/B/*.pm
445445
";
446-
if ($] > 5.009) {
447-
$result .= "\ntest :: subdirs-test\n\n";
446+
if ($] > 5.009 and defined($ExtUtils::MM_Unix::VERSION)) {
447+
my $ver = $ExtUtils::MM_Unix::VERSION;
448+
# 8.0403 is the cperl 5.24.0 version based on 7.04_03
449+
if ($ver eq '8.0403' or $ver lt '7.0509') {
450+
$result .= "\ntest :: subdirs-test\n\n";
451+
} else {
452+
$result .= "\ntest :: subdirs-test_\$(LINKTYPE)\n\n";
453+
}
448454
}
449455
if ($Config{make} eq 'mingw32-make') { # mingw32 make different to msys make
450456
$result .= "\n.PHONY : \$(CONFIGDEP)\n\n";

cpan/B-C/bytecode.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,8 +581,10 @@ package B::Asmdata;
581581
# endif
582582
583583
# ifdef HAS_QUAD
584+
# if PERL_VERSION < 24
584585
typedef I64TYPE I64;
585586
typedef U64TYPE U64;
587+
# endif
586588
# if INTSIZE >= 8
587589
# define U64_CONST(x) ((U64)x##U)
588590
# elif LONGSIZE >= 8

0 commit comments

Comments
 (0)