Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

split patches in prep for update or patches for next vrm #77

Merged
merged 2 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
12 changes: 12 additions & 0 deletions patches/PR1/.gitignore.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/.gitignore b/.gitignore
index a0f98256b1..84a24fd896 100644
--- a/.gitignore
+++ b/.gitignore
@@ -56,6 +56,7 @@ perldtrace.h

# general build products
*.o
+*.d
*.a
*.so
*.i
32 changes: 32 additions & 0 deletions patches/PR1/Configure.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
diff --git a/Configure b/Configure
index e261cb9548..c5dd7c1123 100755
--- a/Configure
+++ b/Configure
@@ -4584,7 +4584,7 @@ echo "Checking for GNU cc in disguise and/or its version number..." >&4
$cat >try.c <<EOM
#include <stdio.h>
int main() {
-#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
+#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__MVS__) /* xlclang sets __GNUC__ but does not set __VERSION__ */
#ifdef __VERSION__
printf("%s\n", __VERSION__);
#else
@@ -8697,10 +8697,14 @@ case "$useshrplib" in
true)
case "$userelocatableinc" in
true|define)
- echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
- echo "See INSTALL for an explanation why that won't work." >&4
- exit 4
- ;;
+ case "$osname" in
+ os390) echo "Perl on z/OS uses LIBPATH to dynamically locate shared objects." ;;
+ *)
+ echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
+ echo "See INSTALL for an explanation why that won't work." >&4
+ exit 4
+ ;;
+ esac
esac
case "$libperl" in
'')
54 changes: 54 additions & 0 deletions patches/PR1/Makefile.SH.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
diff --git a/Makefile.SH b/Makefile.SH
index 163a646707..352cd51726 100755
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -119,7 +119,7 @@ true)
;;
os390*)
case "$use64bitall" in
- define|true|[yY]*) shrpldflags='-Wl,LP64,dll'
+ define|true|[yY]*) shrpldflags='-shared'
linklibperl='libperl.x'
;;
*) shrpldflags='-Wl,XPLINK,dll'
@@ -434,6 +434,7 @@ FIRSTMAKEFILE = $firstmakefile

# Any special object files needed by this architecture, e.g. os2/os2.obj
ARCHOBJS = $archobjs
+ARCH_MAIN_OBJS = $arch_main_objs

.SUFFIXES: .c \$(OBJ_EXT) .i .s .c.depends

@@ -595,9 +596,9 @@ miniperl_dtrace_objs = $(miniperl_objs_nodt:%=mpdtrace/%)
perllib_dtrace_objs = $(perllib_objs_nodt:%=libpdtrace/%)
perlmain_dtrace_objs = maindtrace/perlmain$(OBJ_EXT)

-miniperl_objs = $(miniperl_dtrace_objs) $(DTRACE_MINI_O)
+miniperl_objs = $(miniperl_dtrace_objs) $(DTRACE_MINI_O) $(ARCH_MAIN_OBJS)
perllib_objs = $(perllib_dtrace_objs) $(DTRACE_PERLLIB_O)
-perlmain_objs = $(perlmain_dtrace_objs) $(DTRACE_MAIN_O)
+perlmain_objs = $(perlmain_dtrace_objs) $(DTRACE_MAIN_O) $(ARCH_MAIN_OBJS)

miniperl_dep = $(DTRACE_MINI_O)
perllib_dep = $(DTRACE_PERLLIB_O)
@@ -608,9 +609,9 @@ perlmain_dep = $(DTRACE_MAIN_O)
*)
$spitshell >>$Makefile <<'!NO!SUBS!'

-miniperl_objs = $(miniperl_objs_nodt) $(DTRACE_MINI_O)
+miniperl_objs = $(miniperl_objs_nodt) $(DTRACE_MINI_O) $(ARCH_MAIN_OBJS)
perllib_objs = $(perllib_objs_nodt) $(DTRACE_PERLLIB_O)
-perlmain_objs = perlmain$(OBJ_EXT) $(DTRACE_MAIN_O)
+perlmain_objs = perlmain$(OBJ_EXT) $(DTRACE_MAIN_O) $(ARCH_MAIN_OBJS)

