[I'm not subscribed to openssl-dev, please cc me on any responses]

The patch after my sig, originally made against 0.9.6a but still valid
for 0.9.6b, improves OpenSSL's support for Digital/Tru64 UNIX.

The patch makes the following changes:

1) Changes all references for `True64' to be `Tru64', which is the correct
spelling for the OS name.

2) Makes `alpha-cc' be the same as `alpha164-cc', and adds an `alphaold-cc'
entry that is the same as the previous `alpha-cc'.  The reason is that most
people these days are using the newer compiler, so it should be the default.

3) Adds a bit of commentary to Configure, regarding the name changes of
the OS over the years, so it's not so confusing to people that haven't been
with the OS for a while.

4) Adds an `alpha-cc-rpath' target (which is *not* selected automatically
by Configure under any circumstance) that builds an RPATH into the
shared libraries.  This is explained in the comment in Configure.  It's
very very useful for people that want it, and people that don't want it
just shouldn't choose that target.

5) Adds the `-pthread' flag as the best way to get POSIX thread support
from the newer compiler.

6) Updates the Makefile targets, so that when the `alpha164-cc', `alpha-cc',
or `alpha-cc-rpath' target is what Configure is set to use, it uses a Makefile
target that includes the `-msym' option when building the shared library.
This is a performance enhancement.

7) Updates `config' so that if it detects you're running version 4 or 5
of the OS, it automatically selects `alpha-cc', but uses `alphaold-cc'
for versions 1-3 of the OS.

8) Updates the comment in opensslv.h, fixing both the OS name typo and
adding a reference to IRIX 6.x, since the shared library semantics are
virtually identical there.

Please let me know if there are parts of the patch that should be reworked
for some reason.

Tim
-- 
Tim Mooney                              [EMAIL PROTECTED]
Information Technology Services         (701) 231-1076 (Voice)
Room 242-J6, IACC Building              (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164


diff -ur openssl-0.9.6a.orig/CHANGES openssl-0.9.6a/CHANGES
--- openssl-0.9.6a.orig/CHANGES Thu Apr  5 15:07:47 2001
+++ openssl-0.9.6a/CHANGES      Thu Apr 12 15:52:05 2001
@@ -636,7 +636,7 @@
      default is static libraries only, and the OpenSSL programs
      are always statically linked for now, but there are
      preparations for dynamic linking in place.
-     This has been tested on Linux and True64.
+     This has been tested on Linux and Tru64.
      [Richard Levitte]

   *) Randomness polling function for Win9x, as described in:
diff -ur openssl-0.9.6a.orig/Configure openssl-0.9.6a/Configure
--- openssl-0.9.6a.orig/Configure       Thu Apr  5 15:07:55 2001
+++ openssl-0.9.6a/Configure    Thu Apr 12 15:53:51 2001
@@ -264,12 +264,39 @@
 #### HP MPE/iX http://jazz.external.hp.com/src/openssl/
 "MPE/iX-gcc", "gcc:-D_ENDIAN -DBN_DIV2W -O3 -DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE 
-I/SYSLOG/PUB::(unknown):-L/SYSLOG/PUB -lsyslog -lsocket -lcurses:BN_LLONG DES_PTR 
DES_UNROLL DES_RISC1:::",

