diff options
-rwxr-xr-x | Makefile.SH | 9 | ||||
-rw-r--r-- | ext/DynaLoader/dl_aix.xs | 12 | ||||
-rwxr-xr-x | perl_exp.SH | 15 | ||||
-rw-r--r-- | perlio.sym | 49 |
4 files changed, 81 insertions, 4 deletions
diff --git a/Makefile.SH b/Makefile.SH index ec99d02e5c..70876e1e74 100755 --- a/Makefile.SH +++ b/Makefile.SH @@ -41,7 +41,14 @@ true) ;; aix*) shrpldflags="-H512 -T512 -bhalt:4 -bM:SRE -bE:perl.exp" - shrpldflags="$shrpldflags -b noentry $ldflags $libs $cryptlib" + case "$osvers" in + 3*) + shrpldflags="$shrpldflags -e _nostart $ldflags $libs $cryptlib" + ;; + *) + shrpldflags="$shrpldflags -b noentry $ldflags $libs $cryptlib" + ;; + esac aixinstdir=`pwd | sed 's/\/UU$//'` linklibperl="-L $archlibexp/CORE -L $aixinstdir -lperl" ;; diff --git a/ext/DynaLoader/dl_aix.xs b/ext/DynaLoader/dl_aix.xs index bdf33b2410..746666636a 100644 --- a/ext/DynaLoader/dl_aix.xs +++ b/ext/DynaLoader/dl_aix.xs @@ -29,6 +29,12 @@ #include <a.out.h> #include <ldfcn.h> +/* If using PerlIO, redefine these macros from <ldfcn.h> */ +#ifdef USE_PERLIO +#define FSEEK(ldptr,o,p) PerlIO_seek(IOPTR(ldptr),(p==BEGINNING)?(OFFSET(ldptr)+o):o,p) +#define FREAD(p,s,n,ldptr) PerlIO_read(IOPTR(ldptr),p,s*n) +#endif + /* * We simulate dlopen() et al. through a call to load. Because AIX has * no call to find an exported symbol we read the loader section of the @@ -389,7 +395,13 @@ static int readExports(ModulePtr mp) ; return -1; } +/* This first case is a hack, since it assumes that the 3rd parameter to + FREAD is 1. See the redefinition of FREAD above to see how this works. */ +#ifdef USE_PERLIO + if (FREAD(ldbuf, sh.s_size, 1, ldp) != sh.s_size) { +#else if (FREAD(ldbuf, sh.s_size, 1, ldp) != 1) { +#endif errvalid++; strcpy(errbuf, "readExports: cannot read loader section"); safefree(ldbuf); diff --git a/perl_exp.SH b/perl_exp.SH index ef79876fce..06b587f9ef 100755 --- a/perl_exp.SH +++ b/perl_exp.SH @@ -5,9 +5,9 @@ # Create the export list for perl. # Needed by AIX to do dynamic linking. # -# This simple program relys on 'global.sym' being up to date -# with all of the global symbols that a dynamicly link library -# might want to access. +# This simple program relys on 'global.sym' and other *.sym files +# being up to date with all of the global symbols that a dynamic +# link library might want to access. # # Most symbols have a Perl_ prefix because that's what embed.h sticks # in front of them. Variations depend on binary compatibility with @@ -57,6 +57,15 @@ y*) ;; esac +# +# If we use the PerlIO abstraction layer, add its symbols +# + +if [ $useperlio = "define" ] +then + grep '^[A-Za-z]' perlio.sym >> perl.exp +fi + # # Extra globals not included above (including a few that might # not actually be defined, but there's no harm in that). diff --git a/perlio.sym b/perlio.sym new file mode 100644 index 0000000000..d7a345c4cc --- /dev/null +++ b/perlio.sym @@ -0,0 +1,49 @@ +# Symbols which arise as part of the PerlIO abstraction + +PerlIO_stderr +PerlIO_stderr +PerlIO_stdin +PerlIO_stdout +PerlIO_fast_gets +PerlIO_has_cntptr +PerlIO_canset_cnt +PerlIO_set_cnt +PerlIO_set_ptrcnt +PerlIO_get_cnt +PerlIO_get_bufsiz +PerlIO_get_ptr +PerlIO_get_base +PerlIO_has_base +PerlIO_puts +PerlIO_open +PerlIO_fdopen +PerlIO_reopen +PerlIO_close +PerlIO_eof +PerlIO_getname +PerlIO_getc +PerlIO_error +PerlIO_clearerr +PerlIO_flush +PerlIO_fileno +PerlIO_setlinebuf +PerlIO_putc +PerlIO_ungetc +PerlIO_read +PerlIO_write +PerlIO_vprintf +PerlIO_tell +PerlIO_seek +PerlIO_rewind +PerlIO_printf +PerlIO_stdoutf +PerlIO_tmpfile +PerlIO_importFILE +PerlIO_exportFILE +PerlIO_findFILE +PerlIO_releaseFILE +PerlIO_init +PerlIO_setpos +PerlIO_getpos +PerlIO_vsprintf +PerlIO_sprintf |