Browse Source

Merge pull request #6623 from pprindeville/perl-5.28.0

perl: update to 5.28
lilik-openwrt-22.03
Philip Prindeville 6 years ago
committed by GitHub
parent
commit
c72a47b80d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 521 additions and 69 deletions
  1. +2
    -2
      lang/perl/Makefile
  2. +22
    -1
      lang/perl/files/base.config
  3. +3
    -3
      lang/perl/files/version.config
  4. +73
    -0
      lang/perl/patches/020-storables-stacksize.patch
  5. +21
    -21
      lang/perl/patches/900-use-rm-force.patch
  6. +0
    -41
      lang/perl/patches/910-miniperl-needs-inc-dot.patch
  7. +399
    -0
      lang/perl/patches/920-fix-no-locale.patch
  8. +1
    -1
      lang/perl/perlmod.mk

+ 2
- 2
lang/perl/Makefile View File

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=perl
PKG_VERSION:=5.26.2
PKG_VERSION:=5.28.0
PKG_RELEASE:=1
PKG_SOURCE_URL:=\
@ -19,7 +19,7 @@ PKG_SOURCE_URL:=\
https://mirrors.sonic.net/cpan/src/5.0 \
https://www.cpan.org/src/5.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_HASH:=0f8c0fb1b0db4681adb75c3ba0dd77a0472b1b359b9e80efd79fc27b4352132c
PKG_HASH:=059b3cb69970d8c8c5964caced0335b4af34ac990c8e61f7e3f90cd1c2d11e49
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_LICENSE_FILES:=Copying Artistic README


+ 22
- 1
lang/perl/files/base.config View File

@ -69,6 +69,7 @@ d_PRIu64='define'
d_PRIx64='define'
d_SCNfldbl='define'
d__fwalk='undef'
d_accept4='define'
d_access='define'
d_accessx='undef'
d_acosh='define'
@ -94,8 +95,11 @@ d_bcopy='define'
d_bsd='undef'
d_bsdgetpgrp='undef'
d_bsdsetpgrp='undef'
d_builtin_add_overflow='define'
d_builtin_choose_expr='define'
d_builtin_expect='undef'
d_builtin_mul_overflow='define'
d_builtin_sub_overflow='define'
d_bzero='define'
d_c99_variadic_macros='define'
d_castneg='define'
@ -143,6 +147,7 @@ d_double_style_ieee='define'
d_double_style_vax='undef'
d_drand48proto='define'
d_dup2='define'
d_dup3='define'
d_duplocale='define'
d_eaccess='undef'
d_endgrent='define'
@ -166,6 +171,7 @@ d_expm1='define'
d_faststdio='undef'
d_fchdir='define'
d_fchmod='define'
d_fchmodat='define'
d_fchown='define'
d_fcntl='define'
d_fcntl_can_lock='define'
@ -282,10 +288,12 @@ d_lgamma_r='define'
d_libm_lib_version='define'
d_libname_unique='undef'
d_link='define'
d_linkat='define'
d_llrint='define'
d_llrintl='define'
d_llround='define'
d_llroundl='define'
d_localeconv_l='undef'
d_localtime64='undef'
d_locconv='define'
d_lockf='define'
@ -309,6 +317,8 @@ d_madvise='define'
d_malloc_good_size='undef'
d_malloc_size='undef'
d_mblen='define'
d_mbrlen='define'
d_mbrtowc='define'
d_mbstowcs='define'
d_mbtowc='define'
d_memchr='define'
@ -316,10 +326,12 @@ d_memcmp='define'
d_memcpy='define'
d_memmem='define'
d_memmove='define'
d_memrchr='undef'
d_memset='define'
d_mkdir='define'
d_mkdtemp='define'
d_mkfifo='define'
d_mkostemp='define'
d_mkstemp='define'
d_mkstemps='undef'
d_mktime='define'
@ -356,11 +368,13 @@ d_old_pthread_create_joinable='undef'
d_oldpthreads='undef'
d_oldsock='undef'
d_open3='define'
d_openat='define'
d_pathconf='define'
d_pause='define'
d_perl_otherlibdirs='undef'
d_phostname='undef'
d_pipe='define'
d_pipe2='define'
d_poll='define'
d_portable='define'
d_prctl='define'
@ -389,6 +403,7 @@ d_regcmp='undef'
d_regcomp='define'
d_remainder='define'
d_remquo='define'
d_renameat='define'
d_rename='define'
d_rewinddir='define'
d_rint='define'
@ -497,9 +512,12 @@ d_strerror_l='define'
d_strftime='define'
d_strlcat='define'
d_strlcpy='define'
d_strnlen='define'
d_strtod='define'
d_strtod_l='define'
d_strtol='define'
d_strtold='define'
d_strtold_l='define'
d_strtoll='define'
d_strtoq='define'
d_strtoul='define'
@ -519,6 +537,7 @@ d_tcsetpgrp='define'
d_telldir='define'
d_telldirproto='define'
d_tgamma='define'
d_thread_safe_nl_langinfo_l='define'
d_time='define'
d_timegm='define'
d_times='define'
@ -532,6 +551,7 @@ d_ualarm='define'
d_umask='define'
d_uname='define'
d_union_semun='undef'
d_unlinkat='define'
d_unordered='undef'
d_unsetenv='define'
d_uselocale='define'
@ -716,6 +736,7 @@ i_values='define'
i_varargs='undef'
i_varhdr='stdarg.h'
i_vfork='undef'
i_wchar='define'
i_xlocale='undef'
ignore_versioned_solibs='y'
inc_version_list=' '
@ -1022,7 +1043,7 @@ full_ar="${owrt:target_cross}ar"
# Tool flags
cppflags="$owrt:cflags"
ccflags="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $owrt:cflags"
ccflags="-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $owrt:cflags"
ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
ccdlflags="-fPIC -rdynamic -Wl,-rpath,$owrt:perllibpath/CORE"
cccdlflags='-fPIC'