-# Dec Alpha, OSF/1 - the alpha164-cc is the flags for a 21164A with
-# the new compiler
+# Dec Alpha, OSF/1 - the alpha164-cc is historical, for the conversion
+# from the older DEC C Compiler to the newer compiler.  It's now the
+# same as the preferred entry, alpha-cc.  If you are still using the
+# older compiler (you're at 3.x or earlier, or perhaps very early 4.x)
+# you should use `alphaold-cc'.
+#
+#      "What's in a name? That which we call a rose
+#       By any other word would smell as sweet."
+#
+# - William Shakespeare, "Romeo & Juliet", Act II, scene II.
+#
+# For OSF/1 3.2b and earlier, and Digital UNIX 3.2c - 3.2g, with the
+# vendor compiler, use alphaold-cc.
+# For Digital UNIX 4.0 - 4.0e, with the vendor compiler, use alpha-cc.
+# For Tru64 UNIX 4.f - current, with the vendor compiler, use alpha-cc.
+#
+# There's also an alternate target available (which `config' will never
+# select) called alpha-cc-rpath.  This target builds an RPATH into the
+# shared libraries, which is very convenient on Tru64 since binaries
+# linked against that shared library will automatically inherit that RPATH,
+# and hence know where to look for the openssl libraries, even if they're in
+# an odd place.
+#
 # For gcc, the following gave a %50 speedup on a 164 over the 'DES_INT' version
-"alpha-gcc","gcc:-O3::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL 
DES_RISC1:${alpha_asm}:dlfcn:tru64-shared::.so",
-"alpha-cc", "cc:-std1 -tune host -O4 
-readonly_strings::(unknown)::SIXTY_FOUR_BIT_LONG 
RC4_CHUNK:${alpha_asm}:dlfcn:tru64-shared::.so",
-"alpha164-cc", "cc:-std1 -tune host -fast 
-readonly_strings::(unknown)::SIXTY_FOUR_BIT_LONG 
RC4_CHUNK:${alpha_asm}:dlfcn:tru64-shared::.so",
+#
+"alpha-gcc","gcc:-O3::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL 
+DES_RISC1:${alpha_asm}:dlfcn:alpha-osf1-shared::.so",
+"alphaold-cc", "cc:-std1 -tune host -O4 
+-readonly_strings::(unknown)::SIXTY_FOUR_BIT_LONG 
+RC4_CHUNK:${alpha_asm}:dlfcn:alpha-osf1-shared::.so",
+"alpha164-cc", "cc:-std1 -tune host -fast 
+-readonly_strings::-pthread::SIXTY_FOUR_BIT_LONG 
+RC4_CHUNK:${alpha_asm}:dlfcn:tru64-shared::.so",
+"alpha-cc", "cc:-std1 -tune host -fast 
+-readonly_strings::-pthread::SIXTY_FOUR_BIT_LONG 
+RC4_CHUNK:${alpha_asm}:dlfcn:tru64-shared::.so",
+"alpha-cc-rpath", "cc:-std1 -tune host -fast 
+-readonly_strings::-pthread::SIXTY_FOUR_BIT_LONG 
+RC4_CHUNK:${alpha_asm}:dlfcn:tru64-shared-rpath::.so",
+#
+# This probably belongs in a different section.
+#
 "FreeBSD-alpha","gcc:-DTERMIOS -O 
-fomit-frame-pointer::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR 
DES_RISC2::::::::::dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",

 #### Alpha Linux with GNU C and Compaq C setups
diff -ur openssl-0.9.6a.orig/FAQ openssl-0.9.6a/FAQ
--- openssl-0.9.6a.orig/FAQ     Thu Apr  5 15:07:59 2001
+++ openssl-0.9.6a/FAQ  Thu Apr 12 15:52:05 2001
@@ -32,7 +32,7 @@
 * Why does the linker complain about undefined symbols?
 * Why does the OpenSSL test fail with "bc: command not found"?
 * Why does the OpenSSL test fail with "bc: 1 no implemented"?
-* Why does the OpenSSL compilation fail on Alpha True64 Unix?
+* Why does the OpenSSL compilation fail on Alpha Tru64 Unix?
 * Why does the OpenSSL compilation fail with "ar: command not found"?
 * Why does the OpenSSL compilation fail on Win32 with VC++?

@@ -326,9 +326,9 @@
 for download instructions) can be safely used, for example.


-* Why does the OpenSSL compilation fail on Alpha True64 Unix?
+* Why does the OpenSSL compilation fail on Alpha Tru64 Unix?

-On some Alpha installations running True64 Unix and Compaq C, the compilation
+On some Alpha installations running Tru64 Unix and Compaq C, the compilation
 of crypto/sha/sha_dgst.c fails with the message 'Fatal:  Insufficient virtual
 memory to continue compilation.'  As far as the tests have shown, this may be
 a compiler bug.  What happens is that it eats up a lot of resident memory
diff -ur openssl-0.9.6a.orig/Makefile openssl-0.9.6a/Makefile
--- openssl-0.9.6a.orig/Makefile        Thu Apr  5 15:21:16 2001
+++ openssl-0.9.6a/Makefile     Thu Apr 12 15:52:05 2001
@@ -265,9 +265,20 @@
        done

 # This assumes that GNU utilities are *not* used
-do_tru64-shared:
+do_alpha-osf1-shared:
        libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
        ( set -x; ${CC}  -shared -no_archive -o lib$$i.so \
+               -set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
+               -all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
+       libs="$$libs -l$$i"; \
+       done
+
+# This assumes that GNU utilities are *not* used
+# difference between alpha-osf1-shared and tru64-shared is `-msym' option
+# passed to the linker.
+do_tru64-shared:
+       libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
+       ( set -x; ${CC}  -shared -msym -no_archive -o lib$$i.so \
                -set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
                -all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
        libs="$$libs -l$$i"; \
diff -ur openssl-0.9.6a.orig/Makefile.org openssl-0.9.6a/Makefile.org
--- openssl-0.9.6a.orig/Makefile.org    Thu Apr  5 15:08:02 2001
+++ openssl-0.9.6a/Makefile.org Thu Apr 12 15:52:05 2001
@@ -263,13 +263,37 @@
        done

 # This assumes that GNU utilities are *not* used
-do_tru64-shared:
+do_alpha-osf1-shared:
        libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
        ( set -x; ${CC}  -shared -no_archive -o lib$$i.so \
                -set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
                -all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
        libs="$$libs -l$$i"; \
        done
+
+# This assumes that GNU utilities are *not* used
+# The difference between alpha-osf1-shared and tru64-shared is the `-msym'
+# option passed to the linker.
+do_tru64-shared:
+       libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
+       ( set -x; ${CC}  -shared -msym -no_archive -o lib$$i.so \
+               -set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
+               -all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
+       libs="$$libs -l$$i"; \
+       done
+
+# This assumes that GNU utilities are *not* used
+# The difference between tru64-shared and tru64-shared-rpath is the
+# -rpath ${INSTALLTOP}/lib passed to the linker.
+do_tru64-shared-rpath:
+       libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
+       ( set -x; ${CC}  -shared -msym -no_archive -o lib$$i.so \
+               -rpath  ${INSTALLTOP}/lib \
+               -set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
+               -all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
+       libs="$$libs -l$$i"; \
+       done
+

 # This assumes that GNU utilities are *not* used
 do_solaris-shared:
diff -ur openssl-0.9.6a.orig/Makefile.ssl openssl-0.9.6a/Makefile.ssl
--- openssl-0.9.6a.orig/Makefile.ssl    Thu Apr  5 15:21:16 2001
+++ openssl-0.9.6a/Makefile.ssl Thu Apr 12 15:52:05 2001
@@ -265,9 +265,32 @@
        done

 # This assumes that GNU utilities are *not* used
-do_tru64-shared:
+do_alpha-osf1-shared:
        libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
        ( set -x; ${CC}  -shared -no_archive -o lib$$i.so \
+               -set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
+               -all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
+       libs="$$libs -l$$i"; \
+       done
+
+# This assumes that GNU utilities are *not* used
+# The difference between alpha-osf1-shared and tru64-shared is the `-msym'
+# option passed to the linker.
+do_tru64-shared:
+       libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
+       ( set -x; ${CC}  -shared -msym -no_archive -o lib$$i.so \
+               -set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
+               -all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
+       libs="$$libs -l$$i"; \
+       done
+
+# This assumes that GNU utilities are *not* used
+# The difference between tru64-shared and tru64-shared-rpath is the
+# -rpath ${INSTALLTOP}/lib passed to the linker.
+do_tru64-shared-rpath:
+       libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
+       ( set -x; ${CC}  -shared -msym -no_archive -o lib$$i.so \
+               -rpath ${INSTALLTOP}/lib \
                -set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
                -all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
        libs="$$libs -l$$i"; \
diff -ur openssl-0.9.6a.orig/config openssl-0.9.6a/config
--- openssl-0.9.6a.orig/config  Thu Apr  5 15:08:17 2001
+++ openssl-0.9.6a/config       Thu Apr 12 15:52:05 2001
@@ -196,7 +196,18 @@
        ;;

     OSF1:*:*:*alpha*)
-       echo "${MACHINE}-dec-osf"; exit 0
+       OSFMAJOR=`echo ${RELEASE}| sed -e 's/^V\([0-9]*\)\..*$/\1/'`
+       case "$OSFMAJOR" in
+           4|5)
+               echo "${MACHINE}-dec-tru64"; exit 0
+               ;;
+           1|2|3)
+               echo "${MACHINE}-dec-osf"; exit 0
+               ;;
+           *)
+               echo "${MACHINE}-dec-osf"; exit 0
+               ;;
+       esac
        ;;

     QNX:*)
@@ -485,7 +496,8 @@
   pmax*-*-openbsd) OUT="OpenBSD-mips" ;;
   *-*-openbsd) OUT="OpenBSD" ;;
   *86*-*-bsdi4) OUT="bsdi-elf-gcc" ;;
