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

Perl 5.004 on LynxOS 3.0.1 #447

Closed
p5pRT opened this issue Aug 27, 1999 · 18 comments
Closed

Perl 5.004 on LynxOS 3.0.1 #447

p5pRT opened this issue Aug 27, 1999 · 18 comments

Comments

@p5pRT
Copy link

p5pRT commented Aug 27, 1999

Migrated from rt.perl.org#1288 (status was 'resolved')

Searchable as RT1288$

@p5pRT
Copy link
Author

p5pRT commented Aug 27, 1999

From johnson@alonn.gemse.fr

Hi,

I have built and installed perl on Lynx OS 3.0.1 which is a real time
unix operating system.

It was very easy. Configure worked well but I had 3 minor problems
I thought I should let you know about. I have attached 3 context
difference files which overcome these problems although you may want
to use different solutions. This should make life even easier for
anyone else using perl with LynxOS.

Operating system​:
LynxOS icarus 3.0.1 110298-G i386

Perl​:
This is perl, version 5.004

Problem 1.

sdbm.c would not build.
This was due to function prototypes for malloc and free in the source
file. I conditionally compiled these out based on whether __std_lib_h
was defined. A better solution may be to remove them altogether or
use safealloc.

see sdbm.c.diff

Problem 2.

magic test 23 failed. We were seeing the script name as the
perl executable name. I modified magic.t to skip this test
for lynx OS systems. I guess this is a hack but I attach a diff
file anyway.

see magic.t.diff

Problem 3.

safe2 test 30 failed. This is just because the operating system
error string does not match any of the expected error strings.
I added a string which does match.

see safe2.t.diff

  thanks AJ

@p5pRT
Copy link
Author

p5pRT commented Aug 27, 1999

From johnson@alonn.gemse.fr

sdbm.c.diff
*** ../perl5.004/ext/SDBM_File/sdbm/sdbm.c	Sun Apr 13 19:23:55 1997
--- ../perl5.004.lynx.3.0.1/ext/SDBM_File/sdbm/sdbm.c	Fri Aug 27 03:21:17 1999
***************
*** 36,44 ****
  #ifndef sun
  extern int errno;
  #endif
! 
  extern Malloc_t malloc proto((MEM_SIZE));
  extern Free_t free proto((Malloc_t));
  extern Off_t lseek();
  #endif
  
--- 36,45 ----
  #ifndef sun
  extern int errno;
  #endif
! #ifndef __stdlib_h /* Added AJ 27/8/99 LynxOS 3.0.1 build */
  extern Malloc_t malloc proto((MEM_SIZE));
  extern Free_t free proto((Malloc_t));
+ #endif
  extern Off_t lseek();
  #endif
  

@p5pRT
Copy link
Author

p5pRT commented Aug 27, 1999

From johnson@alonn.gemse.fr

magic.t.diff
*** ../perl5.004/t/op/magic.t	Fri Apr  4 15:10:49 1997
--- ../perl5.004.lynx.3.0.1/t/op/magic.t	Fri Aug 27 02:25:43 1999
***************
*** 22,27 ****
--- 22,29 ----
  $Is_MSWin32 = ($^O eq 'MSWin32');
  $PERL = ($Is_MSWin32 ? '.\perl' : './perl');
  
+ $Is_LynxOS = ($^O =~ m/lynx/i);
+ 
  print "1..28\n";
  
  eval '$ENV{"foo"} = "hi there";';	# check that ENV is inited inside eval
***************
*** 129,138 ****
--- 131,143 ----
  EOF
      ok 21, close(SCRIPT), $!;
      ok 22, chmod(0755, $script), $!;
+     if ( $Is_LynxOS ) { ok 23, 1 }
+     else {
      $_ = `$script`;
      s{\bminiperl\b}{perl}; # so that test doesn't fail with miniperl
      s{is perl}{is $wd/perl}; # for systems where $^X is only a basename
      ok 23, $_ eq $s2, ":$_:!=:$s2:";
+     }
      $_ = `$wd/perl $script`;
      ok 24, $_ eq $s1, ":$_:!=:$s1: after `$wd/perl $script`";
      ok 25, unlink($script), $!;

@p5pRT
Copy link
Author

p5pRT commented Aug 27, 1999

From johnson@alonn.gemse.fr

