zopencommunity / perlport

Perl programming language
Apache License 2.0
6 stars 3 forks source link

64-bit ASCII dll build fails #13

Closed MikeFultonDev closed 2 years ago

MikeFultonDev commented 2 years ago

/tmp/make.blead.64.dynamic.ascii.out

c99 -c -qlanglvl=extc1x -Wc,lp64 -qexportall -qhaltonmsg=3296:4108 -qsuppress=CCN3159 -qfloat=ieee -DMAXSIG=39 -DOEMVS -DYYDYNAMIC -DNO_LOCALE_MESSAGES -D_OPEN_THREADS=3 -D_UNIX03_SOURCE=1 -DNSIG=39 -D_AE_BIMODAL=1 -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -D_ENHAN CED_ASCII_EXT=0xFFFFFFFF -D_OPEN_SYS_FILE_EXT=1 -D_OPEN_SYS_SOCK_IPV6 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D_SHR_ENVIRON -DVERSION=\"1.52\" -DXS_VERSION=\"1.52\" -c -qlanglvl=extc1x -Wc,lp64 -Wl,lp64 -qexportall "-I../.." -DLIBC="" DynaLoader.c rm -rf ../../DynaLoader.o cp DynaLoader.o ../../DynaLoader.o rm -f libperl.so

c99 -o libperl.so -qlanglvl=extc1x -Wc,lp64 -Wl,lp64 -qexportall -L/usr/local/lib /app/temp/perlport/blead.64.dynamic.ascii/perl5/libperl.x op.o perl.o universal.o gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro_core.o keywords.o builtin.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o globals.o perlio.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o caretx.o dquote.o time64.o DynaLoader.o -lm -lc

FSUM3228 c99: Input file /app/temp/perlport/blead.64.dynamic.ascii/perl5/libperl.x not found. makefile:345: recipe for target 'libperl.so' failed

MikeFultonDev commented 2 years ago

/tmp/make.blead.31.dynamic.ascii.out

c99 -c -qlanglvl=extc1x -qxplink -qexportall -qhaltonmsg=3296:4108 -qsuppress=CCN3159 -qfloat=ieee -DMAXSIG=39 -DOEMVS -DYYDYNAMIC -DNO_LOCALE_MESSAGES -D_OPEN_THREADS=3 -D_UNIX03_SOURCE=1 -DNSIG=39 -D_AE_BIMODAL=1 -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -D_ENHAN CED_ASCII_EXT=0xFFFFFFFF -D_OPEN_SYS_FILE_EXT=1 -D_OPEN_SYS_SOCK_IPV6 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D_SHR_ENVIRON
-DVERSION=\"1.52\" -DXS_VERSION=\"1.52\" -c -qxplink -qexportall "-I../.." -DLIBC="" DynaLoader.c rm -rf ../../DynaLoader.o cp DynaLoader.o ../../DynaLoader.o rm -f libperl.so

c99 -o libperl.so -Wl,XPLINK,dll op.o perl.o universal.o gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro_core.o keywords.o builtin.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o globals.o perlio.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o caretx.o dquote.o time64.o DynaLoader.o -lm -lc

env LD_RUN_PATH=/usr/local/perl/blead.31.dynamic.ascii/lib/5.35.7/os390/CORE c99 -o perl -qxplink -L/usr/local/lib /app/temp/perlport/blead.31.dynamic.ascii/perl5/libperl.x perlmain.o libperl.x cat ext.libs -lm -lc IEW2689W 4C40 DEFINITION SIDE FILE IS NOT DEFINED. FSUM3065 The LINKEDIT step ended with return code 4. /bin/env LIBPATH=/app/temp/perlport/blead.31.dynamic.ascii/perl5:/app/temp/perlport/blead.31.dynamic.ascii/perl5:/lib:/usr/lib ./min iperl -Ilib mkppport running "/app/temp/perlport/blead.31.dynamic.ascii/perl5/miniperl" -I../../lib PPPort_pm.PL

MikeFultonDev commented 2 years ago

For 31-bit, this bind creates the libperl.x file:

c99 -o libperl.so -Wl,XPLINK,dll op.o perl.o universal.o gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro_core.o keywords.o builtin.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o globals.o perlio.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o caretx.o dquote.o time64.o DynaLoader.o -lm -lc

MikeFultonDev commented 2 years ago

In 64-bit, this bind is specifying the libperl.x and so complains (it isn't created yet). Also, the 'dll' option needs to be passed to the link step:

c99 -o libperl.so -qlanglvl=extc1x -Wc,lp64 -Wl,dll,lp64 -qexportall -L/usr/local/lib op.o perl.o universal.o gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro_core.o keywords.o builtin.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o globals.o perlio.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o caretx.o dquote.o time64.o DynaLoader.o -lm -lc

MikeFultonDev commented 2 years ago

Confirming that this is not related to ASCII/EBCDIC. I get the same failure with 64-bit dynamic EBCDIC:

c99 -o libperl.so -qlanglvl=extc1x -Wc,lp64 -Wl,lp64 -qexportall -L/usr/local/lib /app/temp/perlport/blead.64.dynamic.ebcdic/perl5/l ibperl.x op.o perl.o universal.o gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro_core.o keywords.o builtin.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o globals.o perlio.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o caretx.o dquote.o time64.o DynaLoader.o -lm -lc FSUM3228 c99: Input file /app/temp/perlport/blead.64.dynamic.ebcdic/perl5/libperl.x not found.

MikeFultonDev commented 2 years ago

This is the 'original' code for usedl in hints/os390.sh


# In order to build with dynamic be sure to specify:
#   Configure -Dusedl
# Do not forget to add $archlibexp/CORE to your LIBPATH.
# You might want to override some of this with things like:
#  Configure -Dusedl -Ddlext=so -Ddlsrc=dl_dllload.xs.
case "$usedl" in
'')
   usedl='n'
   case "$dlext" in
   '') dlext='none' ;;
   esac
   ;;
