On 2023 Jan 18 (Wed) at 21:58:12 +0100 (+0100), Theo Buehler wrote:
:> :http://build-failures.rhaalovely.net/aarch64/2023-01-16/security/sslscan.log
:> 
:> ld: error: chacha-armv8.S:(function ChaCha20_ctr32: .text+0x4): relocation 
R_AARCH64_ADR_PREL_LO21 out of range: -1633764 is not in [-1048576, 1048575]
:
:Patch below fixes this. I missed an adr that should be computed with
:adrp + add :lo12: (like the remaining ones in the same file). Also move
:the .rodata down to match the file in 3.0 more closely.
:
:Regress still passes.
:

I don't understand assembly, but this looks good and still passing
regress is excellent.  OK


:I'll of course also bump sslscan.
:

Sure thing!


:Index: 1.1/Makefile
:===================================================================
:RCS file: /cvs/ports/security/openssl/1.1/Makefile,v
:retrieving revision 1.48
:diff -u -p -r1.48 Makefile
:--- 1.1/Makefile       17 Jan 2023 16:14:42 -0000      1.48
:+++ 1.1/Makefile       18 Jan 2023 19:54:43 -0000
:@@ -8,7 +8,7 @@ PORTROACH=     limit:^1\.1\.[0-9][a-z] skipb
: V=            1.1.1s
: PKGSPEC=      openssl->=1.1.0v0,<1.2v0
: EPOCH=                0
:-REVISION=     3
:+REVISION=     4
: 
: SHLIBVER=     11.6
: SHARED_LIBS=  crypto ${SHLIBVER} \
:Index: 1.1/patches/patch-crypto_chacha_asm_chacha-armv8_pl
:===================================================================
:RCS file: 
/cvs/ports/security/openssl/1.1/patches/patch-crypto_chacha_asm_chacha-armv8_pl,v
:retrieving revision 1.1
:diff -u -p -r1.1 patch-crypto_chacha_asm_chacha-armv8_pl
:--- 1.1/patches/patch-crypto_chacha_asm_chacha-armv8_pl        14 Jan 2023 
17:09:56 -0000      1.1
:+++ 1.1/patches/patch-crypto_chacha_asm_chacha-armv8_pl        18 Jan 2023 
20:31:04 -0000
:@@ -1,16 +1,15 @@
: Index: crypto/chacha/asm/chacha-armv8.pl
: --- crypto/chacha/asm/chacha-armv8.pl.orig
: +++ crypto/chacha/asm/chacha-armv8.pl
:-@@ -122,7 +122,7 @@ my ($a3,$b3,$c3,$d3)=map(($_&~3)+(($_+1)&3),($a2,$b2,$
:- $code.=<<___;
:- #include "arm_arch.h"
:- 
:--.text
:-+.rodata
:- 
:+@@ -127,6 +127,7 @@ $code.=<<___;
:  .extern      OPENSSL_armcap_P
:  .hidden      OPENSSL_armcap_P
:-@@ -140,6 +140,8 @@ $code.=<<___;
:+ 
:++.rodata
:+ .align       5
:+ .Lsigma:
:+ .quad        0x3320646e61707865,0x6b20657479622d32           // 
endian-neutral
:+@@ -140,12 +141,15 @@ $code.=<<___;
:  #endif
:  .asciz       "ChaCha20 for ARMv8, CRYPTOGAMS by <appro\@openssl.org>"
:  
:@@ -19,7 +18,15 @@ Index: crypto/chacha/asm/chacha-armv8.pl
:  .globl       ChaCha20_ctr32
:  .type        ChaCha20_ctr32,%function
:  .align       5
:-@@ -162,7 +164,8 @@ ChaCha20_ctr32:
:+ ChaCha20_ctr32:
:+      cbz     $len,.Labort
:+-     adr     @x[0],.LOPENSSL_armcap_P
:++     adrp    @x[0],.LOPENSSL_armcap_P
:++     add     @x[0],@x[0],:lo12:.LOPENSSL_armcap_P
:+      cmp     $len,#192
:+      b.lo    .Lshort
:+ #ifdef       __ILP32__
:+@@ -162,7 +166,8 @@ ChaCha20_ctr32:
:       stp     x29,x30,[sp,#-96]!
:       add     x29,sp,#0
:  
:@@ -29,7 +36,7 @@ Index: crypto/chacha/asm/chacha-armv8.pl
:       stp     x19,x20,[sp,#16]
:       stp     x21,x22,[sp,#32]
:       stp     x23,x24,[sp,#48]
:-@@ -385,7 +388,8 @@ ChaCha20_neon:
:+@@ -385,7 +390,8 @@ ChaCha20_neon:
:       stp     x29,x30,[sp,#-96]!
:       add     x29,sp,#0
:  
:@@ -39,7 +46,7 @@ Index: crypto/chacha/asm/chacha-armv8.pl
:       stp     x19,x20,[sp,#16]
:       stp     x21,x22,[sp,#32]
:       stp     x23,x24,[sp,#48]
:-@@ -707,7 +711,8 @@ ChaCha20_512_neon:
:+@@ -707,7 +713,8 @@ ChaCha20_512_neon:
:       stp     x29,x30,[sp,#-96]!
:       add     x29,sp,#0
:  

-- 
Outside of a dog, a book is a man's best friend: and inside a dog,
it's too dark to read.
                -- Groucho Marx

Reply via email to