safe2.t.diff
*** ../perl5.004/t/lib/safe2.t	Wed Jan 29 09:33:11 1997
--- ../perl5.004.lynx.3.0.1/t/lib/safe2.t	Fri Aug 27 02:33:01 1999
***************
*** 121,126 ****
--- 121,127 ----
  $cpt->rdo('/non/existant/file.name');
  print +(($! =~ /No such file/ || $! =~ /file specification syntax error/) ||
        $! =~ /A file or directory in the path name does not exist/ ||
+       $! =~ /directory doesn't exist/ ||        
        $! =~ /Device not configured/ ?
        "ok $t\n" : "not ok $t # $!\n"); $t++;
  print 1 ? "ok $t\n" : "not ok $t\n#$@/$!\n"; $t++;

@p5pRT
Copy link
Author

p5pRT commented Sep 6, 1999

From @gsar

On Fri, 27 Aug 1999 17​:30​:10 BST, Alan Johnson wrote​:

I have built and installed perl on Lynx OS 3.0.1 which is a real time
unix operating system.

It was very easy. Configure worked well but I had 3 minor problems
I thought I should let you know about. I have attached 3 context
difference files which overcome these problems although you may want
to use different solutions. This should make life even easier for
anyone else using perl with LynxOS.

Operating system​:
LynxOS icarus 3.0.1 110298-G i386

Perl​:
This is perl, version 5.004

This should actually be Problem 0. :-)

5.004 is more than three years old, and much has happened since
then. If you can try 5.005_61 and report back to us, that would be
great.

Problem 1.

sdbm.c would not build.

Sarathy
gsar@​activestate.com

@p5pRT
Copy link
Author

p5pRT commented Sep 7, 1999

From [Unknown Contact. See original ticket]

Gurusamy Sarathy wrote​:

On Fri, 27 Aug 1999 17​:30​:10 BST, Alan Johnson wrote​:

I have built and installed perl on Lynx OS 3.0.1 which is a real time
unix operating system.

....

5.004 is more than three years old, and much has happened since
then. If you can try 5.005_61 and report back to us, that would be
great.

Thanks for your message.

I have built 5.005_61 on LynxOS 3.0.1. I had a number of problems​:

This is perl, version 5.005_61 built for i386-lynxos

uname -a
LynxOS cypress 3.0.1 110298-G i386

I had a number of problems which I have fixed and one which I have not
fixed (see 6. below).

1. perl.h

During configuration the Configuration script attempts to
detect if the 'semun' union is defined. It does this by
compiling a small c program that uses the structure.
LynxOS defines this structure but unfortunately in a
slightly non standard way. The standard definition is​:

union semun {
  int val;
  struct semid_ds *buf;
  unsigned short *array;
  }

Lynx defines it as​:
union semun {
  int val;
  struct semid_ds *buff;
/* ^ an extra f! */
  unsigned short *array;
  };

This make Configure think the union is not defined and to use
its own definition. This then conflicts with the LynxOs definition
and doio.c will not build.

I fixed this by always defining a typedef for a new type called
perl_semun. This can be defined as the inbuilt semun or
the perls safely. I have attached a context diff for this. You may
want to fix it a different way, in any case I am meeting with
the OS vendors next week and will ask them to change the
header file (I can at least ask) in a future release.

2/. pp_sys.c

This would not build because it uses FD_CLOEXEC but did not include
fcntl.h. This was because HAS_FLOCK and HAS_FCNTL were defined but
not I_FCNTL. The configuration of this is quite complex and I do
not know what problems on other system types it is intended to avoid. I
simply added the include of fcntl.h in these circumstances but
this may be a problem on other systems. I have attached a diff file.

3/. safe2.t

This fails because the Lynx eror message for test 30 does not match one
of the expected message strings. There is already a large number of
alternatives so I added yet another. See the attached file.

4/. groups.t

Lynx doesn't seem to have a command that lists all the available
groups so I have modified the test to skip. See the attached file.

5/. magic.t

I think Lynx has a problem with argv[0] anyway we get the script name
not the interpretter name. I have disabled test 23.
see attached file.

6/. io_unix.t

This fails in a big way. perl core dumps generating a core file with
no stack. This appears to happen after fork(). I have not had time to
look at why this occurs but I will try to get time to do this in a
few days time.

I hope this is useful information.

  AJ

@p5pRT
Copy link
Author

p5pRT commented Sep 7, 1999

From [Unknown Contact. See original ticket]

perl.h.diff
*** perl.h.config	Tue Sep  7 13:44:27 1999
--- perl.h	Tue Sep  7 13:55:25 1999
***************
*** 3099,3109 ****
  #   include <sys/ipc.h>
  #   include <sys/sem.h>
  #   ifndef HAS_UNION_SEMUN	/* Provide the union semun. */
