File 1229-Fix-cc.sh-to-respect-O0-and-Og.patch of Package erlang

From cf4c2798ce5e2494a44cb10eb41c9bb36274a2a8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lukas=20Backstr=C3=B6m?= <lukas@erlang.org>
Date: Thu, 13 Feb 2025 22:37:14 +0100
Subject: [PATCH 1/3] Fix cc.sh to respect -O0 and -Og

---
 erts/etc/win32/cygwin_tools/vc/cc.sh | 2 ++
 erts/etc/win32/msys_tools/vc/cc.sh   | 2 ++
 erts/etc/win32/wsl_tools/vc/cc.sh    | 2 +-
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/erts/etc/win32/cygwin_tools/vc/cc.sh b/erts/etc/win32/cygwin_tools/vc/cc.sh
index 5dc9666eea..9c24661f32 100755
--- a/erts/etc/win32/cygwin_tools/vc/cc.sh
+++ b/erts/etc/win32/cygwin_tools/vc/cc.sh
@@ -94,6 +94,8 @@ while test -n "$1" ; do
 		MD=-MD;
 	    fi
 	    OPTIMIZED_BUILD=true;;
+        -O0|-Og)
+            ;;
 	-O*)
 	    # Optimization hardcoded, needs to disable debugging too
 	    OPTIMIZE_FLAGS="-Ox -Zi";
diff --git a/erts/etc/win32/msys_tools/vc/cc.sh b/erts/etc/win32/msys_tools/vc/cc.sh
index ee24e4bab6..2f6ed912fc 100644
--- a/erts/etc/win32/msys_tools/vc/cc.sh
+++ b/erts/etc/win32/msys_tools/vc/cc.sh
@@ -95,6 +95,8 @@ while test -n "$1" ; do
 		MD=-MD;
 	    fi
 	    OPTIMIZED_BUILD=true;;
+        -O0|-Og)
+            ;;
 	-O*)
 	    # Optimization hardcoded, needs to disable debugging too
 	    OPTIMIZE_FLAGS="-Ox -Zi";
diff --git a/erts/etc/win32/wsl_tools/vc/cc.sh b/erts/etc/win32/wsl_tools/vc/cc.sh
index dd736e7443..d5dc95378c 100755
--- a/erts/etc/win32/wsl_tools/vc/cc.sh
+++ b/erts/etc/win32/wsl_tools/vc/cc.sh
@@ -123,7 +123,7 @@ while test -n "$1" ; do
 		MD=-MD;
 	    fi
 	    OPTIMIZED_BUILD=true;;
-        -O0)
+        -O0|-Og)
             ;;
 	-O*)
 	    # Optimization hardcoded
-- 
2.43.0

openSUSE Build Service is sponsored by