File 2651-Remove-compiler-option-for-wx-only-on-MacOS.patch of Package erlang
From 55102166bb1ad94ec2361d2c6c3e6a47ca263bb3 Mon Sep 17 00:00:00 2001
From: Dmytro Lytovchenko <dima.lytovchenko@ericsson.com>
Date: Mon, 25 Aug 2025 18:24:33 +0200
Subject: [PATCH] Remove compiler option for wx only on MacOS
---
lib/wx/configure | 8 ++++++++
lib/wx/configure.ac | 10 ++++++++++
2 files changed, 18 insertions(+)
diff --git a/lib/wx/configure b/lib/wx/configure
index a9b4667a6a..3a9fb66552 100755
--- a/lib/wx/configure
+++ b/lib/wx/configure
@@ -6182,6 +6182,14 @@ fi
+case $host_os in
+ darwin*)
+ CFLAGS=`echo "$CFLAGS" | sed 's/-mbranch-protection=standard/ /g'`
+ ;;
+ *)
+ ;;
+esac
+
if test "X$windows_environment_" != "Xchecked"; then
diff --git a/lib/wx/configure.ac b/lib/wx/configure.ac
index 8a249d317b..c3825e2a54 100644
--- a/lib/wx/configure.ac
+++ b/lib/wx/configure.ac
@@ -93,6 +93,16 @@ WXERL_CAN_BUILD_DRIVER=true
ERL_OSSF_FLAGS
+case $host_os in
+ darwin*)
+ dnl For Darwin (MacOS) disable one hardening option which causes problems
+ dnl with C++ catch, as it is necessary for the module to operate correctly
+ CFLAGS=`echo "$CFLAGS" | sed 's/-mbranch-protection=standard/ /g'`
+ ;;
+ *)
+ ;;
+esac
+
LM_WINDOWS_ENVIRONMENT
USER_CFLAGS=$CFLAGS
--
2.51.0