Hi,


openssl 0.9.8m was fine, but with 1.0.0 I get:

sha256-sparcv9.s: Assembler messages:
sha256-sparcv9.s:1849: Error: unaligned opcodes detected in executable 
segment

I look around and noticed 
http://rt.openssl.org/Ticket/Display.html?id=2190&user=guest&pass=guest
subsequently I came up with the patch further below.


Config:

Operating system: sparc64-whatever-linux2
WARNING! If you *know* that your GNU C supports 64-bit/V9 ABI
         and wish to build 64-bit library, then you have to
         invoke './Configure linux64-sparcv9' *manually*.
Configuring for linux-sparcv9
======================================================================
=== SANITY TESTING!
=== No configuration will be done, all other arguments will be ignored!
======================================================================
No sanity errors detected!
+ config_flags='threads shared no-rc5 no-idea enable-camellia zlib 
--prefix=/usr --libdir=lib --openssldir=/etc/ssl -O2 -g -m32 -mtune=ultrasparc 
-Wa,--noexecstack -fomit-frame-pointer -fno-strict-aliasing -DTERMIO -Wall 
-fstack-protector '
+ ./config threads shared no-rc5 no-idea enable-camellia zlib --prefix=/usr 
--libdir=lib --openssldir=/etc/ssl -O2 -g -m32 -mtune=ultrasparc 
-Wa,--noexecstack -fomit-frame-pointer -fno-strict-aliasing -DTERMIO -Wall 
-fstack-protector
Configuring for linux-sparcv9
    no-gmp          [default]  OPENSSL_NO_GMP (skip dir)
    no-idea         [option]   OPENSSL_NO_IDEA (skip dir)
    no-jpake        [experimental] OPENSSL_NO_JPAKE (skip dir)
    no-krb5         [krb5-flavor not specified] OPENSSL_NO_KRB5
    no-md2          [default]  OPENSSL_NO_MD2 (skip dir)
    no-rc5          [option]   OPENSSL_NO_RC5 (skip dir)
    no-rfc3779      [default]  OPENSSL_NO_RFC3779 (skip dir)
    no-store        [experimental] OPENSSL_NO_STORE (skip dir)
    no-zlib-dynamic [default]
IsMK1MF=0
CC            =gcc
CFLAG         =-fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT
                -DDSO_DLFCN -DHAVE_DLFCN_H -m32 -mcpu=ultrasparc -DB_ENDIAN
                -DTERMIO -O3 -fomit-frame-pointer -Wall -Wa,-Av8plus
                -DBN_DIV2W -O2 -g -m32 -mtune=ultrasparc -Wa,--noexecstack
                -fomit-frame-pointer -fno-strict-aliasing -DTERMIO -Wall
                -fstack-protector  -DOPENSSL_BN_ASM_MONT -DSHA1_ASM
                -DSHA256_ASM -DSHA512_ASM -DAES_ASM
EX_LIBS       =-ldl -lz
CPUID_OBJ     =sparcv9cap.o sparccpuid.o
BN_ASM        =bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o
DES_ENC       =des_enc-sparc.o fcrypt_b.o
AES_ENC       =aes_core.o aes_cbc.o aes-sparcv9.o
BF_ENC        =bf_enc.o
CAST_ENC      =c_enc.o
RC4_ENC       =rc4_enc.o rc4_skey.o
RC5_ENC       =rc5_enc.o
MD5_OBJ_ASM   =
SHA1_OBJ_ASM  =sha1-sparcv9.o sha256-sparcv9.o sha512-sparcv9.o
RMD160_OBJ_ASM=
CMLL_ENC=     =camellia.o cmll_misc.o cmll_cbc.o
PROCESSOR     =
RANLIB        =/usr/bin/ranlib
ARFLAGS       =
PERL          =/usr/bin/perl
THIRTY_TWO_BIT mode
DES_UNROLL used
BN_LLONG mode
RC4 uses uchar
RC4_CHUNK is unsigned long
BF_PTR used

# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/sparc64-suse-linux/4.5/lto-wrapper
Target: sparc64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib
--enable-languages=c,c++,objc,fortran,obj-c++,java --enable-checking=release
--with-gxx-include-dir=/usr/include/c++/4.5 --enable-ssp --disable-libssp
--disable-plugin --with-bugurl=http://bugs.opensuse.org/
--with-pkgversion='SUSE Linux' --disable-libgcj --disable-libmudflap
--with-slibdir=/lib --with-system-zlib --enable-__cxa_atexit
--enable-libstdcxx-allocator=new --disable-libstdcxx-pch
--enable-version-specific-runtime-libs --program-suffix=-4.5
--enable-linux-futex --without-system-libunwind --enable-gold
--with-plugin-ld=/usr/bin/gold --with-cpu=v8 --with-long-double-128
--build=sparc64-suse-linux
Thread model: posix
gcc version 4.5.0 20100604 [gcc-4_5-branch revision 160292] (SUSE Linux) 

# as -v
GNU assembler version 2.19.51 (sparc-suse-linux) using BFD version
(GNU Binutils; openSUSE 11.2) 2.19.51.20090527-11.3


----8<----
---
 crypto/sha/sha256-sparcv9.s |    1 +
 crypto/sha/sha512-sparcv9.s |    1 +
 2 files changed, 2 insertions(+)

Index: openssl-1.0.0/crypto/sha/sha256-sparcv9.s
===================================================================
--- openssl-1.0.0.orig/crypto/sha/sha256-sparcv9.s
+++ openssl-1.0.0/crypto/sha/sha256-sparcv9.s
@@ -1847,3 +1847,4 @@ sha256_block_data_order:
 .type  sha256_block_data_order,#function
 .size  sha256_block_data_order,(.-sha256_block_data_order)
 .asciz "SHA256 block transform for SPARCv9, CRYPTOGAMS by <ap...@openssl.org>"
+.align 4
Index: openssl-1.0.0/crypto/sha/sha512-sparcv9.s
===================================================================
--- openssl-1.0.0.orig/crypto/sha/sha512-sparcv9.s
+++ openssl-1.0.0/crypto/sha/sha512-sparcv9.s
@@ -2230,3 +2230,4 @@ sha512_block_data_order:
 .type  sha512_block_data_order,#function
 .size  sha512_block_data_order,(.-sha512_block_data_order)
 .asciz "SHA512 block transform for SPARCv9, CRYPTOGAMS by <ap...@openssl.org>"
+.align 4
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to