diff options
author | 2017-02-05 00:31:51 +0000 | |
---|---|---|
committer | 2017-02-05 00:31:51 +0000 | |
commit | b8851fcc53cbe24fd20b090f26dd149e353f6174 (patch) | |
tree | 4b7c1695865f00ab7a0da30b5632d514848ea3a2 /gnu/usr.bin/perl/lib/ExtUtils | |
parent | Add option PCIVERBOSE. (diff) | |
download | wireguard-openbsd-b8851fcc53cbe24fd20b090f26dd149e353f6174.tar.xz wireguard-openbsd-b8851fcc53cbe24fd20b090f26dd149e353f6174.zip |
Fix merge issues, remove excess files - match perl-5.24.1 dist
Diffstat (limited to 'gnu/usr.bin/perl/lib/ExtUtils')
-rw-r--r-- | gnu/usr.bin/perl/lib/ExtUtils/Embed.pm | 11 | ||||
-rw-r--r-- | gnu/usr.bin/perl/lib/ExtUtils/t/Embed.t | 16 | ||||
-rw-r--r-- | gnu/usr.bin/perl/lib/ExtUtils/typemap | 84 |
3 files changed, 75 insertions, 36 deletions
diff --git a/gnu/usr.bin/perl/lib/ExtUtils/Embed.pm b/gnu/usr.bin/perl/lib/ExtUtils/Embed.pm index 3f983c11832..9305b5dc133 100644 --- a/gnu/usr.bin/perl/lib/ExtUtils/Embed.pm +++ b/gnu/usr.bin/perl/lib/ExtUtils/Embed.pm @@ -10,7 +10,7 @@ use vars qw(@ISA @EXPORT $VERSION use strict; # This is not a dual-life module, so no need for development version numbers -$VERSION = '1.32'; +$VERSION = '1.33'; @ISA = qw(Exporter); @EXPORT = qw(&xsinit &ldopts @@ -350,7 +350,8 @@ This will generate code for linking with C<DynaLoader> and each static extension found in C<$Config{static_ext}>. The code is written to the default file name F<perlxsi.c>. - perl -MExtUtils::Embed -e xsinit -- -o xsinit.c -std DBI DBD::Oracle + perl -MExtUtils::Embed -e xsinit -- -o xsinit.c \ + -std DBI DBD::Oracle Here, code is written for all the currently linked extensions along with code for C<DBI> and C<DBD::Oracle>. @@ -424,9 +425,11 @@ are picked up from the F<extralibs.ld> file in the same directory. perl -MExtUtils::Embed -e ldopts -- -std Socket -This will do the same as the above example, along with printing additional arguments for linking with the C<Socket> extension. +This will do the same as the above example, along with printing additional +arguments for linking with the C<Socket> extension. - perl -MExtUtils::Embed -e ldopts -- -std Msql -- -L/usr/msql/lib -lmsql + perl -MExtUtils::Embed -e ldopts -- -std Msql -- \ + -L/usr/msql/lib -lmsql Any arguments after the second '--' token are additional linker arguments that will be examined for potential conflict. If there is no diff --git a/gnu/usr.bin/perl/lib/ExtUtils/t/Embed.t b/gnu/usr.bin/perl/lib/ExtUtils/t/Embed.t index 4e05cfea41c..59d792115af 100644 --- a/gnu/usr.bin/perl/lib/ExtUtils/t/Embed.t +++ b/gnu/usr.bin/perl/lib/ExtUtils/t/Embed.t @@ -72,21 +72,29 @@ if ($^O eq 'VMS') { push @cmd, "-non_shared"; } - push(@cmd,"-I$inc",ccflags(),'embed_test.c'); + # XXX DAPM 12/2014: ExtUtils::Embed doesn't seem to provide API access + # to $Config{optimize} and so compiles the test code without + # optimisation on optimised perls. This causes the compiler to warn + # when -D_FORTIFY_SOURCE is in force without -O. For now, just strip + # the fortify on optimised builds to avoid the warning. + my $ccflags = ccflags(); + $ccflags =~ s/-D_FORTIFY_SOURCE=\d+// if $Config{optimize} =~ /-O/; + + push(@cmd, "-I$inc", $ccflags, 'embed_test.c'); if ($^O eq 'MSWin32') { $inc = File::Spec->catdir($inc,'win32'); push(@cmd,"-I$inc"); $inc = File::Spec->catdir($inc,'include'); push(@cmd,"-I$inc"); if ($cc eq 'cl') { - push(@cmd,'-link',"-libpath:$lib",$Config{'libperl'},$Config{'libs'}); + push(@cmd,'-link',"-libpath:$lib\\lib\\CORE",$Config{'libperl'},$Config{'libs'}); } else { - push(@cmd,"-L$lib",File::Spec->catfile($lib,$Config{'libperl'}),$Config{'libc'}); + push(@cmd,"-L$lib",$lib.'\lib\CORE\\'.$Config{'libperl'},$Config{'libc'}); } } elsif ($^O eq 'os390' && $Config{usedl}) { - # Nothing for OS/390 (z/OS) dynamic. + push(@cmd,"-L$lib", ldopts()); } else { # Not MSWin32 or OS/390 (z/OS) dynamic. push(@cmd,"-L$lib",'-lperl'); local $SIG{__WARN__} = sub { diff --git a/gnu/usr.bin/perl/lib/ExtUtils/typemap b/gnu/usr.bin/perl/lib/ExtUtils/typemap index 874bc161a80..4bfba95e9e0 100644 --- a/gnu/usr.bin/perl/lib/ExtUtils/typemap +++ b/gnu/usr.bin/perl/lib/ExtUtils/typemap @@ -71,7 +71,7 @@ T_SVREF $var = SvRV(xsub_tmp_sv); } else{ - Perl_croak(aTHX_ \"%s: %s is not a reference\", + Perl_croak_nocontext(\"%s: %s is not a reference\", ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]}, \"$var\"); } @@ -84,7 +84,7 @@ T_SVREF_REFCOUNT_FIXED $var = SvRV(xsub_tmp_sv); } else{ - Perl_croak(aTHX_ \"%s: %s is not a reference\", + Perl_croak_nocontext(\"%s: %s is not a reference\", ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]}, \"$var\"); } @@ -97,7 +97,7 @@ T_AVREF $var = (AV*)SvRV(xsub_tmp_sv); } else{ - Perl_croak(aTHX_ \"%s: %s is not an ARRAY reference\", + Perl_croak_nocontext(\"%s: %s is not an ARRAY reference\", ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]}, \"$var\"); } @@ -110,7 +110,7 @@ T_AVREF_REFCOUNT_FIXED $var = (AV*)SvRV(xsub_tmp_sv); } else{ - Perl_croak(aTHX_ \"%s: %s is not an ARRAY reference\", + Perl_croak_nocontext(\"%s: %s is not an ARRAY reference\", ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]}, \"$var\"); } @@ -123,7 +123,7 @@ T_HVREF $var = (HV*)SvRV(xsub_tmp_sv); } else{ - Perl_croak(aTHX_ \"%s: %s is not a HASH reference\", + Perl_croak_nocontext(\"%s: %s is not a HASH reference\", ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]}, \"$var\"); } @@ -136,7 +136,7 @@ T_HVREF_REFCOUNT_FIXED $var = (HV*)SvRV(xsub_tmp_sv); } else{ - Perl_croak(aTHX_ \"%s: %s is not a HASH reference\", + Perl_croak_nocontext(\"%s: %s is not a HASH reference\", ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]}, \"$var\"); } @@ -149,7 +149,7 @@ T_CVREF SvGETMAGIC(xsub_tmp_sv); $var = sv_2cv(xsub_tmp_sv, &st, &gvp, 0); if (!$var) { - Perl_croak(aTHX_ \"%s: %s is not a CODE reference\", + Perl_croak_nocontext(\"%s: %s is not a CODE reference\", ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]}, \"$var\"); } @@ -162,7 +162,7 @@ T_CVREF_REFCOUNT_FIXED SvGETMAGIC(xsub_tmp_sv); $var = sv_2cv(xsub_tmp_sv, &st, &gvp, 0); if (!$var) { - Perl_croak(aTHX_ \"%s: %s is not a CODE reference\", + Perl_croak_nocontext(\"%s: %s is not a CODE reference\", ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]}, \"$var\"); } @@ -209,7 +209,7 @@ T_PTRREF $var = INT2PTR($type,tmp); } else - Perl_croak(aTHX_ \"%s: %s is not a reference\", + Perl_croak_nocontext(\"%s: %s is not a reference\", ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]}, \"$var\") T_REF_IV_REF @@ -218,7 +218,7 @@ T_REF_IV_REF $var = *INT2PTR($type *, tmp); } else - Perl_croak(aTHX_ \"%s: %s is not of type %s\", + Perl_croak_nocontext(\"%s: %s is not of type %s\", ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]}, \"$var\", \"$ntype\") T_REF_IV_PTR @@ -227,7 +227,7 @@ T_REF_IV_PTR $var = INT2PTR($type, tmp); } else - Perl_croak(aTHX_ \"%s: %s is not of type %s\", + Perl_croak_nocontext(\"%s: %s is not of type %s\", ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]}, \"$var\", \"$ntype\") T_PTROBJ @@ -236,7 +236,7 @@ T_PTROBJ $var = INT2PTR($type,tmp); } else - Perl_croak(aTHX_ \"%s: %s is not of type %s\", + Perl_croak_nocontext(\"%s: %s is not of type %s\", ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]}, \"$var\", \"$ntype\") T_PTRDESC @@ -246,7 +246,7 @@ T_PTRDESC $var = ${type}_desc->ptr; } else - Perl_croak(aTHX_ \"%s: %s is not of type %s\", + Perl_croak_nocontext(\"%s: %s is not of type %s\", ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]}, \"$var\", \"$ntype\") T_REFREF @@ -255,7 +255,7 @@ T_REFREF $var = *INT2PTR($type,tmp); } else - Perl_croak(aTHX_ \"%s: %s is not a reference\", + Perl_croak_nocontext(\"%s: %s is not a reference\", ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]}, \"$var\") T_REFOBJ @@ -264,7 +264,7 @@ T_REFOBJ $var = *INT2PTR($type,tmp); } else - Perl_croak(aTHX_ \"%s: %s is not of type %s\", + Perl_croak_nocontext(\"%s: %s is not of type %s\", ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]}, \"$var\", \"$ntype\") T_OPAQUE @@ -378,7 +378,19 @@ T_PACKEDARRAY T_ARRAY { U32 ix_$var; - EXTEND(SP,size_$var); + SSize_t extend_size = + /* The weird way this is written is because g++ is dumb + * enough to warn "comparison is always false" on something + * like: + * + * sizeof(a) > sizeof(b) && a > B_t_MAX + * + * (where the LH condition is false) + */ + (size_$var > (sizeof(size_$var) > sizeof(SSize_t) + ? SSize_t_MAX : size_$var)) + ? -1 : (SSize_t)size_$var; + EXTEND(SP, extend_size); for (ix_$var = 0; ix_$var < size_$var; ix_$var++) { ST(ix_$var) = sv_newmortal(); DO_ARRAY_ELEM @@ -388,32 +400,48 @@ T_STDIO { GV *gv = newGVgen("$Package"); PerlIO *fp = PerlIO_importFILE($var,0); - if ( fp && do_open(gv, "+<&", 3, FALSE, 0, 0, fp) ) - sv_setsv($arg, sv_bless(newRV((SV*)gv), gv_stashpv("$Package",1))); + if ( fp && do_open(gv, "+<&", 3, FALSE, 0, 0, fp) ) { + SV *rv = newRV_inc((SV*)gv); + rv = sv_bless(rv, GvSTASH(gv)); + ${"$var" eq "RETVAL" ? \"$arg = sv_2mortal(rv);" + : \"sv_setsv($arg, rv);\n\t\tSvREFCNT_dec_NN(rv);"} + }${"$var" ne "RETVAL" ? \" else - $arg = &PL_sv_undef; + sv_setsv($arg, &PL_sv_undef);\n" : \""} } T_IN { GV *gv = newGVgen("$Package"); - if ( do_open(gv, "<&", 2, FALSE, 0, 0, $var) ) - sv_setsv($arg, sv_bless(newRV((SV*)gv), gv_stashpv("$Package",1))); + if ( do_open(gv, "<&", 2, FALSE, 0, 0, $var) ) { + SV *rv = newRV_inc((SV*)gv); + rv = sv_bless(rv, GvSTASH(gv)); + ${"$var" eq "RETVAL" ? \"$arg = sv_2mortal(rv);" + : \"sv_setsv($arg, rv);\n\t\tSvREFCNT_dec_NN(rv);"} + }${"$var" ne "RETVAL" ? \" else - $arg = &PL_sv_undef; + sv_setsv($arg, &PL_sv_undef);\n" : \""} } T_INOUT { GV *gv = newGVgen("$Package"); - if ( do_open(gv, "+<&", 3, FALSE, 0, 0, $var) ) - sv_setsv($arg, sv_bless(newRV((SV*)gv), gv_stashpv("$Package",1))); + if ( do_open(gv, "+<&", 3, FALSE, 0, 0, $var) ) { + SV *rv = newRV_inc((SV*)gv); + rv = sv_bless(rv, GvSTASH(gv)); + ${"$var" eq "RETVAL" ? \"$arg = sv_2mortal(rv);" + : \"sv_setsv($arg, rv);\n\t\tSvREFCNT_dec_NN(rv);"} + }${"$var" ne "RETVAL" ? \" else - $arg = &PL_sv_undef; + sv_setsv($arg, &PL_sv_undef);\n" : \""} } T_OUT { GV *gv = newGVgen("$Package"); - if ( do_open(gv, "+>&", 3, FALSE, 0, 0, $var) ) - sv_setsv($arg, sv_bless(newRV((SV*)gv), gv_stashpv("$Package",1))); + if ( do_open(gv, "+>&", 3, FALSE, 0, 0, $var) ) { + SV *rv = newRV_inc((SV*)gv); + rv = sv_bless(rv, GvSTASH(gv)); + ${"$var" eq "RETVAL" ? \"$arg = sv_2mortal(rv);" + : \"sv_setsv($arg, rv);\n\t\tSvREFCNT_dec_NN(rv);"} + }${"$var" ne "RETVAL" ? \" else - $arg = &PL_sv_undef; + sv_setsv($arg, &PL_sv_undef);\n" : \""} } |