+ 3
- 3
lang/perl/files/version.config View File

@ -1,11 +1,11 @@
# Set the version here
PERL_REVISION=5
PERL_VERSION=26
PERL_SUBVERSION=2
PERL_VERSION=28
PERL_SUBVERSION=0
# (api_revison, api_version, api_subversion) = (revision, version, 0) usually
PERL_API_REVISION=5
PERL_API_VERSION=26
PERL_API_VERSION=28
PERL_API_SUBVERSION=0
known_extensions='B Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/Glob Filter/Util/Call GDBM_File Hash/Util I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc NDBM_File ODBM_File Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Text/Soundex Time/HiRes Time/Piece Unicode/Normalize Win32 Win32API/File Win32CORE XS/APItest XS/Typemap attrs re threads threads/shared Hash/Util/FieldHash'


+ 73
- 0
lang/perl/patches/020-storables-stacksize.patch View File

@ -0,0 +1,73 @@
From 682a4acb98783a7f9b5c286b308f12863599fec3 Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Mon, 30 Jul 2018 21:00:52 +1000
Subject: (perl #133411) don't try to load Storable with -Dusecrosscompile
---
dist/Storable/Makefile.PL | 9 ++++++++-
dist/Storable/stacksize | 10 +++++++---
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/dist/Storable/Makefile.PL b/dist/Storable/Makefile.PL
index a5d9e66891..db420ab30b 100644
--- a/dist/Storable/Makefile.PL
+++ b/dist/Storable/Makefile.PL
@@ -90,12 +90,19 @@ sub depend {
# blib.pm needs arch/lib
$extra_deps = ' Storable.pm';
}
+ my $whichperl;
+ if ($Config::Config{usecrosscompile}) {
+ $whichperl = '$(PERLRUN)';
+ }
+ else {
+ $whichperl = '$(FULLPERLRUNINST)';
+ }
my $linktype = uc($_[0]->{LINKTYPE});
my $limit_pm = File::Spec->catfile('lib', 'Storable', 'Limit.pm');
"
$limit_pm : stacksize \$(INST_$linktype)$extra_deps
\$(MKPATH) \$(INST_LIB)
- \$(FULLPERLRUNINST) stacksize $options
+ $whichperl stacksize $options
release : dist
git tag \$(VERSION)
diff --git a/dist/Storable/stacksize b/dist/Storable/stacksize
index 7abd3a84cc..14e0739734 100644
--- a/dist/Storable/stacksize
+++ b/dist/Storable/stacksize
@@ -7,6 +7,9 @@ use Cwd;
use File::Spec;
use strict;
+-d "lib" or mkdir "lib";
+-d "lib/Storable" or mkdir "lib/Storable";
+
my $fn = "lib/Storable/Limit.pm";
my $ptrsize = $Config{ptrsize};
my ($bad1, $bad2) = (65001, 25000);
@@ -29,6 +32,10 @@ sub is_miniperl {
}
if (is_miniperl()) {
+ if ($Config{usecrosscompile}) {
+ write_limits(500, 265);
+ exit;
+ }
die "Should not run during miniperl\n";
}
my $prefix = "";
@@ -68,9 +75,6 @@ if ($ENV{PERL_CORE}) {
}
}
--d "lib" or mkdir "lib";
--d "lib/Storable" or mkdir "lib/Storable";
-
if ($^O eq "MSWin32") {
require Win32;
my ($str, $major, $minor) = Win32::GetOSVersion();
--
2.11.0

+ 21
- 21
lang/perl/patches/900-use-rm-force.patch View File

@ -1,6 +1,6 @@
--- a/Makefile.SH 2017-10-17 11:59:52.938763142 -0600
+++ b/Makefile.SH 2017-10-17 12:13:46.202555604 -0600
@@ -270,6 +270,7 @@ LNS = $lns
@@ -275,6 +275,7 @@ LNS = $lns
# NOTE: some systems don't grok "cp -f". XXX Configure test needed?
CPS = $cp
RMS = rm -f
@ -8,7 +8,7 @@
ranlib = $ranlib
# The following are mentioned only to make metaconfig include the
@@ -731,7 +731,7 @@ bitcount.h: generate_uudmap$(HOST_EXE_EX
@@ -736,7 +737,7 @@ bitcount.h: generate_uudmap$(HOST_EXE_EX
./generate_uudmap$(HOST_EXE_EXT) $(generated_headers)
generate_uudmap$(HOST_EXE_EXT): generate_uudmap$(OBJ_EXT)
@ -17,7 +17,7 @@
$(LNS) $(HOST_GENERATE) generate_uudmap$(HOST_EXE_EXT)
!NO!SUBS!
@@ -871,26 +872,26 @@ mydtrace.h: $(DTRACE_H)
@@ -876,26 +877,26 @@ mydtrace.h: $(DTRACE_H)
define)
$spitshell >>$Makefile <<'!NO!SUBS!'
$(DTRACE_MINI_O): perldtrace.d $(miniperl_objs_nodt)
@ -48,7 +48,7 @@
!NO!SUBS!
;;
@@ -901,13 +902,13 @@ $(LIBPERL): $& $(perllib_dep) $(DYNALOAD
@@ -906,13 +907,13 @@ $(LIBPERL): $& $(perllib_dep) $(DYNALOAD
case "$useshrplib" in
true)
$spitshell >>$Makefile <<'!NO!SUBS!'
@ -64,7 +64,7 @@
mv $@ libperl$(OBJ_EXT)
$(AR) qv $(LIBPERL) libperl$(OBJ_EXT)
!NO!SUBS!
@@ -916,7 +917,7 @@ $(LIBPERL): $& $(perllib_dep) $(DYNALOAD
@@ -921,7 +922,7 @@ $(LIBPERL): $& $(perllib_dep) $(DYNALOAD
;;
*)
$spitshell >>$Makefile <<'!NO!SUBS!'
@ -73,7 +73,7 @@
$(AR) rc $(LIBPERL) $(perllib_objs) $(DYNALOADER)
@$(ranlib) $(LIBPERL)
!NO!SUBS!
@@ -949,7 +950,7 @@ $(MINIPERL_EXE): lib/buildcustomize.pl
@@ -954,7 +955,7 @@ $(MINIPERL_EXE): lib/buildcustomize.pl
amigaos*)
$spitshell >>$Makefile <<'!NO!SUBS!'
lib/buildcustomize.pl: $& $(miniperl_objs) write_buildcustomize.pl
@ -82,7 +82,7 @@
$(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
$(miniperl_objs) $(libs)
# $(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
@@ -987,7 +988,7 @@ NAMESPACEFLAGS = -force_flat_namespace
@@ -992,7 +993,7 @@ NAMESPACEFLAGS = -force_flat_namespace
esac
$spitshell >>$Makefile <<'!NO!SUBS!'
lib/buildcustomize.pl: $& $(miniperl_objs) write_buildcustomize.pl
@ -91,7 +91,7 @@
$(CC) $(CLDFLAGS) $(NAMESPACEFLAGS) -o $(MINIPERL_EXE) \
$(miniperl_objs) $(libs)
$(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
@@ -998,8 +999,8 @@ lib/buildcustomize.pl: $& $(miniperl_obj
@@ -1003,8 +1004,8 @@ lib/buildcustomize.pl: $& $(miniperl_obj
if test "X$hostperl" != X; then
$spitshell >>$Makefile <<!GROK!THIS!
lib/buildcustomize.pl: \$& \$(miniperl_dep) write_buildcustomize.pl
@ -102,7 +102,7 @@
\$(LNS) \$(HOST_PERL) \$(MINIPERL_EXE)
\$(LDLIBPTH) ./miniperl\$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
\$(MINIPERL) -f write_buildcustomize.pl 'osname' "$osname"
@@ -1007,7 +1008,7 @@ lib/buildcustomize.pl: \$& \$(miniperl_d
@@ -1012,7 +1013,7 @@ lib/buildcustomize.pl: \$& \$(miniperl_d
else
$spitshell >>$Makefile <<'!NO!SUBS!'
lib/buildcustomize.pl: $& $(miniperl_dep) write_buildcustomize.pl
@ -111,7 +111,7 @@
$(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
$(miniperl_objs) $(libs)
$(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
@@ -1020,7 +1021,7 @@ lib/buildcustomize.pl: $& $(miniperl_dep
@@ -1025,7 +1026,7 @@ lib/buildcustomize.pl: $& $(miniperl_dep
$spitshell >>$Makefile <<'!NO!SUBS!'
$(PERL_EXE): $& $(perlmain_dep) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT) write_buildcustomize.pl
@ -120,8 +120,8 @@
!NO!SUBS!
case $osname in
@@ -1114,8 +1115,8 @@ pod/perl5261delta.pod: pod/perldelta.pod
$(LNS) perldelta.pod pod/perl5261delta.pod
@@ -1119,8 +1120,8 @@ pod/perl5280delta.pod: pod/perldelta.pod
$(LNS) perldelta.pod pod/perl5280delta.pod
extra.pods: $(MINIPERL_EXE)
- -@test ! -f extra.pods || rm -f `cat extra.pods`
@ -131,7 +131,7 @@
-@for x in `grep -l '^=[a-z]' README.* | grep -v README.vms` ; do \
nx=`echo $$x | sed -e "s/README\.//"`; \
$(LNS) ../$$x "pod/perl"$$nx".pod" ; \
@@ -1332,11 +1333,11 @@ realclean: _realcleaner _mopup
@@ -1340,11 +1341,11 @@ realclean: _realcleaner _mopup
@echo "Note that '$(MAKE) realclean' does not delete config.sh or Policy.sh"
_clobber:
@ -148,7 +148,7 @@
clobber: _realcleaner _mopup _clobber
@@ -1344,23 +1345,23 @@ distclean: clobber
@@ -1352,23 +1353,23 @@ distclean: clobber
# Like distclean but also removes emacs backups and *.orig.
veryclean: _verycleaner _mopup _clobber
@ -183,7 +183,7 @@
-cd pod; $(LDLIBPTH) $(MAKE) $(CLEAN)
-cd utils; $(LDLIBPTH) $(MAKE) $(CLEAN)
-@if test -f $(MINIPERL_EXE) ; then \
@@ -1370,31 +1371,31 @@ _cleaner1:
@@ -1378,31 +1379,31 @@ _cleaner1:
else \
sh $(CLEAN).sh ; \
fi
@ -233,7 +233,7 @@
-rmdir lib/version lib/threads lib/inc/ExtUtils lib/inc lib/encoding
-rmdir lib/autodie/exception lib/autodie/Scope lib/autodie lib/XS
-rmdir lib/Win32API lib/VMS lib/Unicode/Collate/Locale
@@ -1443,11 +1444,11 @@ _realcleaner:
@@ -1452,11 +1453,11 @@ _realcleaner:
_verycleaner:
@$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=veryclean
@$(LDLIBPTH) $(MAKE) _cleaner2
@ -247,16 +247,16 @@
lint $(lintflags) -DPERL_CORE -D_REENTRANT -DDEBUGGING -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(c)
cscopeflags = -Rb # Recursive, build-only.
@@ -1505,7 +1506,7 @@ case "$targethost" in
@@ -1514,7 +1515,7 @@ case "$targethost" in
'') $spitshell >>$Makefile <<'!NO!SUBS!'
test_prep test-prep: test_prep_pre $(MINIPERL_EXE) $(unidatafiles) $(PERL_EXE) \
$(dynamic_ext) $(TEST_PERL_DLL) runtests $(generated_pods)
$(dynamic_ext) $(TEST_PERL_DLL) runtests $(generated_pods) common_build
- cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE))
+ cd t && ($(RMS) $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE))
!NO!SUBS!
;;
@@ -1555,7 +1556,7 @@ test_prep test-prep: test_prep_pre \$(MI
@@ -1564,7 +1565,7 @@ test_prep test-prep: test_prep_pre \$(MI
$to config.sh
# --- For lib/diagnostics.t with -Duseshrplib
$to \$(PERL_EXE)
@ -265,7 +265,7 @@
$to t/\$(PERL_EXE)
!GROK!THIS!
@@ -1565,7 +1566,7 @@ esac
@@ -1574,7 +1575,7 @@ esac
$spitshell >>$Makefile <<'!NO!SUBS!'
test_prep_reonly: $(MINIPERL_EXE) $(PERL_EXE) $(dynamic_ext_re) $(TEST_PERL_DLL)
$(MINIPERL) make_ext.pl $(dynamic_ext_re) MAKE="$(MAKE)" LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic
@ -274,7 +274,7 @@
!NO!SUBS!
case "$targethost" in
@@ -1620,7 +1621,7 @@ minitest_prep:
@@ -1629,7 +1630,7 @@ minitest_prep:
@echo "You may see some irrelevant test failures if you have been unable"
@echo "to build lib/Config.pm, or the Unicode data files."
@echo " "


+ 0
- 41
lang/perl/patches/910-miniperl-needs-inc-dot.patch View File

@ -37,44 +37,3 @@
$(MINIPERL) -f write_buildcustomize.pl
!NO!SUBS!
fi
--- a/cpan/Devel-PPPort/PPPort_pm.PL 2017-07-18 16:59:59.000000000 -0600
+++ b/cpan/Devel-PPPort/PPPort_pm.PL 2017-10-15 19:19:27.341543182 -0600
@@ -15,6 +15,7 @@
use strict;
$^W = 1;
+push(@INC, '.');
require "parts/ppptools.pl";
my $INCLUDE = 'parts/inc';
--- a/cpan/Devel-PPPort/ppport_h.PL 2017-07-18 16:59:59.000000000 -0600
+++ b/cpan/Devel-PPPort/ppport_h.PL 2017-10-15 19:27:16.594178623 -0600
@@ -14,6 +14,7 @@
################################################################################
package Devel::PPPort;
+push(@INC, '.');
require "PPPort.pm";
rename 'ppport.h', 'ppport.old' if -f 'ppport.h';
unlink "ppport.old" if WriteFile("ppport.h") && -f 'ppport.h';
--- a/cpan/Devel-PPPort/PPPort_xs.PL 2017-07-18 16:59:59.000000000 -0600
+++ b/cpan/Devel-PPPort/PPPort_xs.PL 2017-10-15 19:38:09.296679968 -0600
@@ -15,6 +15,7 @@
use strict;
$^W = 1;
+push(@INC, '.');
require "parts/ppptools.pl";
my %SECTION = (
--- a/cpan/Unicode-Collate/Makefile.PL 2017-07-18 16:49:51.000000000 -0600
+++ b/cpan/Unicode-Collate/Makefile.PL 2017-10-15 20:19:31.890439791 -0600
@@ -6,7 +6,7 @@ my $clean = {};
if (-f "Collate.xs") {
print "Making header files for XS...\n";
- do 'mkheader' or die $@ || "mkheader: $!";
+ do './mkheader' or die $@ || "mkheader: $!";
$clean = { FILES => 'ucatbl.h' };
}

+ 399
- 0
lang/perl/patches/920-fix-no-locale.patch View File

@ -0,0 +1,399 @@
commit d36adde059ed1c4f7af210b4f9fc3a7bd2d7d343
Author: Karl Williamson <khw@cpan.org>
Date: Wed May 23 15:32:47 2018 -0600
Fix to compile under -DNO_LOCALE
Several problems with this compile option were not caught before 5.28
was frozen.
diff --git a/embed.fnc b/embed.fnc
index 0f06e38..36f9f97 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -2765,9 +2765,11 @@ s |bool |isa_lookup |NN HV *stash|NN const char * const name \
#endif
#if defined(PERL_IN_LOCALE_C)
+# ifdef USE_LOCALE
sn |const char*|category_name |const int category
s |const char*|switch_category_locale_to_template|const int switch_category|const int template_category|NULLOK const char * template_locale
s |void |restore_switched_locale|const int category|NULLOK const char * const original_locale
+# endif
# ifdef HAS_NL_LANGINFO
sn |const char*|my_nl_langinfo|const nl_item item|bool toggle
# else
diff --git a/embed.h b/embed.h
index cf3ad9e..fb66c26 100644
--- a/embed.h
+++ b/embed.h
@@ -1724,16 +1724,16 @@
#define unshare_hek_or_pvn(a,b,c,d) S_unshare_hek_or_pvn(aTHX_ a,b,c,d)
# endif
# if defined(PERL_IN_LOCALE_C)
-#define category_name S_category_name
-#define restore_switched_locale(a,b) S_restore_switched_locale(aTHX_ a,b)
#define save_to_buffer S_save_to_buffer
-#define switch_category_locale_to_template(a,b,c) S_switch_category_locale_to_template(aTHX_ a,b,c)
# if defined(USE_LOCALE)
+#define category_name S_category_name
#define new_collate(a) S_new_collate(aTHX_ a)
#define new_ctype(a) S_new_ctype(aTHX_ a)
#define new_numeric(a) S_new_numeric(aTHX_ a)
+#define restore_switched_locale(a,b) S_restore_switched_locale(aTHX_ a,b)
#define set_numeric_radix(a) S_set_numeric_radix(aTHX_ a)
#define stdize_locale(a) S_stdize_locale(aTHX_ a)
+#define switch_category_locale_to_template(a,b,c) S_switch_category_locale_to_template(aTHX_ a,b,c)
# if defined(USE_POSIX_2008_LOCALE)
#define emulate_setlocale S_emulate_setlocale
# endif
diff --git a/locale.c b/locale.c
index 7653340..f8f77fb 100644
--- a/locale.c
+++ b/locale.c
@@ -1264,6 +1264,7 @@ S_locking_setlocale(pTHX_
}
#endif
+#ifdef USE_LOCALE
STATIC void
S_set_numeric_radix(pTHX_ const bool use_locale)
@@ -1299,6 +1300,10 @@ S_set_numeric_radix(pTHX_ const bool use_locale)
}
# endif
+#else
+
+ PERL_UNUSED_ARG(use_locale);
+
#endif /* USE_LOCALE_NUMERIC and can find the radix char */
}
@@ -1481,7 +1486,6 @@ S_new_ctype(pTHX_ const char *newctype)
#ifndef USE_LOCALE_CTYPE
- PERL_ARGS_ASSERT_NEW_CTYPE;
PERL_UNUSED_ARG(newctype);
PERL_UNUSED_CONTEXT;
@@ -1994,6 +1998,8 @@ S_new_collate(pTHX_ const char *newcoll)
}
+#endif
+
#ifdef WIN32
STATIC char *
@@ -2139,11 +2145,20 @@ Perl_setlocale(const int category, const char * locale)
{
/* This wraps POSIX::setlocale() */
+#ifdef NO_LOCALE
+
+ PERL_UNUSED_ARG(category);
+ PERL_UNUSED_ARG(locale);
+
+ return "C";
+
+#else
+
const char * retval;
const char * newlocale;
dSAVEDERRNO;
- DECLARATION_FOR_LC_NUMERIC_MANIPULATION;
dTHX;
+ DECLARATION_FOR_LC_NUMERIC_MANIPULATION;
#ifdef USE_LOCALE_NUMERIC
@@ -2262,6 +2277,8 @@ Perl_setlocale(const int category, const char * locale)
return retval;
+#endif
+
}
PERL_STATIC_INLINE const char *
@@ -2414,13 +2431,16 @@ S_my_nl_langinfo(const int item, bool toggle)
dTHX;
const char * retval;
+#ifdef USE_LOCALE_NUMERIC
+
/* We only need to toggle into the underlying LC_NUMERIC locale for these
* two items, and only if not already there */
if (toggle && (( item != RADIXCHAR && item != THOUSEP)
|| PL_numeric_underlying))
- {
+
+#endif /* No toggling needed if not using LC_NUMERIC */
+
toggle = FALSE;
- }
#if defined(HAS_NL_LANGINFO) /* nl_langinfo() is available. */
# if ! defined(HAS_THREAD_SAFE_NL_LANGINFO_L) \
@@ -2468,6 +2488,8 @@ S_my_nl_langinfo(const int item, bool toggle)
do_free = TRUE;
}
+# ifdef USE_LOCALE_NUMERIC
+
if (toggle) {
if (PL_underlying_numeric_obj) {
cur = PL_underlying_numeric_obj;
@@ -2478,6 +2500,8 @@ S_my_nl_langinfo(const int item, bool toggle)
}
}
+# endif
+
/* We have to save it to a buffer, because the freelocale() just below
* can invalidate the internal one */
retval = save_to_buffer(nl_langinfo_l(item, cur),
@@ -5169,9 +5193,7 @@ Perl_my_strerror(pTHX_ const int errnum)
LOCALE_UNLOCK;
# endif /* End of doesn't have strerror_l */
-#endif /* End of does have locale messages */
-
-#ifdef DEBUGGING
+# ifdef DEBUGGING
if (DEBUG_Lv_TEST) {
PerlIO_printf(Perl_debug_log, "Strerror returned; saving a copy: '");
@@ -5179,7 +5201,8 @@ Perl_my_strerror(pTHX_ const int errnum)
PerlIO_printf(Perl_debug_log, "'\n");
}
-#endif
+# endif
+#endif /* End of does have locale messages */
SAVEFREEPV(errstr);
return errstr;
@@ -5301,10 +5324,17 @@ L<C<Perl_switch_to_global_locale>|perlapi/switch_to_global_locale>.
bool
Perl_sync_locale()
{
+
+#ifndef USE_LOCALE
+
+ return TRUE;
+
+#else
+
const char * newlocale;
dTHX;
-#ifdef USE_POSIX_2008_LOCALE
+# ifdef USE_POSIX_2008_LOCALE
bool was_in_global_locale = FALSE;
locale_t cur_obj = uselocale((locale_t) 0);
@@ -5316,11 +5346,11 @@ Perl_sync_locale()
* will affect the */
if (cur_obj == LC_GLOBAL_LOCALE) {
-# ifdef HAS_QUERY_LOCALE
+# ifdef HAS_QUERY_LOCALE
do_setlocale_c(LC_ALL, setlocale(LC_ALL, NULL));
-# else
+# else
unsigned int i;
@@ -5330,17 +5360,17 @@ Perl_sync_locale()
do_setlocale_r(categories[i], setlocale(categories[i], NULL));
}
-# endif
+# endif
was_in_global_locale = TRUE;
}
-#else
+# else
bool was_in_global_locale = TRUE;
-#endif
-#ifdef USE_LOCALE_CTYPE
+# endif
+# ifdef USE_LOCALE_CTYPE
newlocale = savepv(do_setlocale_c(LC_CTYPE, NULL));
DEBUG_Lv(PerlIO_printf(Perl_debug_log,
@@ -5349,8 +5379,8 @@ Perl_sync_locale()
new_ctype(newlocale);
Safefree(newlocale);
-#endif /* USE_LOCALE_CTYPE */
-#ifdef USE_LOCALE_COLLATE
+# endif /* USE_LOCALE_CTYPE */
+# ifdef USE_LOCALE_COLLATE
newlocale = savepv(do_setlocale_c(LC_COLLATE, NULL));
DEBUG_Lv(PerlIO_printf(Perl_debug_log,
@@ -5359,8 +5389,8 @@ Perl_sync_locale()
new_collate(newlocale);
Safefree(newlocale);
-#endif
-#ifdef USE_LOCALE_NUMERIC
+# endif
+# ifdef USE_LOCALE_NUMERIC
newlocale = savepv(do_setlocale_c(LC_NUMERIC, NULL));
DEBUG_Lv(PerlIO_printf(Perl_debug_log,
@@ -5369,9 +5399,12 @@ Perl_sync_locale()
new_numeric(newlocale);
Safefree(newlocale);
-#endif /* USE_LOCALE_NUMERIC */
+# endif /* USE_LOCALE_NUMERIC */
return was_in_global_locale;
+
+#endif
+
}
#if defined(DEBUGGING) && defined(USE_LOCALE)
diff --git a/makedef.pl b/makedef.pl
index dbd756d..661b71d 100644
--- a/makedef.pl
+++ b/makedef.pl
@@ -574,6 +574,9 @@ unless ($define{USE_LOCALE_COLLATE}) {
PL_collxfrm_mult
Perl_sv_collxfrm
Perl_sv_collxfrm_flags
+ PL_strxfrm_NUL_replacement
+ PL_strxfrm_is_behaved
+ PL_strxfrm_max_cp
);
}
@@ -583,6 +586,9 @@ unless ($define{USE_LOCALE_NUMERIC}) {
PL_numeric_name
PL_numeric_radix_sv
PL_numeric_standard
+ PL_numeric_underlying
+ PL_numeric_underlying_is_standard
+ PL_underlying_numeric_obj
);
}
diff --git a/perl.h b/perl.h
index 3e1f6cd..d457776 100644
--- a/perl.h
+++ b/perl.h
@@ -5657,6 +5657,9 @@ typedef struct am_table_short AMTS;
# define IN_LC_COMPILETIME(category) 0
# define IN_LC_RUNTIME(category) 0
# define IN_LC(category) 0
+# define _CHECK_AND_WARN_PROBLEMATIC_LOCALE
+# define _CHECK_AND_OUTPUT_WIDE_LOCALE_UTF8_MSG(s, send)
+# define _CHECK_AND_OUTPUT_WIDE_LOCALE_CP_MSG(c)
#endif
diff --git a/proto.h b/proto.h
index 3e027ab..558c33a 100644
--- a/proto.h
+++ b/proto.h
@@ -4669,8 +4669,6 @@ PERL_CALLCONV SV* Perl_hfree_next_entry(pTHX_ HV *hv, STRLEN *indexp);
assert(hv); assert(indexp)
#endif
#if defined(PERL_IN_LOCALE_C)
-STATIC const char* S_category_name(const int category);
-STATIC void S_restore_switched_locale(pTHX_ const int category, const char * const original_locale);
#ifndef PERL_NO_INLINE_FUNCTIONS
PERL_STATIC_INLINE const char * S_save_to_buffer(const char * string, char **buf, Size_t *buf_size, const Size_t offset)
__attribute__warn_unused_result__;
@@ -4678,17 +4676,19 @@ PERL_STATIC_INLINE const char * S_save_to_buffer(const char * string, char **buf
assert(buf_size)
#endif
-STATIC const char* S_switch_category_locale_to_template(pTHX_ const int switch_category, const int template_category, const char * template_locale);
# if defined(USE_LOCALE)
+STATIC const char* S_category_name(const int category);
STATIC void S_new_collate(pTHX_ const char* newcoll);
STATIC void S_new_ctype(pTHX_ const char* newctype);
#define PERL_ARGS_ASSERT_NEW_CTYPE \
assert(newctype)
STATIC void S_new_numeric(pTHX_ const char* newnum);
+STATIC void S_restore_switched_locale(pTHX_ const int category, const char * const original_locale);
STATIC void S_set_numeric_radix(pTHX_ const bool use_locale);
STATIC char* S_stdize_locale(pTHX_ char* locs);
#define PERL_ARGS_ASSERT_STDIZE_LOCALE \
assert(locs)
+STATIC const char* S_switch_category_locale_to_template(pTHX_ const int switch_category, const int template_category, const char * template_locale);
# if defined(USE_POSIX_2008_LOCALE)
STATIC const char* S_emulate_setlocale(const int category, const char* locale, unsigned int index, const bool is_index_valid);
# endif
diff --git a/sv.c b/sv.c
index 07865bb..81223ca 100644
--- a/sv.c
+++ b/sv.c
@@ -13330,10 +13330,15 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p
SvTAINT(sv);
+#ifdef USE_LOCALE_NUMERIC
+
if (lc_numeric_set) {
RESTORE_LC_NUMERIC(); /* Done outside loop, so don't have to
save/restore each iteration. */
}
+
+#endif
+
}
/* =========================================================================
diff --git a/t/lib/warnings/regexec b/t/lib/warnings/regexec
index 900dd6e..b9e53c9 100644
--- a/t/lib/warnings/regexec
+++ b/t/lib/warnings/regexec
@@ -215,6 +215,10 @@ Use of \b{} or \B{} for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at -
Use of \b{} or \B{} for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 17.
########
# NAME (?[ ]) in non-UTF-8 locale
+require '../loc_tools.pl';
+unless (locales_enabled()) {
+ print("SKIPPED\n# locales not available\n"),exit;
+}
eval { require POSIX; POSIX->import("locale_h") };
if ($@) {
print("SKIPPED\n# no POSIX\n"),exit;
@@ -229,14 +233,14 @@ setlocale(&POSIX::LC_CTYPE, "C");
":" =~ /(?[ \: ])/;
no warnings 'locale';
EXPECT
-Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 9.
-Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 9.
-Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 10.
-Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 10.
-Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 11.
-Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 11.
-Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 12.
-Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 12.
+Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 13.
+Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 13.
+Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 14.
+Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 14.
+Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 15.
+Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 15.
+Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 16.
+Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 16.
########
# NAME (?[ ]) in UTF-8 locale
require '../loc_tools.pl';

+ 1
- 1
lang/perl/perlmod.mk View File

@ -1,7 +1,7 @@
# This makefile simplifies perl module builds.
#
PERL_VERSION:=5.26
PERL_VERSION:=5.28
# Build environment
HOST_PERL_PREFIX:=$(STAGING_DIR_HOSTPKG)/usr


Loading…
Cancel
Save