!     union semun {
  	int val;
  	struct semid_ds *buf;
  	unsigned short *array;
!     };
  #   endif
  #   ifdef USE_SEMCTL_SEMUN
  #       define Semctl(id, num, cmd, semun) semctl(id, num, cmd, semun)
--- 3099,3111 ----
  #   include <sys/ipc.h>
  #   include <sys/sem.h>
  #   ifndef HAS_UNION_SEMUN	/* Provide the union semun. */
!     typedef union {
  	int val;
  	struct semid_ds *buf;
  	unsigned short *array;
!     } perl_semun;
! #   else
!     typedef union semun perl_semun;
  #   endif
  #   ifdef USE_SEMCTL_SEMUN
  #       define Semctl(id, num, cmd, semun) semctl(id, num, cmd, semun)

@p5pRT
Copy link
Author

p5pRT commented Sep 7, 1999

From [Unknown Contact. See original ticket]

pp_sys.c.diff
*** pp_sys.c.org	Tue Sep  7 14:27:39 1999
--- pp_sys.c	Tue Sep  7 16:42:04 1999
***************
*** 137,142 ****
--- 137,145 ----
  
  #ifdef HAS_FLOCK
  #  define FLOCK flock
+ #  ifdef HAS_FCNTL
+ #    include <fcntl.h>
+ #  endif
  #else /* no flock() */
  
     /* fcntl.h might not have been included, even if it exists, because

@p5pRT
Copy link
Author

p5pRT commented Sep 7, 1999

From [Unknown Contact. See original ticket]

safe2.t.diff
*** lib/safe2.t.org	Tue Sep  7 15:55:30 1999
--- lib/safe2.t	Tue Sep  7 15:57:26 1999
***************
*** 124,130 ****
  my $t = 30;
  $cpt->rdo('/non/existant/file.name');
  # The regexp is getting rather baroque.
! print $! =~ /No such file|file specification syntax error|A file or directory in the path name does not exist|Invalid argument|Device not configured|file not found/i ? "ok $t\n" : "not ok $t # $!\n"; $t++;
  # test #31 is gone.
  print 1 ? "ok $t\n" : "not ok $t\n#$@/$!\n"; $t++;
    
--- 124,130 ----
  my $t = 30;
  $cpt->rdo('/non/existant/file.name');
  # The regexp is getting rather baroque.
! print $! =~ /No such file|file specification syntax error|A file or directory in the path name does not exist|Invalid argument|Device not configured|file not found|File or directory doesn't exist/i ? "ok $t\n" : "not ok $t # $!\n"; $t++;
  # test #31 is gone.
  print 1 ? "ok $t\n" : "not ok $t\n#$@/$!\n"; $t++;
    

@p5pRT
Copy link
Author

p5pRT commented Sep 7, 1999

From [Unknown Contact. See original ticket]

groups.t.diff
*** op/groups.t.org	Tue Sep  7 15:24:29 1999
--- op/groups.t	Tue Sep  7 15:34:05 1999
***************
*** 10,16 ****
      exit 0;
  }
  
! quit() if $^O eq 'MSWin32';
  
  # We have to find a command that prints all (effective
  # and real) group names (not ids).  The known commands are:
--- 10,17 ----
      exit 0;
  }
  
! quit() if ($^O eq 'MSWin32' || $^O =~ m/lynxos/i);
! 
  
  # We have to find a command that prints all (effective
  # and real) group names (not ids).  The known commands are:

@p5pRT
Copy link
Author

p5pRT commented Sep 7, 1999

From [Unknown Contact. See original ticket]

magic.t.diff
*** op/magic.t.org	Tue Sep  7 16:50:33 1999
--- op/magic.t	Tue Sep  7 15:44:55 1999
***************
*** 23,28 ****
--- 23,30 ----
  $Is_VMS     = $^O eq 'VMS';
  $Is_Dos   = $^O eq 'dos';
  $Is_Cygwin   = $^O =~ /cygwin/;
+ $Is_LynxOS = ($^O =~ m/lynx/i);
+ 
  $PERL = ($Is_MSWin32 ? '.\perl' : './perl');
  
  print "1..35\n";
***************
*** 157,168 ****
--- 159,173 ----
  EOF
      ok 21, close(SCRIPT), $!;
      ok 22, chmod(0755, $script), $!;
+     if ( $Is_LynxOS ) { ok "23 # skipped", 1 }
+     else {
      $_ = `$script`;
      s/\.exe//i if $Is_Dos or $Is_Cygwin;
      s{\bminiperl\b}{perl}; # so that test doesn't fail with miniperl
      s{is perl}{is $perl}; # for systems where $^X is only a basename
      s{\\}{/}g;
      ok 23, ($Is_MSWin32 ? uc($_) eq uc($s1) : $_ eq $s1), ":$_:!=:$s1:";
+     }
      $_ = `$perl $script`;
      s/\.exe//i if $Is_Dos;
      s{\\}{/}g;

@p5pRT
Copy link
Author

p5pRT commented Sep 7, 1999

From @gsar

On Tue, 07 Sep 1999 16​:58​:29 BST, Alan Johnson wrote​:

5/. magic.t

I think Lynx has a problem with argv[0] anyway we get the script name
not the interpretter name. I have disabled test 23.
see attached file.

grep for ARG_ZERO_IS_SCRIPT in toke.c, and see if enabling it
helps.

Thanks.

Sarathy
gsar@​activestate.com

@p5pRT
Copy link
Author

p5pRT commented Sep 8, 1999

From [Unknown Contact. See original ticket]

Gurusamy Sarathy wrote​:

On Tue, 07 Sep 1999 16​:58​:29 BST, Alan Johnson wrote​:

5/. magic.t

I think Lynx has a problem with argv[0] anyway we get the script name
not the interpretter name. I have disabled test 23.
see attached file.

grep for ARG_ZERO_IS_SCRIPT in toke.c, and see if enabling it
helps.

This works. I have added it to the hints file for LynxOS.

Thanks.

Sarathy
gsar@​activestate.com

@p5pRT
Copy link
Author

p5pRT commented Sep 8, 1999

From [Unknown Contact. See original ticket]

lynxos.sh

@p5pRT
Copy link
Author

p5pRT commented Sep 8, 1999

From [Unknown Contact. See original ticket]

lynxos.sh

@p5pRT
Copy link
Author

p5pRT commented Sep 13, 1999

From [Unknown Contact. See original ticket]

Hi,

I have been working on getting perl 5.005_61 working on
LynxOS 3.0.1 i386.

I had a problem with perl core dumping in the io_unix test.
This turned out to be because a bug in LynxOS. The accept call was
ignoring the address structure length parameter. This was
causing the accept call to overwrite the stack with predictable
consequences.

I have made a fix which uses the AF_UNIX family address structure
if the new macro ACCEPT_LEN_BROKEN is set. It also needs to
include a new header sys/un.h in this case. I have added a line
to hints/lynxos.sh to define ACCEPT_LEN_BROKEN. I do not
like the fix so if you can think of a better way please do so.

I have attached lynxos.sh and the context diff for pp_sys.c

With the other changes I sent in earlier everything now seems to
work fine under LynxOS.

  thanks AJ

@p5pRT
Copy link
Author

p5pRT commented Sep 13, 1999

From [Unknown Contact. See original ticket]

pp_sys.c.diff
*** pp_sys.c.org	Fri Aug 20 08:52:00 1999
--- pp_sys.c	Mon Sep 13 16:31:00 1999
***************
*** 45,50 ****
--- 45,53 ----
  #endif
  
  #if defined(HAS_SOCKET) && !defined(VMS) /* VMS handles sockets via vmsish.h */
