On Thu, Nov 19, 2026 at 10:23:37AM +0000, Stuart Henderson wrote:
> On 2026/11/19 02:45, Anthony J. Bentley wrote:
> > The port builds fine with OpenSSL 3.5, 4.0, and 4.1, but megadl crashes
> > for all three versions. I assume this is because curl pulls in LibreSSL,
>
> that is a likely problem, though I don't think thst will be responsible
> for the SIGILL.
Yes.
> > though given the SIGILL maybe BTI is a factor here? Here's the backtrace
> > for 4.1 (megadl run with no arguments, seems to crash the same way with
> > arguments).
> >
> > Program received signal SIGILL, Illegal instruction.
Sigh. I thought they had test coverage for this.
> > 0x00000ec148b5bff0 in aesni_set_encrypt_key () at
> > crypto/aes/aesni-x86_64.s:4083
> > ⚠ warning: 4083 crypto/aes/aesni-x86_64.s: No such file or directory
> > (gdb) bt
> > #0 0x00000ec148b5bff0 in aesni_set_encrypt_key ()
> > at crypto/aes/aesni-x86_64.s:4083
>
> ktrace should give you more information about the type of SIGILL.
>
Try the below. It passes regress on my x1nano2.
Index: Makefile
===================================================================
RCS file: /cvs/ports/security/openssl/4.1/Makefile,v
diff -u -p -r1.1.1.1 Makefile
--- Makefile 13 Nov 2026 23:31:43 -0000 1.1.1.1
+++ Makefile 19 Nov 2026 10:24:06 -0000
@@ -13,6 +13,8 @@ PKGNAME= openssl-${V}
PKGSPEC= openssl->=4.1v0,<4.2v0
EPOCH= 0
+REVISION= 0
+
SHLIBVER= 50.0
SHARED_LIBS= crypto ${SHLIBVER} \
ssl ${SHLIBVER}
Index: patches/patch-crypto_aes_asm_aesni-x86_64_pl
===================================================================
RCS file: patches/patch-crypto_aes_asm_aesni-x86_64_pl
diff -N patches/patch-crypto_aes_asm_aesni-x86_64_pl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-crypto_aes_asm_aesni-x86_64_pl 19 Nov 2026 10:24:25
-0000
@@ -0,0 +1,19 @@
+Index: crypto/aes/asm/aesni-x86_64.pl
+--- crypto/aes/asm/aesni-x86_64.pl.orig
++++ crypto/aes/asm/aesni-x86_64.pl
+@@ -4298,6 +4298,7 @@ $code.=<<___;
+ .align 16
+ ${PREFIX}_set_decrypt_key:
+ .cfi_startproc
++ endbranch
+ .byte 0x48,0x83,0xEC,0x08 # sub rsp,8
+ .cfi_adjust_cfa_offset 8
+ call __aesni_set_encrypt_key
+@@ -4370,6 +4371,7 @@ $code.=<<___;
+ ${PREFIX}_set_encrypt_key:
+ __aesni_set_encrypt_key:
+ .cfi_startproc
++ endbranch
+ .byte 0x48,0x83,0xEC,0x08 # sub rsp,8
+ .cfi_adjust_cfa_offset 8
+ mov \$-1,%rax