The current file-set, downloaded from openssl.org on 5 May 2000 fails to build
on SunOS 4.1.4. Hardware is SPARC, obviously.  Same results with cc and gcc.

There are three routines used in the code-set that do not exist in this O/S
environment.

   strtoul(), used in  crypto/asn1/a_strnid.c
   strerror(), used in crypto/err/err.c
and
   memmove(), used in /bio/bss_mem.c, bio/bss_rtcp.c, exp/bio_ok.c, and
     ssl/s3_pkt.c



The following additional code is a functional work-around, without touching
any of the existant source.  2 changes required to Makefiles.  a reference
for this routine must be added in the OBJS list in apps/Makefile, and the
'test' code also requires this routine. ( I took the 'lazy' way out on that,
and just added it to the LIBCRYPTO= directive -- sloppy, but effective :)

The -right- way to handle these dependencies is with tests in the configure
script, and #ifdef'd code in the offending source files.

'Somebody' already did a patch on crypto/stack/stack.c that removed a call
  to memmove(), and substituted a in-line copy loop.  with comment that 
  "memmove() doesn't exist on SunOS 4.1.3 :( ".

_That_  patch is badly done.  The old code is 'commented out' vi an 
"#ifdef undef", and the new code is inserted _unconditionally_.  If someone
were to try to use the other code, by "merely" #define-ing 'undef', they'd
get the copy operation _twice_  -- with catastrophic results, as this use is
essentially a 'one-character right-shift' of the string.

Either the old code should be removed completely, relying on CVS for the
'history', or the two code-paths should be in an #ifdef / #else / #endif
structure -- such that one option, and *only* one option, gets compiled in.


/*  macro alternatives, first requires the two extern definitions, tho */
/*  extern int sys_nerr;                                               */
/*  extern char *sys_errlist[];                                        */
/*  #define strerror(x)   (x<0 || x>sys_nerr)?(char*)0:sys_errlist[x]) */
/*  #define strtoul(a,b,c)  ((unsigned)strtol(a,b,c))                  */
/*                                                                     */
/*   no macro substitute for 'memmove()'                               */

char *strerror(value)
int value;
{  extern char *sys_errlist[];
   extern int  sys_nerr;   /* defined size of sys_errlist[] */

   if (value< 0 || value >= sys_nerr ) 
      return( (char *)0 );
   return( sys_errlist[value] );
}

unsigned long strtoul(x,y,z)
char *x;
char *y;
int z;
{
   return( (unsigned) strtol(x,y,z) );
}


char *memmove(s1,s2,count)
char *s1;
char *s2;
int count;
{  register char *to   = s1;
   register char *from = s2;
   register int  len   = count;

   if (to > from && (from+len) > to)
   { /*  move backwards */
      to += len;
      from += len;
      while (len--)
         *--to = *--from;
   }
   else
   { /*  move forwards */
      while (len--)
         *to++ = *from++;
   }
   return(s1);
}

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to