-  *-*-osf) OUT="alpha-cc" ;;
+  *-*-osf) OUT="alphaold-cc" ;;
+  *-*-tru64) OUT="alpha-cc" ;;
   *-*-unixware7) OUT="unixware-7" ;;
   *-*-UnixWare7) OUT="unixware-7" ;;
   *-*-Unixware7) OUT="unixware-7" ;;
diff -ur openssl-0.9.6a.orig/crypto/opensslv.h openssl-0.9.6a/crypto/opensslv.h
--- openssl-0.9.6a.orig/crypto/opensslv.h       Thu Apr  5 15:09:36 2001
+++ openssl-0.9.6a/crypto/opensslv.h    Thu Apr 12 15:52:05 2001
@@ -44,13 +44,13 @@
  *
  *     libcrypto.so.0
  *
- * On True64 it works a little bit differently.  There, the shared library
- * version is stored in the file, and is actually a series of versions,
- * separated by colons.  The rightmost version present in the library when
- * linking an application is stored in the application to be matched at
- * run time.  When the application is run, a check is done to see if the
- * library version stored in the application matches any of the versions
- * in the version string of the library itself.
+ * On Tru64 and IRIX 6.x it works a little bit differently.  There, the
+ * shared library version is stored in the file, and is actually a series
+ * of versions, separated by colons.  The rightmost version present in the
+ * library when linking an application is stored in the application to be
+ * matched at run time.  When the application is run, a check is done to
+ * see if the library version stored in the application matches any of the
+ * versions in the version string of the library itself.
  * This version string can be constructed in any way, depending on what
  * kind of matching is desired.  However, to implement the same scheme as
  * the one used in the other unixen, all compatible versions, from lowest
@@ -73,7 +73,7 @@
  * However, it's nice and more understandable if it actually does.
  * The current library version is stored in the macro SHLIB_VERSION_NUMBER,
  * which is just a piece of text in the format "M.m.e" (Major, minor, edit).
- * For the sake of True64 and any other OS that behaves in similar ways,
+ * For the sake of Tru64, IRIX, and any other OS that behaves in similar ways,
  * we need to keep a history of version numbers, which is done in the
  * macro SHLIB_VERSION_HISTORY.  The numbers are separated by colons and
  * should only keep the versions that are binary compatible with the current.

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

Reply via email to