NetBSD Problem Report #49726

From martin@duskware.de  Fri Mar  6 09:45:31 2015
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 6F40BA6562
	for <gnats-bugs@gnats.NetBSD.org>; Fri,  6 Mar 2015 09:45:31 +0000 (UTC)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: openssl configure bogus on modern NetBSD/*arm*
X-Send-Pr-Version: 3.95

>Number:         49726
>Category:       pkg
>Synopsis:       openssl configure bogus on modern NetBSD/*arm*
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    joerg
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 06 09:50:00 +0000 2015
>Closed-Date:    
>Last-Modified:  Thu Nov 05 10:20:46 +0000 2015
>Originator:     Martin Husemann
>Release:        NetBSD 7.99.5
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD space-truckin.duskware.de 7.99.5 NetBSD 7.99.5 (CUBIETRUCK) #145: Mon Mar 2 14:55:12 CET 2015 martin@night-owl.duskware.de:/usr/src/sys/arch/evbarm/compile/CUBIETRUCK evbarm
Architecture: earmv7hfeb
Machine: evbarm
>Description:

The recent discussion about base system openssl not using asm versions
on ARM systems when it should made me check openssl in pkgsrc. The situation
there is only minimally better, BN_ASM is enabled, but everything else
is not.

Looking at the patches we add support for "arm" but not "earm" and always
assume little endian.

>How-To-Repeat:
make configure

>Fix:
n/a

>Release-Note:

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/49726: openssl configure bogus on modern NetBSD/*arm*
Date: Sat, 7 Mar 2015 12:55:10 +0100

 Not sure if I got them all and didn't break anything in that copy&paste
 mess, also cleaner solutions very welcome.

 Martin

 Index: distinfo
 ===================================================================
 RCS file: /cvsroot/pkgsrc/security/openssl/distinfo,v
 retrieving revision 1.111
 diff -c -u -r1.111 distinfo
 --- distinfo	12 Feb 2015 13:08:53 -0000	1.111
 +++ distinfo	7 Mar 2015 11:51:27 -0000
 @@ -3,11 +3,11 @@
  SHA1 (openssl-1.0.2.tar.gz) = 2f264f7f6bb973af444cd9fc6ee65c8588f610cc
  RMD160 (openssl-1.0.2.tar.gz) = a5452cd1fd380dcbc1dd53d8e50da6ec632ebd6e
  Size (openssl-1.0.2.tar.gz) = 5265809 bytes
 -SHA1 (patch-Configure) = b2b1b5e9f9cffde8814297fac88c84388c86694a
 +SHA1 (patch-Configure) = 561f29e13cc38e3e6a34871d008797f528693e10
  SHA1 (patch-Makefile.org) = 72f023aeead660decaa09b6664936bd73a214069
  SHA1 (patch-Makefile.shared) = 709283ba4bb4bd568e289fe111b8dea319968328
  SHA1 (patch-apps_Makefile) = 745e01fb967979f5105896f8a728fd7a041af6c9
 -SHA1 (patch-config) = ac8ced00cfa7d31b84afb08aedc38102fd777824
 +SHA1 (patch-config) = e4d96738e99e62d7023598647efcee1e9fc81bc5
  SHA1 (patch-crypto_bn_bn__prime.pl) = c07e8ccba319e4260af46e714c3be56f70579fa6
  SHA1 (patch-crypto_des_Makefile) = 6c67c81ba7054647e1138165d9280c8db82b8498
  SHA1 (patch-engines_ccgost_Makefile) = 8834074c74abab604ef1ba7959750c22c0ffb6e7
 Index: patches/patch-Configure
 ===================================================================
 RCS file: /cvsroot/pkgsrc/security/openssl/patches/patch-Configure,v
 retrieving revision 1.3
 diff -c -u -r1.3 patch-Configure
 --- patches/patch-Configure	12 Feb 2015 13:08:53 -0000	1.3
 +++ patches/patch-Configure	7 Mar 2015 11:51:27 -0000
 @@ -3,10 +3,11 @@
  * Avoid -fast on Solaris, creates non-portable packages which depend on
    host-specific CPU features.
  * Add GNU/kFreeBSD support.
 +* Add NetBSD/modern arm variants

 ---- Configure.orig	2015-01-22 14:58:32.000000000 +0000
 -+++ Configure
 -@@ -341,6 +341,7 @@ my %table=(
 +--- Configure.orig	2015-01-22 15:58:32.000000000 +0100
 ++++ Configure	2015-03-07 12:49:37.000000000 +0100
 +@@ -341,6 +341,7 @@
   #
   "osf1-alpha-gcc", "gcc:-O3::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_RISC1:${alpha_asm}:dlfcn:alpha-osf1-shared:::.so",
   "osf1-alpha-cc",  "cc:-std1 -tune host -O4 -readonly_strings::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:alpha-osf1-shared:::.so",
 @@ -14,7 +15,7 @@
   "tru64-alpha-cc", "cc:-std1 -tune host -fast -readonly_strings::-pthread:::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:alpha-osf1-shared::-msym:.so",

   ####
 -@@ -463,6 +464,28 @@ my %table=(
 +@@ -463,6 +464,38 @@
   "BSD-sparc64",	"gcc:-DB_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC2 BF_PTR:${sparcv9_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
   "BSD-ia64",	"gcc:-DL_ENDIAN -DTERMIOS -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
   "BSD-x86_64",	"gcc:-DL_ENDIAN -DTERMIOS -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 @@ -22,6 +23,16 @@
  +"NetBSD-alpha", "gcc:-DTERMIOS -DL_ENDIAN -O2 -Wall::(unknown):::SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  +"NetBSD-arm", "gcc:-DTERMIOS -DL_ENDIAN -O2 -Wall::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  +"NetBSD-arm32", "gcc:-DTERMIOS -DL_ENDIAN -O2 -Wall::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 ++"NetBSD-earmv4", "gcc:-DTERMIOS -DL_ENDIAN -O3 -Wall::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 ++"NetBSD-earmv4eb", "gcc:-DTERMIOS -DB_ENDIAN -O3 -Wall::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 ++"NetBSD-earm", "gcc:-DTERMIOS -DL_ENDIAN -O3 -Wall::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 ++"NetBSD-earmeb", "gcc:-DTERMIOS -DB_ENDIAN -O3 -Wall::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 ++"NetBSD-earmhf", "gcc:-DTERMIOS -DL_ENDIAN -O3 -Wall::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 ++"NetBSD-earmhfeb", "gcc:-DTERMIOS -DB_ENDIAN -O3 -Wall::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 ++"NetBSD-earmv6hf", "gcc:-DTERMIOS -DL_ENDIAN -O3 -Wall::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 ++"NetBSD-earmv6hfeb", "gcc:-DTERMIOS -DB_ENDIAN -O3 -Wall::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 ++"NetBSD-earmv7hf", "gcc:-DTERMIOS -DL_ENDIAN -O3 -Wall::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 ++"NetBSD-earmv7hfeb", "gcc:-DTERMIOS -DB_ENDIAN -O3 -Wall::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  +"NetBSD-m68000", "gcc:-DTERMIOS -DB_ENDIAN -O2 -Wall::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  +"NetBSD-m68k", "gcc:-DTERMIOS -DB_ENDIAN -O2 -m68020-40 -Wall::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  +"NetBSD-mipseb", "gcc:-DTERMIOS -DB_ENDIAN -O2 -Wall::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 @@ -43,7 +54,7 @@

   "bsdi-elf-gcc",     "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall::(unknown)::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",

 -@@ -915,7 +938,7 @@ PROCESS_ARGS:
 +@@ -915,7 +948,7 @@
   			# The check for the option is there so scripts aren't
   			# broken
   			}
 @@ -52,7 +63,7 @@
   			{
   			if (/^--prefix=(.*)$/)
   				{
 -@@ -1737,7 +1760,7 @@ while (<IN>)
 +@@ -1737,7 +1770,7 @@
   	elsif ($shared_extension ne "" && $shared_extension =~ /^\.s([ol])\.[^\.]*\.[^\.]*$/)
   		{
   		my $sotmp = $1;
 Index: patches/patch-config
 ===================================================================
 RCS file: /cvsroot/pkgsrc/security/openssl/patches/patch-config,v
 retrieving revision 1.2
 diff -c -u -r1.2 patch-config
 --- patches/patch-config	13 May 2014 02:23:11 -0000	1.2
 +++ patches/patch-config	7 Mar 2015 11:51:27 -0000
 @@ -58,7 +58,7 @@
   	;;
     *-*-sunos4)		OUT="sunos-$CC" ;;

 -+  alpha-*-netbsd|arm-*-netbsd|arm32-*-netbsd|m68000-*-netbsd|m68k-*-netbsd|\
 ++  alpha-*-netbsd|arm-*-netbsd|earm-*-netbsd|earmv*-netbsd|arm32-*-netbsd|m68000-*-netbsd|m68k-*-netbsd|\
  +  mipseb-*-netbsd|mipsel-*-netbsd|ns32k-*-netbsd|powerpc-*-netbsd|\
  +  sparc-*-netbsd|sparc64-*-netbsd|vax-*-netbsd|x86_64-*-netbsd)
  +			OUT="NetBSD-${MACHINE_ARCH}" ;;

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/49726: openssl configure bogus on modern NetBSD/*arm*
Date: Tue, 10 Mar 2015 12:15:30 +0100

 Unfortunately this does not build (nor work) on armv4 machines, so it needs
 more work.

 Martin

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/49726: openssl configure bogus on modern NetBSD/*arm*
Date: Tue, 17 Mar 2015 19:15:26 +0100

 The issues with the last patch turned out to be a kernel bug that now 
 got fixed (port-arm/49754).

 Martin

State-Changed-From-To: open->feedback
State-Changed-By: bsiegert@NetBSD.org
State-Changed-When: Sun, 28 Jun 2015 18:02:38 +0000
State-Changed-Why:
So should your patch be applied now?
(Unfortunately, I do not have a working ARM machine to test.)


From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: joerg@NetBSD.org
Subject: Re: pkg/49726 (openssl configure bogus on modern NetBSD/*arm*)
Date: Sun, 28 Jun 2015 22:26:56 +0200

 I would like to get some review (joerg?). It gives great performance
 (far better than the base system stuff) for me on one test machine, but
 I have not done extensive tests on a variety of machines nor am I sure
 this is the best/easiest aproach.

 Martin

Responsible-Changed-From-To: pkg-manager->joerg
Responsible-Changed-By: bsiegert@NetBSD.org
Responsible-Changed-When: Sat, 04 Jul 2015 15:56:19 +0000
Responsible-Changed-Why:
Joerg agreed to review this.


State-Changed-From-To: feedback->open
State-Changed-By: martin@NetBSD.org
State-Changed-When: Thu, 05 Nov 2015 10:20:46 +0000
State-Changed-Why:
Not finally solved, joerg is looking into it.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.