Skip to content

Commit

Permalink
Specify PERL_USE_SAFE_PUTENV when configuring ASCII z/OS builds
Browse files Browse the repository at this point in the history
The Perl code expects that the ``environ`` global variable can be
re-allocated to new storage and then have entries added and removed from
it. This isn't supported by z/OS when in Bi-Modal mode and so
_PERL_USE_SAFE_PUTENV_ macro is defined to use the _env_ services to
manipulate ``environ`` instead of doing so directly. It is not clear if
it is valid to re-allocate storage for the ``environ`` global variable
or not, although it is worth pursuing with the z/OS development team as
a longer-term potential fix.
  • Loading branch information
Mike Fulton authored and khwilliamson committed Jan 1, 2022
1 parent 9791582 commit 3d121e9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hints/os390.sh
Expand Up @@ -60,6 +60,8 @@ 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"
# ensure that 'safe' putenv is used and avoid direct environ manipulation
def_os390_defs="$def_os390_defs -DPERL_USE_SAFE_PUTENV";
else
ebcdic=true
fi
Expand All @@ -78,7 +80,7 @@ def_os390_cccdlflags="$def_os390_cccdlflags -qexportall"
# 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_defs='-DMAXSIG=39 -DNSIG=39'; # maximum signal number; not furnished by IBM
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__

# ensure that the OS/390 yacc generated parser is reentrant.
Expand Down

0 comments on commit 3d121e9

Please sign in to comment.