1From 6d05b8b7d632a5ee054afb29ba995d2c7aee68c4 Mon Sep 17 00:00:00 2001
2From: Michael Forney <mforney@mforney.org>
3Date: Tue, 5 May 2026 10:14:11 -0700
4Subject: [PATCH] Only register constructor when it's needed
5
6---
7 crypto/crypto_init.c | 9 ++-------
8 1 file changed, 2 insertions(+), 7 deletions(-)
9
10diff --git a/crypto/crypto_init.c b/crypto/crypto_init.c
11index ae4914e35..2c8c6e81c 100644
12--- a/crypto/crypto_init.c
13+++ b/crypto/crypto_init.c
14@@ -37,15 +37,9 @@ static pthread_once_t crypto_init_once = PTHREAD_ONCE_INIT;
15 static pthread_t crypto_init_thread;
16 static int crypto_init_cleaned_up;
17
18+#ifdef HAVE_CRYPTO_CPU_CAPS_INIT
19 void openssl_init_crypto_constructor(void) __attribute__((constructor));
20
21-#ifndef HAVE_CRYPTO_CPU_CAPS_INIT
22-void
23-crypto_cpu_caps_init(void)
24-{
25-}
26-#endif
27-
28 /*
29 * This function is invoked as a constructor when the library is loaded. The
30 * code run from here must not allocate memory or trigger signals. The only
31@@ -56,6 +50,7 @@ openssl_init_crypto_constructor(void)
32 {
33 crypto_cpu_caps_init();
34 }
35+#endif
36
37 /*
38 * This is used by various configure scripts to check availability of libcrypto,
39--
402.49.0
41