From owner-freebsd-current@FreeBSD.ORG Mon Feb 14 15:50:38 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E46D4106564A; Mon, 14 Feb 2011 15:50:38 +0000 (UTC) (envelope-from swell.k@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4B9068FC16; Mon, 14 Feb 2011 15:50:36 +0000 (UTC) Received: by eyf6 with SMTP id 6so2405261eyf.13 for ; Mon, 14 Feb 2011 07:50:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:references:date:message-id :user-agent:mime-version:content-type; bh=Mo5bl0jHG0hTirGxuYKGr/HvmpNqnc58moWCbs9HgJo=; b=N0dfN0/X+TfF/hy7pZEVRXnRcFwib5uZzToQHWtmjJHp4nUhWDjq/Qo2cTwzMmCrpl TLZj8nKBPukcLNUN3K2PMqGc3rG1Kvmdz3BF8r6l/5iBLJeRKQZx4zQk1+xXggR/wupY WzQZ0/2x1EXIc2AGJEWWWkTGGj9PIq5/B0F04= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:message-id:user-agent :mime-version:content-type; b=DBdqdoriFwviF9qn5eM9ZCfPM5dB2QEJhDVmuSwXVC7WQOadreZMtVpkU5G4qX88Z0 nwUycTmc8aQZpo2vmYtqXaUYQEdtqBKV7ayLKOaTP2cJyeSyHOdX0ja6wPXfLcjZk5Xt WVIV4/3GNXghcHowjM8ObxHPRmrFgYYp+dGPo= Received: by 10.223.101.206 with SMTP id d14mr4742093fao.134.1297698634982; Mon, 14 Feb 2011 07:50:34 -0800 (PST) Received: from localhost (zeller.torservers.net [74.120.12.135]) by mx.google.com with ESMTPS id n3sm1126098faa.5.2011.02.14.07.50.31 (version=SSLv3 cipher=OTHER); Mon, 14 Feb 2011 07:50:33 -0800 (PST) From: Anonymous To: Alexandre Martins References: <201102140935.22490.alexandre.martins@netasq.com> <201102141044.11144.alexandre.martins@netasq.com> <201102141048.34294.alexandre.martins@netasq.com> Date: Mon, 14 Feb 2011 18:50:26 +0300 Message-ID: <86fwrqpqd9.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: freebsd-current@freebsd.org, Dimitry Andric Subject: Re: OpenSSL 1.0.0d for Freebsd HEAD X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Feb 2011 15:50:39 -0000 Alexandre Martins writes: > For those interested in testing, you can find a patch that add OpenSSL 1.0d > to head. [...] Hmm, doesn't build with ld(1) from /projects/binutils-2.17. $ make -dl all as -o rc4-amd64.o /usr/src/secure/lib/libcrypto/amd64/rc4-amd64.s [ -z "ctfconvert" -o -n "1" ] || (echo ctfconvert -L VERSION rc4-amd64.o && ctfconvert -L VERSION rc4-amd64.o) echo building static crypto library building static crypto library rm -f libcrypto.a ar cq libcrypto.a `lorder ...` ranlib libcrypto.a as -o rc4-amd64.po /usr/src/secure/lib/libcrypto/amd64/rc4-amd64.s [ -z "ctfconvert" -o -n "1" ] || (echo ctfconvert -L VERSION rc4-amd64.po && ctfconvert -L VERSION rc4-amd64.po) echo building profiled crypto library building profiled crypto library rm -f libcrypto_p.a ar cq libcrypto_p.a `lorder ...` ranlib libcrypto_p.a as -o rc4-amd64.So /usr/src/secure/lib/libcrypto/amd64/rc4-amd64.s [ -z "ctfconvert" -o -n "1" ] || (echo ctfconvert -L VERSION rc4-amd64.So && ctfconvert -L VERSION rc4-amd64.So) echo building shared library libcrypto.so.7 building shared library libcrypto.so.7 rm -f libcrypto.so.7 libcrypto.so ln -fs libcrypto.so.7 libcrypto.so cc -fstack-protector -shared -Wl,-x -o libcrypto.so.7 -Wl,-soname,libcrypto.so.7 `lorder ...` /usr/bin/ld: rc4-amd64.So: relocation R_X86_64_PC32 against `OPENSSL_ia32cap_P' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value *** Error code 1 Reverting back to binutils-2.15 makes build fail with another error. libcrypto builds fine but linking against it always fails $ cc foo.c -lcrypto /usr/lib/libcrypto.so: undefined reference to `_x86_64_Camellia_decrypt' /usr/lib/libcrypto.so: undefined reference to `.Ldloop' Indeed, some parts are missing %% diff against output from cmll-x86_64.pl --- secure/lib/libcrypto/amd64/cmll_amd64.s +++ crypto/openssl/crypto/camellia/asm/cmll-x86_64.pl.out @@ -312,6 +312,170 @@ Camellia_DecryptBlock_Rounds: call _x86_64_Camellia_decrypt + bswapl %r8d + bswapl %r9d + bswapl %r10d + movl %r8d,0(%r13) + bswapl %r11d + movl %r9d,4(%r13) + movl %r10d,8(%r13) + movl %r11d,12(%r13) + + movq 0(%rsp),%r15 + movq 8(%rsp),%r14 + movq 16(%rsp),%r13 + movq 24(%rsp),%rbp + movq 32(%rsp),%rbx + leaq 40(%rsp),%rsp +.Ldec_epilogue: + .byte 0xf3,0xc3 +.size Camellia_DecryptBlock_Rounds,.-Camellia_DecryptBlock_Rounds + +.type _x86_64_Camellia_decrypt,@function +.align 16 +_x86_64_Camellia_decrypt: + xorl 0(%r14),%r9d + xorl 4(%r14),%r8d + xorl 8(%r14),%r11d + xorl 12(%r14),%r10d +.align 16 +.Ldloop: + movl -8(%r14),%ebx + movl -4(%r14),%eax + + xorl %r8d,%eax + xorl %r9d,%ebx + movzbl %ah,%esi + movzbl %bl,%edi + movl 2052(%rbp,%rsi,8),%edx + movl 0(%rbp,%rdi,8),%ecx + movzbl %al,%esi + shrl $16,%eax + movzbl %bh,%edi + xorl 4(%rbp,%rsi,8),%edx + shrl $16,%ebx + xorl 4(%rbp,%rdi,8),%ecx + movzbl %ah,%esi + movzbl %bl,%edi + xorl 0(%rbp,%rsi,8),%edx + xorl 2052(%rbp,%rdi,8),%ecx + movzbl %al,%esi + movzbl %bh,%edi + xorl 2048(%rbp,%rsi,8),%edx + xorl 2048(%rbp,%rdi,8),%ecx + movl -16(%r14),%ebx + movl -12(%r14),%eax + xorl %edx,%ecx + rorl $8,%edx + xorl %ecx,%r10d + xorl %ecx,%r11d + xorl %edx,%r11d + xorl %r10d,%eax + xorl %r11d,%ebx + movzbl %ah,%esi + movzbl %bl,%edi + movl 2052(%rbp,%rsi,8),%edx + movl 0(%rbp,%rdi,8),%ecx + movzbl %al,%esi + shrl $16,%eax + movzbl %bh,%edi + xorl 4(%rbp,%rsi,8),%edx + shrl $16,%ebx + xorl 4(%rbp,%rdi,8),%ecx + movzbl %ah,%esi + movzbl %bl,%edi + xorl 0(%rbp,%rsi,8),%edx + xorl 2052(%rbp,%rdi,8),%ecx + movzbl %al,%esi + movzbl %bh,%edi + xorl 2048(%rbp,%rsi,8),%edx + xorl 2048(%rbp,%rdi,8),%ecx + movl -24(%r14),%ebx + movl -20(%r14),%eax + xorl %edx,%ecx + rorl $8,%edx + xorl %ecx,%r8d + xorl %ecx,%r9d + xorl %edx,%r9d + xorl %r8d,%eax + xorl %r9d,%ebx + movzbl %ah,%esi + movzbl %bl,%edi + movl 2052(%rbp,%rsi,8),%edx + movl 0(%rbp,%rdi,8),%ecx + movzbl %al,%esi + shrl $16,%eax + movzbl %bh,%edi + xorl 4(%rbp,%rsi,8),%edx + shrl $16,%ebx + xorl 4(%rbp,%rdi,8),%ecx + movzbl %ah,%esi + movzbl %bl,%edi + xorl 0(%rbp,%rsi,8),%edx + xorl 2052(%rbp,%rdi,8),%ecx + movzbl %al,%esi + movzbl %bh,%edi + xorl 2048(%rbp,%rsi,8),%edx + xorl 2048(%rbp,%rdi,8),%ecx + movl -32(%r14),%ebx + movl -28(%r14),%eax + xorl %edx,%ecx + rorl $8,%edx + xorl %ecx,%r10d + xorl %ecx,%r11d + xorl %edx,%r11d + xorl %r10d,%eax + xorl %r11d,%ebx + movzbl %ah,%esi + movzbl %bl,%edi + movl 2052(%rbp,%rsi,8),%edx + movl 0(%rbp,%rdi,8),%ecx + movzbl %al,%esi + shrl $16,%eax + movzbl %bh,%edi + xorl 4(%rbp,%rsi,8),%edx + shrl $16,%ebx + xorl 4(%rbp,%rdi,8),%ecx + movzbl %ah,%esi + movzbl %bl,%edi + xorl 0(%rbp,%rsi,8),%edx + xorl 2052(%rbp,%rdi,8),%ecx + movzbl %al,%esi + movzbl %bh,%edi + xorl 2048(%rbp,%rsi,8),%edx + xorl 2048(%rbp,%rdi,8),%ecx + movl -40(%r14),%ebx + movl -36(%r14),%eax + xorl %edx,%ecx + rorl $8,%edx + xorl %ecx,%r8d + xorl %ecx,%r9d + xorl %edx,%r9d + xorl %r8d,%eax + xorl %r9d,%ebx + movzbl %ah,%esi + movzbl %bl,%edi + movl 2052(%rbp,%rsi,8),%edx + movl 0(%rbp,%rdi,8),%ecx + movzbl %al,%esi + shrl $16,%eax + movzbl %bh,%edi + xorl 4(%rbp,%rsi,8),%edx + shrl $16,%ebx + xorl 4(%rbp,%rdi,8),%ecx + movzbl %ah,%esi + movzbl %bl,%edi + xorl 0(%rbp,%rsi,8),%edx + xorl 2052(%rbp,%rdi,8),%ecx + movzbl %al,%esi + movzbl %bh,%edi + xorl 2048(%rbp,%rsi,8),%edx + xorl 2048(%rbp,%rdi,8),%ecx + movl -48(%r14),%ebx + movl -44(%r14),%eax + xorl %edx,%ecx + rorl $8,%edx + xorl %ecx,%r10d xorl %ecx,%r11d xorl %edx,%r11d xorl %r10d,%eax %%