File 2081-Remove-OSSF-compile-option-ftrivial-auto-var-init-ze.patch of Package erlang

From 4344378795cbe679f9ba832a029e532f14af9093 Mon Sep 17 00:00:00 2001
From: Sverker Eriksson <sverker@erlang.org>
Date: Thu, 24 Apr 2025 12:19:19 +0200
Subject: [PATCH 1/2] Remove OSSF compile option -ftrivial-auto-var-init=zero

Seen to cause notable performance regressions due to large stack
allocated variables (ErtsDistExternal in binary_to_term_int()). Skip it
until we have purged the code base from all such large stack frames.
---
 make/autoconf/otp.m4 | 1 -
 1 file changed, 1 deletion(-)

diff --git a/make/autoconf/otp.m4 b/make/autoconf/otp.m4
index d1e61cd1b1..2ca07d8d0e 100644
--- a/make/autoconf/otp.m4
+++ b/make/autoconf/otp.m4
@@ -3182,7 +3182,6 @@ AC_DEFUN([ERL_OSSF_CFLAGS],
         LM_TRY_ENABLE_CFLAG([-fno-strict-overflow],[$1])
         LM_TRY_ENABLE_CFLAG([-fno-delete-null-pointer-checks],[$1])
         LM_TRY_ENABLE_CFLAG([-fno-strict-aliasing],[$1])
-        LM_TRY_ENABLE_CFLAG([-ftrivial-auto-var-init=zero],[$1])
         LM_TRY_ENABLE_CFLAG([-fstrict-flex-arrays=3],[$1])
         AS_IF([test "X$can_enable_flag" = "Xfalse"],
           [
-- 
2.43.0

openSUSE Build Service is sponsored by