Subject: Re: Uhm. Is this a feature?
To: Brad Spencer <brad@anduin.eldar.org>
From: Frederick Bruckman <fb@enteract.com>
List: current-users
Date: 05/28/2000 18:38:16
On Sun, 28 May 2000, Brad Spencer wrote:

> Oddly, my NetBSD/i386 box would build fine, with the same source tree, as
> an a.out system.
> 
> Except for crypto-us/lib/libdes.  There is a warning in the Makefile
> stating:
> 
> #       XXX x86 assy produces lots of RRS text relocation errors on shared
> #       XXX lib, must fix.
> 
> This really should be looked into...  I think that these are fatal, not
> just an annoyance.  They most often happen when a nonposition independent
> code is mixed in with position independent code in the same shared object.
> I just ended up using the C versions of those functions.  If I left the
> assembly ones in there anything built with libdes [like su, etc..] would
> fail trying to find one of the more common des functions.

Yeah, I noticed that, too. Considering, do you suppose the following
would be appropriate?

Index: Makefile
===================================================================
RCS file: /cvsroot/cryptosrc-us/crypto-us/lib/libdes/Makefile,v
retrieving revision 1.8
diff -c -r1.8 Makefile
*** Makefile	1999/07/09 06:30:00	1.8
--- Makefile	2000/05/28 23:37:25
***************
*** 26,32 ****
  
  CPPFLAGS+= -DRAND -DTERMIOS
  
! .if (${MACHINE_ARCH} == "i386")
  #	XXX x86 assy produces lots of RRS text relocation errors on shared
  #	XXX lib, must fix.
  .PATH: ${.CURDIR}/arch/i386
--- 26,34 ----
  
  CPPFLAGS+= -DRAND -DTERMIOS
  
! .include <bsd.own.mk>
! 
! .if (${MACHINE_ARCH} == "i386") && (${OBJECT_FMT} != "a.out")
  #	XXX x86 assy produces lots of RRS text relocation errors on shared
  #	XXX lib, must fix.
  .PATH: ${.CURDIR}/arch/i386
***************
*** 35,48 ****
  #CPPFLAGS+=      -DDES_UNROLL -DDES_RISC1
  .else
  SRCS+=	des_enc.c fcrypt_b.c
! .if (${MACHINE_ARCH} == "alpha")
  CPPFLAGS+=	-DDES_RISC2
! .else
! .if (${MACHINE_ARCH} == "sparc64")
  CPPFLAGS+=	-DDES_RISC1
  .else
  CPPFLAGS+=      -DDES_UNROLL
- .endif
  .endif
  .endif
  
--- 37,50 ----
  #CPPFLAGS+=      -DDES_UNROLL -DDES_RISC1
  .else
  SRCS+=	des_enc.c fcrypt_b.c
! .if (${MACHINE_ARCH} == "i386") && (${OBJECT_FMT} == "a.out")
! CPPFLAGS+=      -DDES_UNROLL -DDES_RISC1
! .elif (${MACHINE_ARCH} == "alpha")
  CPPFLAGS+=	-DDES_RISC2
! .elif (${MACHINE_ARCH} == "sparc64")
  CPPFLAGS+=	-DDES_RISC1
  .else
  CPPFLAGS+=      -DDES_UNROLL
  .endif
  .endif