define)
   case "$useshrplib" in
   '') useshrplib='true' ;;
   esac
   case "$dlsrc" in
   '') dlsrc='dl_dllload.xs' ;;
   esac
   # For performance use 'so' at or beyond v2.8, 'dll' for 2.7 and prior versions
   case "`uname -v`x`uname -r`" in
   02x0[89].*|02x1[0-9].*|[0-9][3-9]x*)
       so='so'
       case "$dlext" in
       '') dlext='so' ;;
       esac
       ;;
   *)
       so='dll'
       case "$dlext" in
       '') dlext='dll' ;;
       esac
       ;;
   esac
   libperl="libperl.$so"

   # Allows char **environ to be accessed from a dynamically loaded
   # module such as a DLL
   ccflags="$ccflags -D_SHR_ENVIRON"

   cccdlflags="-c $def_os390_cccdlflags"
   lddlflags="$def_os390_cccdlflags"

   # The following will need to be modified for the installed libperl.x.
   # The modification to Config.pm is done by the installperl script after the
   # build and test.  These are written to a CBU so that the libperl.x file
   # comes after all the dash-options in the flags.  Configure takes the
   # lddlflags we give it and looks for paths to libraries to append -L options
   # to lddlflags.  But this causes the file libperl.x to appear in the final
   # command line after the -L options.  And z/OS doesn't like filenames after
   # options.  This CBU defers the adding of libperl.x until after any munging
   # that Configure does.
   cat >config.arch <<' EOCBU'
    case "ccdlflags" in
    '') ccdlflags="`pwd`/libperl.x" ;;
         *) ccdlflags="$ccdlflags `pwd`/libperl.x" ;;
    esac
    lddlflags="$lddlflags `pwd`/libperl.x"
    EOCBU
   ;;
esac
MikeFultonDev commented 2 years ago

Also, the cflags always pass in -Wl,dll regardless of build option:

os390_Wl="-Wl"
...
# Without this, you get "IEW2689W 4C40 DEFINITION SIDE FILE IS NOT DEFINED."
os390_Wl="$os390_Wl,DLL"
...

# Combinte the -W flags with the rest
def_os390_cflags="$def_os390_cflags $os390_Wc";
def_os390_cflags="$def_os390_cflags $os390_Wl";
MikeFultonDev commented 2 years ago

/tmp/make.blead.64.static.ascii.out

c99 -o perl -Wl,lp64  -L/usr/local/lib  perlmain.o  libperl.a lib/auto/B/B.a lib/auto/Compress/Raw/Bzip2/Bzip2.a lib/auto/Compress/R
aw/Zlib/Zlib.a lib/auto/Cwd/Cwd.a lib/auto/Data/Dumper/Dumper.a lib/auto/Devel/PPPort/PPPort.a lib/auto/Devel/Peek/Peek.a lib/auto/D
igest/MD5/MD5.a lib/auto/Digest/SHA/SHA.a lib/auto/Encode/Encode.a lib/auto/Fcntl/Fcntl.a lib/auto/File/DosGlob/DosGlob.a lib/auto/F
ile/Glob/Glob.a lib/auto/Filter/Util/Call/Call.a lib/auto/Hash/Util/Util.a lib/auto/Hash/Util/FieldHash/FieldHash.a lib/auto/I18N/La
nginfo/Langinfo.a lib/auto/IO/IO.a lib/auto/IPC/SysV/SysV.a lib/auto/List/Util/Util.a lib/auto/MIME/Base64/Base64.a lib/auto/Math/Bi
gInt/FastCalc/FastCalc.a lib/auto/NDBM_File/NDBM_File.a lib/auto/Opcode/Opcode.a lib/auto/POSIX/POSIX.a lib/auto/PerlIO/encoding/enc
oding.a lib/auto/PerlIO/mmap/mmap.a lib/auto/PerlIO/scalar/scalar.a lib/auto/PerlIO/via/via.a lib/auto/SDBM_File/SDBM_File.a lib/aut
o/Socket/Socket.a lib/auto/Storable/Storable.a lib/auto/Sys/Hostname/Hostname.a lib/auto/Sys/Syslog/Syslog.a lib/auto/Time/HiRes/HiR
es.a lib/auto/Time/Piece/Piece.a lib/auto/Unicode/Collate/Collate.a lib/auto/Unicode/Normalize/Normalize.a lib/auto/attributes/attri
butes.a lib/auto/mro/mro.a lib/auto/re/re.a lib/auto/threads/threads.a lib/auto/threads/shared/shared.a lib/auto/Encode/Byte/Byte.a 
lib/auto/Encode/CN/CN.a lib/auto/Encode/EBCDIC/EBCDIC.a lib/auto/Encode/JP/JP.a lib/auto/Encode/KR/KR.a lib/auto/Encode/Symbol/Symbo
l.a lib/auto/Encode/TW/TW.a lib/auto/Encode/Unicode/Unicode.a `cat ext.libs` -lm -lc
 IEW2689W 4C40 DEFINITION SIDE FILE IS NOT DEFINED.
FSUM3065 The LINKEDIT step ended with return code 4.

Build works fine for 64-bit ascii static

MikeFultonDev commented 2 years ago

fixed after I passed in the right option