miniperl_dep = $(miniperl_objs)
perllib_dep = $(perllib_objs)
@@ -933,7 +934,7 @@ $(LIBPERL): $& $(perllib_dep) $(DYNALOADER) $(LIBPERLEXPORT)
true)
$spitshell >>$Makefile <<'!NO!SUBS!'
rm -f $@
- $(LD) -o $@ $(SHRPLDFLAGS) $(perllib_objs) $(DYNALOADER) $(libs)
+ $(LD) -o $@ $(SHRPLDFLAGS) $(LDFLAGS) $(perllib_objs) $(DYNALOADER) $(libs)
!NO!SUBS!
case "$osname" in
aix)
13 changes: 13 additions & 0 deletions patches/PR1/cpan/IPC-SysV/SysV.xs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/cpan/IPC-SysV/SysV.xs b/cpan/IPC-SysV/SysV.xs
index 6690718aa8..b362aed17b 100644
--- a/cpan/IPC-SysV/SysV.xs
+++ b/cpan/IPC-SysV/SysV.xs
@@ -32,7 +32,7 @@
# include <sys/sysmacros.h> /* SHMLBA */
# endif
# include <sys/shm.h>
-# ifndef HAS_SHMAT_PROTOTYPE
+# if ! defined(HAS_SHMAT_PROTOTYPE) && !defined(__MVS__)
extern Shmat_t shmat(int, char *, int);
# endif
# if defined(HAS_SYSCONF) && defined(_SC_PAGESIZE)
103 changes: 103 additions & 0 deletions patches/PR1/doio.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
diff --git a/doio.c b/doio.c
index 48deb13d6a..fcae5e48e1 100644
--- a/doio.c
+++ b/doio.c
@@ -35,7 +35,7 @@
#endif
#ifdef HAS_SHM
#include <sys/shm.h>
-# ifndef HAS_SHMAT_PROTOTYPE
+#if 0 //# ifndef HAS_SHMAT_PROTOTYPE
extern Shmat_t shmat (int, char *, int);
# endif
#endif
@@ -218,57 +218,6 @@ Perl_PerlLIO_dup2_cloexec(pTHX_ int oldfd, int newfd)
#endif
}

-#if defined(OEMVS)
- #if (__CHARSET_LIB == 1)
-# include <stdio.h>
-# include <stdlib.h>
-
- static int setccsid(int fd, int ccsid)
- {
- attrib_t attr;
- int rc;
-
- memset(&attr, 0, sizeof(attr));
- attr.att_filetagchg = 1;
- attr.att_filetag.ft_ccsid = ccsid;
- attr.att_filetag.ft_txtflag = 1;
-
- rc = __fchattr(fd, &attr, sizeof(attr));
- return rc;
- }
-
- static void updateccsid(int fd, const char* path, int oflag, int perm)
- {
- int rc;
- if (oflag & O_CREAT) {
- rc = setccsid(fd, 819);
- }
- }
-
- int asciiopen(const char* path, int oflag)
- {
- int rc;
- int fd = open(path, oflag);
- if (fd == -1) {
- return fd;
- }
- updateccsid(fd, path, oflag, -1);
- return fd;
- }
-
- int asciiopen3(const char* path, int oflag, int perm)
- {
- int rc;
- int fd = open(path, oflag, perm);
- if (fd == -1) {
- return fd;
- }
- updateccsid(fd, path, oflag, perm);
- return fd;
- }
- #endif
-#endif
-
int
Perl_PerlLIO_open_cloexec(pTHX_ const char *file, int flag)
{
@@ -298,9 +247,6 @@ Perl_PerlLIO_open3_cloexec(pTHX_ const char *file, int flag, int perm)
}

