develooper Front page | perl.perl5.porters | Postings from December 2000

[PATCH perl@8133] finding PerlIO symbols for VMS

Thread Next
Craig A. Berry
December 17, 2000 05:45
[PATCH perl@8133] finding PerlIO symbols for VMS
Message ID:
The dynamic library (shareable image in vmsspeak) that comprises the
bulk of Perl's innards needs to be told exactly what symbols to make
externally visible.  We do this by running perl.h through the C
preprocessor and rummaging through the output looking for "extern"
declarations.  We do this somewhat selectively, so the movement of
routines into children of perl.h can prevent their inclusion in the
shareable image and cause link errors, such as we've been seeing for
PerlIO_getpos and PerlIO_setpos.

The patch below includes a modification to vms/ that
causes it to include symbols from perlio.h and corrects those link
errors.  However, this casts the net rather too widely since not all
extern prototypes in perlio.h actually exist when stdio is being used
for PerlIO, so we end up telling the shareable image to include
symbols that can't be resolved, generating link errors when we
attempt to create the image.  Consequently the patch also tinkers
with perlio.h to hide those symbols that aren't needed when
PERLIO_IS_STDIO is defined.

--- perlio.h;-0 Mon Dec 11 21:31:32 2000
+++ perlio.h    Sat Dec 16 18:43:38 2000
@@ -307,7 +307,7 @@
  #ifndef PerlIO_fdupopen
  extern PerlIO *        PerlIO_fdupopen         (pTHX_ PerlIO *);
-#ifndef PerlIO_modestr
+#if !defined(PerlIO_modestr) && !defined(PERLIO_IS_STDIO)
  extern char *PerlIO_modestr            (PerlIO *,char *buf);
  #ifndef PerlIO_isutf8
@@ -320,9 +320,11 @@
  extern int     PerlIO_binmode          (pTHX_ PerlIO *f, int iotype, 
int omode, const char *names);

  extern void PerlIO_cleanup();

  extern void PerlIO_debug(const char *fmt,...);


--- vms/;-0        Mon Dec 11 21:32:24 2000
+++ vms/   Sat Dec 16 13:46:21 2000
@@ -172,7 +172,7 @@
  else {
    open(CPP,"$cpp_file") or die "$0: Can't read preprocessed file 
$cpp_file: $!\n";
-%checkh = map { $_,1 } qw( thread bytecode byterun proto );
+%checkh = map { $_,1 } qw( thread bytecode byterun proto perlio );
  $ckfunc = 0;
  LINE: while (<CPP>) {
    while (/^#.*vmsish\.h/i .. /^#.*perl\.h/i) {
[end of patch]

"Scholarship...  It's where we're nearest to our humanness.
Useless knowledge for its own sake.  Useful knowledge is
good too, but it's for the faint-hearted."

Housman, in Tom Stoppard's The Invention of Love

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About