patches for Neutrino port

Sam Roberts sroberts at uniserve.com
Sun Mar 26 15:28:14 CEST 2000


Here are the patches for QNX/Neutrino, mostly checking for ENOSYS
in a few places, all one or less lines, except for the config system
guessing stuff.

QSSL gave me the diffs for the scripts they use in-house to build
on ppc, arm, intel, etc. for QNX4 and QNX/Neutrino, so my QNX4 specific
hacks should be replaced by these (at the end of the file).

Thanks!
Sam

===============

Need another line in the checks fix-up file.

diff -rc4 gnupg-1.0.1-orig/checks/run-gpg.patterns gnupg-1.0.1/checks/run-gpg.patterns
*** gnupg-1.0.1-orig/checks/run-gpg.patterns    Fri Feb 19 09:53:50 1999
--- gnupg-1.0.1/checks/run-gpg.patterns Sun Mar 26 01:41:54 2000
***************
*** 6,11 ****
--- 6,12 ----
  gpg: NOTE: cipher algorithm 4 not found in preferences
  gpg: NOTE: secret key 2E5FA4F4 is NOT protected.
  gpg: NOTE: secret key 439F02CA is NOT protected.
  gpg: WARNING: using insecure random number generator
+ gpg: WARNING: program may create a core file!
  gpg: NOTE: signature key expired
  NOTE: this is a development version!

================

The call exists, but it's not implemented yet. The whole thing things
optional anyhow, so sudden death isn't really necessary in this case.

diff -rc4 gnupg-1.0.1-orig/cipher/random.c gnupg-1.0.1/cipher/random.c
*** gnupg-1.0.1-orig/cipher/random.c    Tue Oct 26 13:36:58 1999
--- gnupg-1.0.1/cipher/random.c Thu Mar 16 09:21:05 2000
***************
*** 413,421 ****
    #warning There is no RUSAGE_SELF on this system
        #endif
      #else
      { struct rusage buf;
!   if( getrusage( RUSAGE_SELF, &buf ) )
        BUG();
    add_randomness( &buf, sizeof buf, 1 );
    memset( &buf, 0, sizeof buf );
      }
--- 413,421 ----
    #warning There is no RUSAGE_SELF on this system
        #endif
      #else
      { struct rusage buf;
!   if( getrusage( RUSAGE_SELF, &buf ) && errno != ENOSYS)
        BUG();
    add_randomness( &buf, sizeof buf, 1 );
    memset( &buf, 0, sizeof buf );
      }
=================

Neutrino currently has so few of the rndunix utilites that gpg takes *forever*
to collect any randomness, here's a few it does have.

diff -rc4 gnupg-1.0.1-orig/cipher/rndunix.c gnupg-1.0.1/cipher/rndunix.c
*** gnupg-1.0.1-orig/cipher/rndunix.c   Sat Oct  9 09:43:12 1999
--- gnupg-1.0.1/cipher/rndunix.c    Thu Mar 16 12:30:51 2000
***************
*** 230,237 ****
--- 231,239 ----
      { "/bin/ps", "-el", SC(0.3), NULL, 0, 0, 0, 1           },
  #endif                /* __sgi || __hpux */
      { "/usr/ucb/ps", "aux", SC(0.3), NULL, 0, 0, 0, 1       },
      { "/usr/bin/ps", "aux", SC(0.3), NULL, 0, 0, 0, 1       },
+     { "/bin/ps", "-A", SC(0.3), NULL, 0, 0, 0, 1           },
      { "/bin/ps", "aux", SC(0.3), NULL, 0, 0, 0, 0          },
      { "/usr/bin/ipcs", "-a", SC(0.5), NULL, 0, 0, 0, 1      },
      { "/bin/ipcs", "-a", SC(0.5), NULL, 0, 0, 0, 0         },
      /* Unreliable source, depends on system usage */
***************
*** 279,286 ****
--- 281,292 ----
                SC(SC_0), NULL, 0, 0, 0, 0},
      /* This is a complex and screwball program.  Some systems have things
       * like rX_dmn, x = integer, for RAID systems, but the statistics are
       * pretty dodgy */
+ #ifdef __QNXNTO__
+     { "/bin/pidin", "-F%A%B%c%d%E%I%J%K%m%M%n%N%p%P%S%s%T", SC(0.3),
+       NULL, 0, 0, 0, 0       },
+ #endif
  #if 0
      /* The following aren't enabled since they're somewhat slow and not very
       * unpredictable, however they give an indication of the sort of sources
       * you can use (for example the finger might be more useful on a

==================

Again, you can call it but it don't do nuthin'

diff -rc4 gnupg-1.0.1-orig/g10/misc.c gnupg-1.0.1/g10/misc.c
*** gnupg-1.0.1-orig/g10/misc.c Mon Aug 30 14:48:50 1999
--- gnupg-1.0.1/g10/misc.c  Wed Mar 15 11:36:37 2000
***************
*** 89,97 ****
      limit.rlim_cur = 0;
      limit.rlim_max = 0;
      if( !setrlimit( RLIMIT_CORE, &limit ) )
    return;
!     if( errno != EINVAL )
    log_fatal(_("can't disable core dumps: %s\n"), strerror(errno) );
    #endif
      if( !opt.quiet )
    log_info(_("WARNING: program may create a core file!\n"));
--- 89,97 ----
      limit.rlim_cur = 0;
      limit.rlim_max = 0;
      if( !setrlimit( RLIMIT_CORE, &limit ) )
    return;
!     if( errno != EINVAL && errno != ENOSYS )
    log_fatal(_("can't disable core dumps: %s\n"), strerror(errno) );
    #endif
      if( !opt.quiet )
    log_info(_("WARNING: program may create a core file!\n"));

==================

Conversations with QSSL are ongoing in the beta groups now, but currently
ANON isn't working like it should, so:

diff -rc4 gnupg-1.0.1-orig/util/secmem.c gnupg-1.0.1/util/secmem.c
*** gnupg-1.0.1-orig/util/secmem.c  Sun Nov 14 13:55:27 1999
--- gnupg-1.0.1/util/secmem.c   Sun Mar 26 04:55:49 2000
***************
*** 168,176 ****
    #endif

    #if HAVE_MMAP
      poolsize = (poolsize + pgsize -1 ) & ~(pgsize-1);
!     #ifdef MAP_ANONYMOUS
         pool = mmap( 0, poolsize, PROT_READ|PROT_WRITE,
                 MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
      #else /* map /dev/zero instead */
      { int fd;
--- 168,176 ----
    #endif

    #if HAVE_MMAP
      poolsize = (poolsize + pgsize -1 ) & ~(pgsize-1);
!     #if defined(MAP_ANONYMOUS) && ! defined(__QNXNTO__)
         pool = mmap( 0, poolsize, PROT_READ|PROT_WRITE,
                 MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
      #else /* map /dev/zero instead */
      { int fd;
==================


Following is the heaftier patches for system guessing:

diff -rc4 gnupg-1.0.1-orig/scripts/config.guess gnupg-1.0.1/scripts/config.guess
*** gnupg-1.0.1-orig/scripts/config.guess   Wed Aug  4 04:45:24 1999
--- gnupg-1.0.1/scripts/config.guess    Tue Mar 14 10:48:43 2000
***************
*** 67,74 ****
--- 67,83 ----

  # Note: order is significant - the case branches are not exclusive.

  case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+     *:procnto*:*:* | *:QNX:[0123456789]*:*)
+   if test "${UNAME_MACHINE}" = "x86pc"; then
+       UNAME_MACHINE=pc
+   fi
+   echo `uname -p`-${UNAME_MACHINE}-nto-qnx
+   exit 0;;
+     *:QNX:*:4*)
+   echo i386-pc-qnx
+   exit 0 ;;
      alpha:OSF1:*:*)
    if test $UNAME_RELEASE = "V4.0"; then
        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
    fi
diff -rc4 gnupg-1.0.1-orig/scripts/config.sub gnupg-1.0.1/scripts/config.sub
*** gnupg-1.0.1-orig/scripts/config.sub Wed Aug  4 04:45:25 1999
--- gnupg-1.0.1/scripts/config.sub  Tue Mar 14 11:02:31 2000
***************
*** 67,75 ****
  # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
  # Here we must recognize all the valid KERNEL-OS combinations.
  maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
  case $maybe_os in
!   linux-gnu*)
      os=-$maybe_os
      basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
      ;;
    *)
--- 67,75 ----
  # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
  # Here we must recognize all the valid KERNEL-OS combinations.
  maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
  case $maybe_os in
!   nto-qnx* | linux-gnu*)
      os=-$maybe_os
      basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
      ;;
    *)
***************
*** 164,171 ****
--- 164,172 ----
    # Some are omitted here because they have special meanings below.
    tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
        | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
        | 580 | i960 | h8300 \
+       | x86 | ppcbe | mipsbe | mipsle | shbe | shle | armbe | armle \
        | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
        | alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \
        | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
        | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
***************
*** 195,202 ****
--- 196,204 ----
          | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
          | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
          | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
          | xmp-* | ymp-* \
+         | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* | armbe-* | armle-* \
          | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
          | alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \
          | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
          | clipper-* | orion-* \
***************
*** 459,466 ****
--- 461,471 ----
    i386-mingw32 | mingw32)
        basic_machine=i386-unknown
        os=-mingw32
        ;;
+   i386-qnx | qnx)
+       basic_machine=i386-qnx
+       ;;
    iris | iris4d)
        basic_machine=mips-sgi
        case $os in
            -irix*)
***************
*** 880,887 ****
--- 885,895 ----
        ;;
    -solaris)
        os=-solaris2
        ;;
+   -qnx)
+       os=-qnx
+       ;;
    -svr4*)
        os=-sysv4
        ;;
    -unixware*)
***************
*** 909,916 ****
--- 917,936 ----
          | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
          | -interix* | -uwin* | -rhapsody* | -openstep* | -oskit*)
    # Remember, each alternative MUST END IN *, to match a version number.
        ;;
+   -qnx*)
+       case $basic_machine in
+           x86-* | i[34567]86-*)
+               ;;
+           *)
+               os=-nto$os
+               ;;
+       esac
+       ;;
+   -nto*)
+       os=-nto-qnx
+       ;;
    -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
          | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
          | -macos* | -mpw* | -magic* | -mon960* | -lnews*)
        ;;
***************
*** 962,969 ****
--- 982,992 ----
        ;;
    -oss*)
        os=-sysv3
        ;;
+   -qnx)
+       os=-qnx4
+       ;;
    -svr4)
        os=-sysv4
        ;;
    -svr3)
***************
*** 986,993 ****
--- 1009,1019 ----
        ;;
          -*mint | -*MiNT)
            os=-mint
        ;;
+   -neutrino* | -nto*)
+       os=-neutrino
+       ;;
    -none)
        ;;
    *)
        # Get rid of the `-' at the beginning of $os.
***************
*** 1205,1212 ****
--- 1231,1241 ----
                vendor=apple
                ;;
            -*mint | -*MiNT)
                vendor=atari
+               ;;
+           -neutrino* | -nto*)
+               vendor=qnx
                ;;
        esac
        basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
        ;;



More information about the Gnupg-devel mailing list