#if defined(OEMVS)
- #if (__CHARSET_LIB == 1)
- #define TEMP_CCSID 819
- #endif
static int Internal_Perl_my_mkstemp_cloexec(char *templte)
{
PERL_ARGS_ASSERT_MY_MKSTEMP_CLOEXEC;
@@ -317,9 +263,6 @@ int
Perl_my_mkstemp_cloexec(char *templte)
{
int tempfd = Internal_Perl_my_mkstemp_cloexec(templte);
-# if defined(TEMP_CCSID)
- setccsid(tempfd, TEMP_CCSID);
-# endif
return tempfd;
}

@@ -2528,6 +2471,11 @@ Perl_do_exec3(pTHX_ const char *incmd, int fd, int do_report)
}
doshell:
PERL_FPU_PRE_EXEC
+#if defined(OEMVS)
+ #if (__CHARSET_LIB == 1)
+ unsetenv("_TAG_REDIR_ERR");
+ #endif
+#endif
PerlProc_execl(PL_sh_path, "sh", "-c", cmd, (char *)NULL);
PERL_FPU_POST_EXEC
S_exec_failed(aTHX_ PL_sh_path, fd, do_report);
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/ext/ExtUtils-Miniperl/lib/ExtUtils/Miniperl.pm b/ext/ExtUtils-Miniperl/lib/ExtUtils/Miniperl.pm
index 18627f8a5e..f5963b51ab 100644
--- a/ext/ExtUtils-Miniperl/lib/ExtUtils/Miniperl.pm
+++ b/ext/ExtUtils-Miniperl/lib/ExtUtils/Miniperl.pm
@@ -68,6 +68,7 @@ sub writemain{
*/

#ifdef OEMVS
+#ifndef __LP64__
#ifdef MYMALLOC
/* sbrk is limited to first heap segment so make it big */
#pragma runopts(HEAP(8M,500K,ANYWHERE,KEEP,8K,4K) STACK(,,ANY,) ALL31(ON))
@@ -75,6 +76,7 @@ sub writemain{
#pragma runopts(HEAP(2M,500K,ANYWHERE,KEEP,8K,4K) STACK(,,ANY,) ALL31(ON))
#endif
#endif
+#endif

#define PERL_IN_MINIPERLMAIN_C

141 changes: 141 additions & 0 deletions patches/PR1/hints/os390.sh.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
diff --git a/hints/os390.sh b/hints/os390.sh
index 56f247bfcf..e1a8789f7f 100644
--- a/hints/os390.sh
+++ b/hints/os390.sh
@@ -18,22 +18,9 @@
# Mike Fulton
# Karl Williamson
#
-# The z/OS 'cc' and 'ld' are insufficient for our needs, so we use c99 instead
-# c99 has compiler options specified via standard Unix-style options, but some
-# options need to be specified using -Wc,<compiler-option> or -Wl,<link-option>
me=$0
-case "$cc" in
-'') cc='c99' ;;
-esac
-case "$ld" in
-'') ld='c99' ;;
-esac

-# Prepend your favorites with Configure -Dccflags=your_favorites
-
-# This overrides the name the compiler was called with. 'ext' is required for
-# "unicode literals" to be enabled
-def_os390_cflags='-qlanglvl=extc1x';
+# Prepend your favorites with Configure -Dccflags=your_favorites -Dcppflags=your_favourites

# For #ifdefs in code
def_os390_defs="-DOS390 -DZOS";
@@ -47,6 +34,19 @@ def_os390_defs="$def_os390_defs -D_ALL_SOURCE";

case "$use64bitall" in
'')
+ # The z/OS 'cc' and 'ld' are insufficient for our needs, so we use c99 instead
+ # c99 has compiler options specified via standard Unix-style options, but some
+ # options need to be specified using -Wc,<compiler-option> or -Wl,<link-option>
+ case "$cc" in
+ '') cc='c99' ;;
+ esac
+ case "$ld" in
+ '') ld='c99' ;;
+ esac
+
+ # This overrides the name the compiler was called with. 'ext' is required for
+ # "unicode literals" to be enabled
+ def_os390_cflags='-qlanglvl=extc1x';
def_os390_cflags="$def_os390_cflags -qxplink"
def_os390_cccdlflags="-qxplink"
def_os390_ldflags="-qxplink"
@@ -54,32 +54,40 @@ case "$use64bitall" in
def_os390_defs="$def_os390_defs -D_OE_SOCKETS";
;;
*)
- def_os390_cflags="$def_os390_cflags -Wc,lp64"
- def_os390_cccdlflags="$def_os390_cflags -Wl,lp64"
- def_os390_ldflags="-Wl,lp64"
+ # Use xlclang for 64-bit
+ case "$cc" in
+ '') cc='clang' ;;
+ esac
+ case "$ld" in
+ '') ld='clang' ;;
+ esac
+ def_os390_cflags="-m64"
+ def_os390_cccdlflags="$def_os390_cflags"
+ def_os390_ldflags="-m64"
esac

+arch_main_objs=""
+archobjs="os390.o"
+
+# Help make find os390.c
+test -h os390.c || ln -s os390/os390.c os390.c
+
myfirstchar=$(od -A n -N 1 -t x $me | xargs | tr [:lower:] [:upper:] | tr -d 0)
if [ "${myfirstchar}" = "23" ]; then # 23 is '#' in ASCII
unset ebcdic
- def_os390_cflags="$def_os390_cflags -qascii"
+ def_os390_cflags="$def_os390_cflags -fzos-le-char-mode=ascii"
else
ebcdic=true
fi

+case "$cc" in
+'xlclang')
# Export all externally defined functions and variables in the compilation
# unit so that a DLL application can use them.
-def_os390_cflags="$def_os390_cflags -qexportall";
-def_os390_cccdlflags="$def_os390_cccdlflags -qexportall"
-
-# 3296= #include file not found;
-# 4108= The use of keyword &1 is non-portable
-# We care about this because it
-# actually means it didn't do what we expected. e.g.,
-# INFORMATIONAL CCN4108 ./proto.h:4534 The use of keyword '__attribute__' is non-portable.
-# 3159= Bit field type specified for &1 is not valid. Type &2 assumed.
-# We do not care about this warning - the bit field is 1 bit and is being specified on something smaller than an int
-def_os390_cflags="$def_os390_cflags -qhaltonmsg=3296:4108 -qsuppress=CCN3159 -qfloat=ieee"
+def_os390_cflags="$def_os390_cflags"
+def_os390_cccdlflags="$def_os390_cccdlflags"
+;;
+esac

def_os390_defs="$def_os390_defs -DMAXSIG=39 -DNSIG=39"; # maximum signal number; not furnished by IBM
def_os390_defs="$def_os390_defs -DOEMVS"; # is used in place of #ifdef __MVS__
@@ -94,10 +102,13 @@ def_os390_defs="$def_os390_defs -DNO_LOCALE_MESSAGES"
# Set up feature test macros required for features available on supported z/OS systems
def_os390_defs="$def_os390_defs -D_OPEN_THREADS=3 -D_UNIX03_SOURCE=1 -D_AE_BIMODAL=1 -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -D_ENHANCED_ASCII_EXT=0xFFFFFFFF -D_OPEN_SYS_FILE_EXT=1 -D_OPEN_SYS_SOCK_IPV6 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED"

+# Find perl base on PATH environment variable rather than hardcoding install location
+startperl='#!/bin/env perl'
+
# Combine -D with cflags
case "$ccflags" in
'') ccflags="$def_os390_cflags $def_os390_defs" ;;
-*) ccflags="$ccflags $def_os390_cflags $def_os390_defs" ;;
+*) ccflags="$ccflags $cppflags $def_os390_cflags $def_os390_defs" ;;
esac

# Turning on optimization causes perl to not even compile from miniperl. You
@@ -109,7 +120,7 @@ esac
# To link via definition side decks we need the dll option
# You can override this with Configure -Ucccdlflags or somesuch.
case "$cccdlflags" in
-'') cccdlflags="$def_os390_cccdlflags -Wl,dll";;
+'') cccdlflags="$def_os390_cccdlflags -shared";;
esac

case "$so" in
@@ -232,10 +243,10 @@ esac
# NOLOC says to use the 1047 code page, and no locale
case "$usedl" in
define)
-echo 'cat >.$$.c; '"$cc"' -D_OE_SOCKETS -D_ALL_SOURCE -D_SHR_ENVIRON -E -Wc,"LANGLVL(DOLLARINNAMES)",NOLOC ${1+"$@"} .$$.c | fgrep -v "??="; rm .$$.c' > cppstdin
+echo 'cat >.$$.c; '"$cc"' -D_ALL_SOURCE -D_SHR_ENVIRON -E -qdollar ${1+"$@"} .$$.c | fgrep -v "??="; rm .$$.c' > cppstdin
;;
*)
-echo 'cat >.$$.c; '"$cc"' -D_OE_SOCKETS -D_ALL_SOURCE -E -Wc,"LANGLVL(DOLLARINNAMES)",NOLOC ${1+"$@"} .$$.c | fgrep -v "??="; rm .$$.c' > cppstdin
+echo 'cat >.$$.c; '"$cc"' -D_ALL_SOURCE -E -qdollar ${1+"$@"} .$$.c | fgrep -v "??="; rm .$$.c' > cppstdin
;;
esac

Loading
Loading