+ #ifdef ACCEPT_LEN_BROKEN
+ #include <sys/un.h>
+ #endif
  # include <sys/socket.h>
  # if defined(USE_SOCKS) && defined(I_SOCKS)
  #   include <socks.h>
***************
*** 65,70 ****
--- 68,74 ----
  #endif
  #endif
  
+ 
  /* XXX Configure test needed.
     h_errno might not be a simple 'int', especially for multi-threaded
     applications, see "extern int errno in perl.h".  Creating such
***************
*** 137,142 ****
--- 141,149 ----
  
  #ifdef HAS_FLOCK
  #  define FLOCK flock
+ #  ifdef HAS_FCNTL
+ #    include <fcntl.h>
+ #  endif
  #else /* no flock() */
  
     /* fcntl.h might not have been included, even if it exists, because
***************
*** 2183,2189 ****
--- 2190,2200 ----
      GV *ggv;
      register IO *nstio;
      register IO *gstio;
+ #ifdef ACCEPT_LEN_BROKEN
+     struct sockaddr_un saddr;	/* use a struct to avoid alignment problems */
+ #else
      struct sockaddr saddr;	/* use a struct to avoid alignment problems */
+ #endif
      Sock_size_t len = sizeof saddr;
      int fd;
  

@p5pRT
Copy link
Author

p5pRT commented Sep 13, 1999

From [Unknown Contact. See original ticket]

lynxos.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant