diff --git a/plan9/aperl b/plan9/aperl index 4d032e3c3d..b260973989 100644 --- a/plan9/aperl +++ b/plan9/aperl @@ -3,5 +3,6 @@ # aperl: # Executes perl command and alters stderr to produce Acme-friendly error messages # Created 02-JUL-1996, Luther Huffman, lutherh@stratcom.com +# Modified May 2020, David Romano, unobe@cpan.org -/bin/perl $* |[2] /bin/perl -pe 's/ line (\d+)/:$1/' >[1=2] +/bin/perl-_P9P_VERSION $* |[2] /bin/perl-_P9P_VERSION -pe 's/ line (\d+)/:$1/' >[1=2] diff --git a/plan9/config.plan9 b/plan9/config.plan9 index edd09a6e37..90f0b82650 100644 --- a/plan9/config.plan9 +++ b/plan9/config.plan9 @@ -2,10 +2,10 @@ * This file is mangled by fndvers (and perhaps other scripts) to produce * the config.h for Plan 9. It was handwritten because the standard * configuration scripts were written in a shell dialect incomprehensible - * to Plan 9. + * to Plan 9. * config.h for Plan 9 - * Version: 5.8.0 - */ + * Version: 5.8.9 + */ /* Configuration time: 21-Oct-1996 15:11 * Configured by: Luther Huffman, lutherh@stratcom.com @@ -21,16 +21,38 @@ #ifndef _config_h_ #define _config_h_ +/* CHARBITS: + * This symbol contains the size of a char, so that the C preprocessor + * can make decisions based on it. + */ +#define CHARBITS 8 /**/ + + /* CAT2: * This macro catenates 2 tokens together. */ -#define CAT2(a,b)a ## b +#if 42 == 1 +#define CAT2(a,b) a/**/b +#define STRINGIFY(a) "a" + /* If you can get stringification with catify, tell me how! */ +#endif +#if 42 == 42 +#define PeRl_CaTiFy(a, b) a ## b +#define PeRl_StGiFy(a) #a +/* the additional level of indirection enables these macros to be + * used as arguments to other macros. See K&R 2nd ed., page 231. */ +#define CAT2(a,b) PeRl_CaTiFy(a,b) +#define StGiFy(a) PeRl_StGiFy(a) +#define STRINGIFY(a) PeRl_StGiFy(a) +#endif +#if 42 != 1 && 42 != 42 +# include "Bletch: How does this C preprocessor catenate tokens?" +#endif + #define CAT3(a,b,c)a ## b ## c #define CAT4(a,b,c,d)a ## b ## c ## d #define CAT5(a,b,c,d,e)a ## b ## c ## d ## e -#define StGiFy(a)# a -#define STRINGIFY(a)StGiFy(a) #define SCAT2(a,b)StGiFy(a) StGiFy(b) #define SCAT3(a,b,c)StGiFy(a) StGiFy(b) StGiFy(c) #define SCAT4(a,b,c,d)StGiFy(a) StGiFy(b) StGiFy(c) StGiFy(d) @@ -52,16 +74,22 @@ # endif #endif -/* BIN: - * This symbol holds the path of the bin directory where the package will - * be installed. Program must be prepared to deal with ~name substitution. - */ -/* BIN_EXP: - * This symbol is the filename expanded version of the BIN symbol, for - * programs that do not want to deal with that at run-time. +/* BYTEORDER: + * This symbol holds the hexadecimal constant defined in byteorder, + * in a UV, i.e. 0x1234 or 0x4321 or 0x12345678, etc... + * If the compiler supports cross-compiling or multiple-architecture + * binaries (eg. on NeXT systems), use compiler-defined macros to + * determine the byte order. + * On NeXT 3.2 (and greater), you can build "Fat" Multiple Architecture + * Binaries (MAB) on either big endian or little endian machines. + * The endian-ness is available at compile-time. This only matters + * for perl, where the config.h can be generated and installed on + * one system, and used by a different architecture to build an + * extension. Older versions of NeXT that might not have + * defined either *_ENDIAN__ were all on Motorola 680x0 series, + * so the default case (for NeXT) is big endian to catch them. + * This might matter for NeXT 3.0. */ -#define BIN "/_P9P_OBJTYPE/bin" /* */ -#define BIN_EXP "/_P9P_OBJTYPE/bin" /* */ /* LOC_SED: * This symbol holds the complete pathname to the sed program. @@ -239,7 +267,7 @@ #define HAS_GETLOGIN /**/ /* HAS_GETPGID: - * This symbol, if defined, indicates to the C program that + * This symbol, if defined, indicates to the C program that * the getpgid(pid) function is available to get the * process group id. */ @@ -771,7 +799,7 @@ /*#define I_MEMORY / **/ /* I_NET_ERRNO: - * This symbol, if defined, indicates that exists and + * This symbol, if defined, indicates that exists and * should be included. */ /*#define I_NET_ERRNO /* config-skip */ @@ -1008,17 +1036,6 @@ */ #define PLAN9 /**/ -/* MEM_ALIGNBYTES: - * This symbol contains the number of bytes required to align a - * double, or a long double when applicable. Usual values are 2, - * 4 and 8. The default is eight, for safety. - */ -#if defined(MULTIARCH) -# define MEM_ALIGNBYTES 8 -#else -#define MEM_ALIGNBYTES 4 -#endif - /* ARCHLIB: * This variable, if defined, holds the name of the directory in * which the user wants to put architecture-dependent public @@ -1063,8 +1080,8 @@ * This symbol is the filename expanded version of the BIN symbol, for * programs that do not want to deal with that at run-time. */ -#define BIN "/usr/bin" /**/ -#define BIN_EXP "/usr/bin" /**/ +#define BIN "/_P9P_OBJTYPE/bin" /* */ +#define BIN_EXP "/_P9P_OBJTYPE/bin" /* */ /* BYTEORDER: * This symbol holds the hexadecimal constant defined in byteorder, @@ -1109,30 +1126,6 @@ #define BYTEORDER 0x1234 /* large digits for MSB */ #endif /* NeXT */ -/* CAT2: - * This macro catenates 2 tokens together. - */ -/* STRINGIFY: - * This macro surrounds its token with double quotes. - */ -#if 42 == 1 -#define CAT2(a,b) a/**/b -#define STRINGIFY(a) "a" - /* If you can get stringification with catify, tell me how! */ -#endif -#if 42 == 42 -#define PeRl_CaTiFy(a, b) a ## b -#define PeRl_StGiFy(a) #a -/* the additional level of indirection enables these macros to be - * used as arguments to other macros. See K&R 2nd ed., page 231. */ -#define CAT2(a,b) PeRl_CaTiFy(a,b) -#define StGiFy(a) PeRl_StGiFy(a) -#define STRINGIFY(a) PeRl_StGiFy(a) -#endif -#if 42 != 1 && 42 != 42 -# include "Bletch: How does this C preprocessor concatenate tokens?" -#endif - /* CPPSTDIN: * This symbol contains the first part of the string which will invoke * the C preprocessor on the standard input and produce to standard @@ -1850,11 +1843,11 @@ * REENTRANT_PROTO_T_ABC macros of reentr.h if d_gmtime_r * is defined. */ -/*#define HAS_GMTIME_R / **/ +#define HAS_GMTIME_R / **/ #define GMTIME_R_PROTO 0 /**/ /* HAS_GNULIBC: - * This symbol, if defined, indicates to the C program that + * This symbol, if defined, indicates to the C program that * the GNU C library is being used. A better check is to use * the __GLIBC__ and __GLIBC_MINOR__ symbols supplied with glibc. */ @@ -1907,7 +1900,7 @@ #define HAS_INT64_T /**/ /* HAS_ISASCII: - * This manifest constant lets the C program know that isascii + * This manifest constant lets the C program know that isascii * is available. */ /*#define HAS_ISASCII / **/ @@ -1967,29 +1960,68 @@ * REENTRANT_PROTO_T_ABC macros of reentr.h if d_localtime_r * is defined. */ -/*#define HAS_LOCALTIME_R / **/ -/*#define LOCALTIME_R_NEEDS_TZSET / **/ +#define HAS_LOCALTIME_R +#define LOCALTIME_R_NEEDS_TZSET / **/ #define LOCALTIME_R_PROTO 0 /**/ - +#ifdef LOCALTIME_R_NEEDS_TZSET +#define L_R_TZSET tzset(), +#else +#define L_R_TZSET +#endif /* HAS_LONG_DOUBLE: * This symbol will be defined if the C compiler supports long * doubles. */ /* LONG_DOUBLESIZE: - * This symbol contains the size of a long double, so that the + * This symbol contains the size of a long double, so that the * C preprocessor can make decisions based on it. It is only - * defined if the system supports long doubles. - */ -#define HAS_LONG_DOUBLE /**/ + * defined if the system supports long doubles. Note that this + * is sizeof(long double), which may include unused bytes. + */ +/* HAS_LDEXPL: + * This symbol, if defined, indicates that the ldexpl routine is + * available to shift a long double floating-point number + * by an integral power of 2. + */ +/* LONG_DOUBLEKIND: + * LONG_DOUBLEKIND will be one of + * LONG_DOUBLE_IS_DOUBLE + * LONG_DOUBLE_IS_IEEE_754_128_BIT_LITTLE_ENDIAN + * LONG_DOUBLE_IS_IEEE_754_128_BIT_BIG_ENDIAN + * LONG_DOUBLE_IS_X86_80_BIT_LITTLE_ENDIAN + * LONG_DOUBLE_IS_X86_80_BIT_BIG_ENDIAN + * LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_LE + * LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_BE + * LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_BE + * LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_LE + * LONG_DOUBLE_IS_UNKNOWN_FORMAT + * It is only defined if the system supports long doubles. + */ +/*#define HAS_LDEXPL / **/ +#define HAS_LONG_DOUBLE / **/ #ifdef HAS_LONG_DOUBLE #define LONG_DOUBLESIZE 8 /**/ +#define LONG_DOUBLEKIND 0 /**/ +#define LONG_DOUBLE_IS_DOUBLE 0 +#define LONG_DOUBLE_IS_IEEE_754_128_BIT_LITTLE_ENDIAN 1 +#define LONG_DOUBLE_IS_IEEE_754_128_BIT_BIG_ENDIAN 2 +#define LONG_DOUBLE_IS_X86_80_BIT_LITTLE_ENDIAN 3 +#define LONG_DOUBLE_IS_X86_80_BIT_BIG_ENDIAN 4 +#define LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_LE 5 +#define LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_BE 6 +#define LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_BE 7 +#define LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_LE 8 +#define LONG_DOUBLE_IS_UNKNOWN_FORMAT -1 +#define LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LITTLE_ENDIAN LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_LE /* back-compat */ +#define LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BIG_ENDIAN LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_BE /* back-compat */ #endif + /* HAS_LONG_LONG: * This symbol will be defined if the C compiler supports long long. */ /* LONGLONGSIZE: - * This symbol contains the size of a long long, so that the + * This symbol contains the size of a long long, so that the * C preprocessor can make decisions based on it. It is only * defined if the system supports long long. */ @@ -2097,7 +2129,7 @@ /*#define OLD_PTHREAD_CREATE_JOINABLE / **/ /* HAS_PTHREAD_YIELD: - * This symbol, if defined, indicates that the pthread_yield + * This symbol, if defined, indicates that the pthread_yield * routine is available to yield the execution of the current * thread. sched_yield is preferable to pthread_yield. */ @@ -2767,8 +2799,8 @@ * This symbol holds the type used for the second argument to * getgroups() and setgroups(). Usually, this is the same as * gidtype (gid_t) , but sometimes it isn't. - * It can be int, ushort, gid_t, etc... - * It may be necessary to include to get any + * It can be int, ushort, gid_t, etc... + * It may be necessary to include to get any * typedef'ed information. This is only required if you have * getgroups() or setgroups().. */ @@ -2929,6 +2961,12 @@ /*#define PWGECOS / **/ /*#define PWPASSWD / **/ +/* I_QUADMATH: + * This symbol, if defined, indicates that exists and + * should be included. + */ +/*#define I_QUADMATH / **/ + /* I_SHADOW: * This symbol, if defined, indicates that exists and * should be included. @@ -3040,6 +3078,27 @@ */ /*#define INSTALL_USR_BIN_PERL / **/ +/* DOUBLEINFBYTES: + * This symbol, if defined, is a comma-separated list of + * hexadecimal bytes for the double precision infinity. + */ +/* DOUBLENANBYTES: + * This symbol, if defined, is a comma-separated list of + * hexadecimal bytes (0xHH) for the double precision not-a-number. + */ +/* LONGDBLINFBYTES: + * This symbol, if defined, is a comma-separated list of + * hexadecimal bytes for the long double precision infinity. + */ +/* LONGDBLNANBYTES: + * This symbol, if defined, is a comma-separated list of + * hexadecimal bytes (0xHH) for the long double precision not-a-number. + */ +#define DOUBLEINFBYTES 0xe2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0x7f /**/ +#define DOUBLENANBYTES 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f /**/ +#define LONGDBLINFBYTES 0xe2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0x7f /**/ +#define LONGDBLNANBYTES 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /**/ + /* PERL_PRIfldbl: * This symbol, if defined, contains the string used by stdio to * format long doubles (format 'f') for output. @@ -3092,7 +3151,7 @@ #define MYMALLOC /**/ /* Mode_t: - * This symbol holds the type used to declare file modes + * This symbol holds the type used to declare file modes * for systems calls. It is usually mode_t, but may be * int or unsigned short. It may be necessary to include * to get any typedef'ed information. @@ -3242,6 +3301,16 @@ * This symbol contains the number of bits a variable of type NVTYPE * can preserve of a variable of type UVTYPE. */ +/* NV_OVERFLOWS_INTEGERS_AT: + * This symbol gives the largest integer value that NVs can hold. This + * value + 1.0 cannot be stored accurately. It is expressed as constant + * floating point expression to reduce the chance of decimale/binary + * conversion issues. If it can not be determined, the value 0 is given. + */ +/* NV_ZERO_IS_ALLBITS_ZERO: + * This symbol, if defined, indicates that a variable of type NVTYPE + * stores 0.0 in memory as all bits zero. + */ #define IVTYPE long /**/ #define UVTYPE unsigned long /**/ #define I8TYPE char /**/ @@ -3268,8 +3337,10 @@ #define U64SIZE 8 /**/ #endif #define NVSIZE 8 /**/ -/*#define NV_PRESERVES_UV +#define NV_PRESERVES_UV #define NV_PRESERVES_UV_BITS 31 +#define NV_OVERFLOWS_INTEGERS_AT 256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0 +#undef NV_ZERO_IS_ALLBITS_ZERO /* IVdf: * This symbol defines the format string used for printing a Perl IV @@ -3329,8 +3400,8 @@ * This symbol contains the ~name expanded version of PRIVLIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define PRIVLIB "/sys/lib/perl/5.26.3" /**/ -#define PRIVLIB_EXP "/sys/lib/perl/5.26.3" /**/ +#define PRIVLIB "/sys/lib/perl/_P9P_VERSION" /**/ +#define PRIVLIB_EXP "/sys/lib/perl/_P9P_VERSION" /**/ /* PTRSIZE: * This symbol contains the size of a pointer, so that the C preprocessor @@ -3377,7 +3448,7 @@ /* Select_fd_set_t: * This symbol holds the type used for the 2nd, 3rd, and 4th * arguments to select. Usually, this is 'fd_set *', if HAS_FD_SET - * is defined, and 'int *' otherwise. This is only useful if you + * is defined, and 'int *' otherwise. This is only useful if you * have select(), of course. */ #define Select_fd_set_t fd_set* /**/ @@ -3403,10 +3474,10 @@ * The signals in the list are separated with commas, and the indices * within that list and the SIG_NAME list match, so it's easy to compute * the signal name from a number or vice versa at the price of a small - * dynamic linear lookup. + * dynamic linear lookup. * Duplicates are allowed, but are moved to the end of the list. * The signal number corresponding to sig_name[i] is sig_number[i]. - * if (i < NSIG) then sig_number[i] == i. + * if (i < NSIG) then sig_number[i] == i. * The last element is 0, corresponding to the 0 at the end of * the sig_name list. */ @@ -3457,9 +3528,9 @@ * removed. The elements in inc_version_list (inc_version_list.U) can * be tacked onto this variable to generate a list of directories to search. */ -#define SITELIB "/sys/lib/perl/5.26.3/site_perl" /**/ -#define SITELIB_EXP "/sys/lib/perl/5.26.3/site_perl" /**/ -#define SITELIB_STEM "/sys/lib/perl/5.26.3/site_perl" /**/ +#define SITELIB "/sys/lib/perl/_P9P_VERSION/site_perl" /**/ +#define SITELIB_EXP "/sys/lib/perl/_P9P_VERSION/site_perl" /**/ +#define SITELIB_STEM "/sys/lib/perl/_P9P_VERSION/site_perl" /**/ /* Size_t_size: * This symbol holds the size of a Size_t in bytes. @@ -3495,7 +3566,7 @@ * script to make sure (one hopes) that it runs with perl and not * some shell. */ -#define STARTPERL "#!/bin/perl" /**/ +#define STARTPERL "#!/bin/perl-_P9P_VERSION" /**/ /* STDCHAR: * This symbol is defined to be the type of char used in stdio.h. @@ -3537,6 +3608,27 @@ */ #define Uid_t uid_t /* UID type */ +/* GMTIME_MAX: + * This symbol contains the maximum value for the time_t offset that + * the system function gmtime () accepts, and defaults to 0 + */ +/* GMTIME_MIN: + * This symbol contains the minimum value for the time_t offset that + * the system function gmtime () accepts, and defaults to 0 + */ +/* LOCALTIME_MAX: + * This symbol contains the maximum value for the time_t offset that + * the system function localtime () accepts, and defaults to 0 + */ +/* LOCALTIME_MIN: + * This symbol contains the minimum value for the time_t offset that + * the system function localtime () accepts, and defaults to 0 + */ +#define GMTIME_MAX 2147483647 /**/ +#define GMTIME_MIN 0 /**/ +#define LOCALTIME_MAX 2147483647 /**/ +#define LOCALTIME_MIN 0 /**/ + /* USE_64_BIT_INT: * This symbol, if defined, indicates that 64-bit integers should * be used when available. If not defined, the native integers @@ -3613,6 +3705,14 @@ #define USE_PERLIO /**/ #endif +/* USE_QUADMATH: + * This symbol, if defined, indicates that the quadmath library should + * be used when available. + */ +#ifndef USE_QUADMATH +/*#define USE_QUADMATH / **/ +#endif + /* USE_SOCKS: * This symbol, if defined, indicates that Perl should * be built to use socks. @@ -3650,11 +3750,11 @@ * If defined, this symbol contains the name of a private library. * The library is private in the sense that it needn't be in anyone's * execution path, but it should be accessible by the world. - * It may have a ~ on the front. + * It may have a ~ on the front. * The standard distribution will put nothing in this directory. * Vendors who distribute perl may wish to place their own * architecture-dependent modules and extensions in this directory with - * MakeMaker Makefile.PL INSTALLDIRS=vendor + * MakeMaker Makefile.PL INSTALLDIRS=vendor * or equivalent. See INSTALL for details. */ /* PERL_VENDORARCH_EXP: diff --git a/plan9/exclude b/plan9/exclude index 7d9fc3c8af..1a6a8b5286 100644 --- a/plan9/exclude +++ b/plan9/exclude @@ -16,3 +16,4 @@ op/misc.t op/oct.t op/split.t op/stat.t +.git diff --git a/plan9/fndvers b/plan9/fndvers old mode 100644 new mode 100755 index a848de2b6d..b05a98f65d --- a/plan9/fndvers +++ b/plan9/fndvers @@ -12,3 +12,8 @@ ed plan9/genconfig.pl< $target cp ext/IO/*.pm $privlib - if (test !-d $privlib/IO) { + if (test ! -d $privlib/IO) { mkdir $privlib/IO cp ext/IO/lib/IO/*.pm $privlib/IO } @@ -126,7 +140,10 @@ plan9.$O: config.h ./plan9/plan9.c $CCCMD $stem.c $archlib/Config.pm: miniperl config.sh - ./miniperl configpm $archlib/Config.pm + ./miniperl -Ilib make_patchnum.pl + ./miniperl -Ilib configpm + # Might need to fine-tune this + {cd lib; tar c .} | {cd $archlib; tar x} config.sh: miniperl config.h ./miniperl ./plan9/genconfig.pl @@ -143,7 +160,7 @@ man:V: $perlpods pod/pod2man.PL perl for (i in $histpodnames) pod/pod2man pod/$i.pod > $installman3dir/$i nuke clean:V: - rm -f *.$O $extensions^.pm config.sh $perllib config.h $perlshr perlmain.c perl miniperl $archlib/Config.pm $ext_c + rm -f *.$O $extensions^.pm config.sh $perllib config.h $perlshr perlmain.c perl miniperl $archlib/Config.pm $ext_c generate_uudmap uudmap.h bitcount.h mg_data.h rm -rf $privlib/IO deleteman:V: diff --git a/plan9/plan9.c b/plan9/plan9.c index ebdac27dcb..51c9dd5655 100644 --- a/plan9/plan9.c +++ b/plan9/plan9.c @@ -1,20 +1,7 @@ #include "EXTERN.h" #include "perl.h" -/* Functions mentioned in but not implemented */ - -int getsockopt(int a, int b, int c, void *d, int *e) -{ - croak("Function \"getsockopt\" not implemented in this version of perl."); - return (int)NULL; -} - -int setsockopt(int a, int b, int c, void *d, int *e) -{ - croak("Function \"setsockopt\" not implemented in this version of perl."); - return (int)NULL; -} - +/* Functions mentioned in but not implemented */ int recvmsg(int a, struct msghdr *b, int c) { @@ -112,23 +99,3 @@ void endservent() { croak("Function \"endservent\" not implemented in this version of perl."); } - -int tcdrain(int) -{ -croak("Function \"tcdrain\" not implemented in this version of perl."); -} - -int tcflow(int, int) -{ -croak("Function \"tcflow\" not implemented in this version of perl."); -} - -int tcflush(int, int) -{ -croak("Function \"tcflush\" not implemented in this version of perl."); -} - -int tcsendbreak(int, int) -{ -croak("Function \"tcsendbreak\" not implemented in this version of perl."); -} diff --git a/plan9/setup.rc b/plan9/setup.rc index dd96c1f9c7..6b8c2589ed 100644 --- a/plan9/setup.rc +++ b/plan9/setup.rc @@ -5,40 +5,45 @@ # permissions. # Last modified 6/30/96 by: # Luther Huffman, Strategic Computer Solutions, Inc., lutherh@stratcom.com +# Last modified May 2020 by: +# David Romano, unobe@cpan.org awk -f versnum ../patchlevel.h . buildinfo builddir = `{ cd .. ; pwd } if (~ $#* 0) platforms = $objtype if not switch($1) { - case -a ; platforms = (386 mips sparc 68020) + case -a ; platforms = (386 68000 68020 arm arm amd64 mips power power64 sparc sparc64 spim) case * ; echo 'Usage: setup.rc [-a]' >[1=2] ; exit } -sourcedir=/sys/src/cmd/perl/$p9pvers -privlib=/sys/lib/perl +sourceroot=/sys/src/cmd/perl +sourcedir=$sourceroot/$p9pvers +privroot=/sys/lib/perl +privlib=$privroot/$p9pvers sitelib=$privlib/site_perl #Build source directory -if (test ! -d /sys/src/cmd/perl) mkdir /sys/src/cmd/perl +if (test ! -d $sourceroot) mkdir $sourceroot if (test ! -d $sourcedir) mkdir $sourcedir #Populate source directory echo Building source directories ... {cd $builddir ; tar c .} | { cd $sourcedir ; tar x} cp $builddir/plan9/plan9.c $builddir/plan9/plan9ish.h $builddir/plan9/mkfile $sourcedir -cd $sourcedir/lib ; rm -rf * #Build library directories echo Building library directories ... +if (test ! -d $privroot) mkdir $privroot if (test ! -d $privlib) mkdir $privlib if (test ! -d $privlib/auto) mkdir $privlib/auto if (test ! -d $sitelib) mkdir $sitelib for(i in $platforms){ - archlib=/$i/lib/perl/$p9pvers + archroot=/$i/lib/perl + archlib=$archroot/$p9pvers sitearch=$archlib/site_perl corelib=$archlib/CORE arpalib=$corelib/arpa - if (test ! -d /$i/lib/perl) mkdir /$i/lib/perl + if (test ! -d $archroot) mkdir $archroot if (test ! -d $archlib) mkdir $archlib if (test ! -d $sitearch) mkdir $sitearch if (test ! -d $corelib) mkdir $corelib diff --git a/plan9/uninstall.rc b/plan9/uninstall.rc new file mode 100755 index 0000000000..503991a684 --- /dev/null +++ b/plan9/uninstall.rc @@ -0,0 +1,25 @@ +#!/bin/rc + +. buildinfo +if (~ $#* 0) platforms = $objtype +if not switch($1) { + case -a ; platforms = (386 68000 68020 arm arm amd64 mips power power64 sparc sparc64 spim) + case * ; echo 'Usage: uninstall.rc [-a]' >[1=2] ; exit +} +sourceroot=/sys/src/cmd/perl +sourcedir=$sourceroot/$p9pvers +privroot=/sys/lib/perl +privlib=$privroot/$p9pvers +sitelib=$privlib/site_perl + +echo Uninstalling perl/$p9pvers +cd $sourceroot + +for(i in $platforms){ + archroot=/$i/lib/perl + archlib=$archroot/$p9pvers + if (test -d $archlib) rm -r $archlib + rm /$i/bin/perl-$p9pvers +} +if (test -d $privlib) rm -r $privlib +if (test -d $sourcedir) rm -r $sourcedir diff --git a/plan9/versnum b/plan9/versnum index 6e579f3048..55f80d067e 100644 --- a/plan9/versnum +++ b/plan9/versnum @@ -1,8 +1,9 @@ -/PERL_VERSION/ {base = $3} -/PERL_SUBVERSION/ {subvers = $3} +/define PERL_REVISION/ {revision = $3} +/define PERL_VERSION/ {version = $3} +/define PERL_SUBVERSION/ {subvers = $3} END { if (subvers == 0) - printf "p9pvers = 5.%03d\n", base> "buildinfo"; + printf "p9pvers = %d.%d\n", revision, version> "buildinfo"; else - printf "p9pvers = 5.%03d_%02d\n" , base, subvers> "buildinfo"; + printf "p9pvers = %d.%d.%d\n" , revision, version, subvers> "buildinfo"; } diff --git a/proto.h b/proto.h index dd938605f8..b8ad15ae83 100644 --- a/proto.h +++ b/proto.h @@ -5843,10 +5843,10 @@ PERL_STATIC_INLINE bool S_is_utf8_overlong_given_start_byte_ok(const U8 * const assert(s) #endif -STATIC U8* S_swash_scan_list_line(pTHX_ U8* l, U8* const lend, UV* min, UV* max, UV* val, const bool wants_value, const U8* const typestr) +STATIC U8* S_swash_scan_list_line(pTHX_ U8* l, U8* const lend, UV* min, UV* max, UV* val, const bool wants_value, const U8* const typestring) __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_SWASH_SCAN_LIST_LINE \ - assert(l); assert(lend); assert(min); assert(max); assert(val); assert(typestr) + assert(l); assert(lend); assert(min); assert(max); assert(val); assert(typestring) STATIC SV* S_swatch_get(pTHX_ SV* swash, UV start, UV span) __attribute__warn_unused_result__; diff --git a/sv.c b/sv.c index 9f3e28e022..b78519113a 100644 --- a/sv.c +++ b/sv.c @@ -880,10 +880,10 @@ struct body_details { U8 body_size; /* Size to allocate */ U8 copy; /* Size of structure to copy (may be shorter) */ U8 offset; /* Size of unalloced ghost fields to first alloced field*/ - PERL_BITFIELD8 type : 4; /* We have space for a sanity check. */ - PERL_BITFIELD8 cant_upgrade : 1;/* Cannot upgrade this type */ - PERL_BITFIELD8 zero_nv : 1; /* zero the NV when upgrading from this */ - PERL_BITFIELD8 arena : 1; /* Allocated from an arena */ + PERL_BITFIELD8 type; /* We have space for a sanity check. */ + PERL_BITFIELD8 cant_upgrade;/* Cannot upgrade this type */ + PERL_BITFIELD8 zero_nv; /* zero the NV when upgrading from this */ + PERL_BITFIELD8 arena; /* Allocated from an arena */ U32 arena_size; /* Size of arena to allocate */ }; @@ -3001,8 +3001,8 @@ Perl_sv_2pv_flags(pTHX_ SV *const sv, STRLEN *const lp, const I32 flags) return RX_WRAPPED(re); } else { - const char *const typestr = sv_reftype(referent, 0); - const STRLEN typelen = strlen(typestr); + const char *const typestring = sv_reftype(referent, 0); + const STRLEN typelen = strlen(typestring); UV addr = PTR2UV(referent); const char *stashname = NULL; STRLEN stashnamelen = 0; /* hush, gcc */ @@ -3045,7 +3045,7 @@ Perl_sv_2pv_flags(pTHX_ SV *const sv, STRLEN *const lp, const I32 flags) *--retval = '('; retval -= typelen; - memcpy(retval, typestr, typelen); + memcpy(retval, typestring, typelen); if (stashname) { *--retval = '='; @@ -11168,7 +11168,13 @@ S_hextract(pTHX_ const NV nv, int* exponent, bool *subnormal, for (ix = a; ix >= b; ix--) { HEXTRACT_BYTE(ix); } #define HEXTRACT_BYTES_BE(a, b) \ for (ix = a; ix <= b; ix++) { HEXTRACT_BYTE(ix); } +/* May 2020: Ignore subnormal for now on Plan9: it doesn't have the float definitions Perl is expecting. This was + * an understandable oversight when the function was refactored. */ +#ifdef PLAN9 +#define HEXTRACT_GET_SUBNORMAL(nv) +#else #define HEXTRACT_GET_SUBNORMAL(nv) *subnormal = Perl_fp_class_denorm(nv) +#endif #define HEXTRACT_IMPLICIT_BIT(nv) \ STMT_START { \ if (!*subnormal) { \ diff --git a/time64.c b/time64.c index 957218074f..7f82d1874e 100644 --- a/time64.c +++ b/time64.c @@ -500,7 +500,8 @@ struct TM *Perl_localtime64_r (const Time64_T *time, struct TM *local_tm) } safe_time = (time_t)S_timegm64(&gm_tm); - if( LOCALTIME_R(&safe_time, &safe_date) == NULL ) { + // 9front: May 2020. By casting NULL to int, we miss the case when LOCALTIME_R really is 0, which is a valid datetime. + if( LOCALTIME_R(&safe_time, &safe_date) == (int) NULL ) { TIME64_TRACE1("localtime_r(%d) returned NULL\n", (int)safe_time); return NULL; } diff --git a/utf8.c b/utf8.c index 61346f0cb6..ee72236132 100644 --- a/utf8.c +++ b/utf8.c @@ -3993,7 +3993,7 @@ Perl_swash_fetch(pTHX_ SV *swash, const U8 *ptr, bool do_utf8) * terminated by a \n or the null string terminator. * lend points to the null terminator of that string * wants_value is non-zero if the swash expects a third number - * typestr is the name of the swash's mapping, like 'ToLower' + * typestring is the name of the swash's mapping, like 'ToLower' * On output: *min, *max, and *val are set to the values read from the line. * returns a pointer just beyond the line examined. If there was no * valid min number on the line, returns lend+1 @@ -4001,9 +4001,9 @@ Perl_swash_fetch(pTHX_ SV *swash, const U8 *ptr, bool do_utf8) STATIC U8* S_swash_scan_list_line(pTHX_ U8* l, U8* const lend, UV* min, UV* max, UV* val, - const bool wants_value, const U8* const typestr) + const bool wants_value, const U8* const typestring) { - const int typeto = typestr[0] == 'T' && typestr[1] == 'o'; + const int typeto = typestring[0] == 'T' && typestring[1] == 'o'; STRLEN numlen; /* Length of the number */ I32 flags = PERL_SCAN_SILENT_ILLDIGIT | PERL_SCAN_DISALLOW_PREFIX @@ -4060,7 +4060,7 @@ S_swash_scan_list_line(pTHX_ U8* l, U8* const lend, UV* min, UV* max, UV* val, if (typeto) { /* diag_listed_as: To%s: illegal mapping '%s' */ Perl_croak(aTHX_ "%s: illegal mapping '%s'", - typestr, l); + typestring, l); } } } @@ -4073,7 +4073,7 @@ S_swash_scan_list_line(pTHX_ U8* l, U8* const lend, UV* min, UV* max, UV* val, *val = 0; if (typeto) { /* diag_listed_as: To%s: illegal mapping '%s' */ - Perl_croak(aTHX_ "%s: illegal mapping '%s'", typestr, l); + Perl_croak(aTHX_ "%s: illegal mapping '%s'", typestring, l); } } else @@ -4107,7 +4107,7 @@ S_swatch_get(pTHX_ SV* swash, UV start, UV span) SV** listsvp = NULL; /* The string containing the main body of the table */ SV** extssvp = NULL; SV** invert_it_svp = NULL; - U8* typestr = NULL; + U8* typestring = NULL; STRLEN bits; STRLEN octets; /* if bits == 1, then octets == 0 */ UV none; @@ -4123,7 +4123,7 @@ S_swatch_get(pTHX_ SV* swash, UV start, UV span) bits = SvUV(*bitssvp); none = SvUV(*nonesvp); - typestr = (U8*)SvPV_nolen(*typesvp); + typestring = (U8*)SvPV_nolen(*typesvp); } else { bits = 1; @@ -4184,7 +4184,7 @@ S_swatch_get(pTHX_ SV* swash, UV start, UV span) while (l < lend) { UV min, max, val, upper; l = swash_scan_list_line(l, lend, &min, &max, &val, - cBOOL(octets), typestr); + cBOOL(octets), typestring); if (l > lend) { break; } @@ -4476,7 +4476,7 @@ Perl__swash_inversion_hash(pTHX_ SV* const swash) SV** const bitssvp = hv_fetchs(hv, "BITS", FALSE); SV** const nonesvp = hv_fetchs(hv, "NONE", FALSE); /*SV** const extssvp = hv_fetchs(hv, "EXTRAS", FALSE);*/ - const U8* const typestr = (U8*)SvPV_nolen(*typesvp); + const U8* const typestring = (U8*)SvPV_nolen(*typesvp); const STRLEN bits = SvUV(*bitssvp); const STRLEN octets = bits >> 3; /* if bits == 1, then octets == 0 */ const UV none = SvUV(*nonesvp); @@ -4630,7 +4630,7 @@ Perl__swash_inversion_hash(pTHX_ SV* const swash) UV min, max, val; UV inverse; l = swash_scan_list_line(l, lend, &min, &max, &val, - cBOOL(octets), typestr); + cBOOL(octets), typestring); if (l > lend) { break; } @@ -4734,7 +4734,7 @@ Perl__swash_to_invlist(pTHX_ SV* const swash) SV** extssvp; SV** invert_it_svp; - U8* typestr; + U8* typestring; STRLEN bits; STRLEN octets; /* if bits == 1, then octets == 0 */ U8 *x, *xend; @@ -4756,7 +4756,7 @@ Perl__swash_to_invlist(pTHX_ SV* const swash) extssvp = hv_fetchs(hv, "EXTRAS", FALSE); invert_it_svp = hv_fetchs(hv, "INVERT_IT", FALSE); - typestr = (U8*)SvPV_nolen(*typesvp); + typestring = (U8*)SvPV_nolen(*typesvp); bits = SvUV(*bitssvp); octets = bits >> 3; /* if bits == 1, then octets == 0 */ @@ -4839,7 +4839,7 @@ Perl__swash_to_invlist(pTHX_ SV* const swash) UV val; /* Not used by this function */ l = swash_scan_list_line(l, lend, &start, &end, &val, - cBOOL(octets), typestr); + cBOOL(octets), typestring); if (l > lend) { break;