commit:     678d182b6697a58987be422b57a364df7802c283
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Thu Feb 27 17:41:54 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun May 18 15:22:00 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=678d182b

gnustep-base/libobjc2: fix exception handling

Bug: https://bugs.gentoo.org/871933
Bug: https://bugs.gentoo.org/926875
Bug: https://bugs.gentoo.org/940647
Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/42071
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...bjc-2.2.1-remove-flags-from-eh_trampoline.patch | 28 +++++++++++++++
 gnustep-base/libobjc2/libobjc2-2.2.1-r1.ebuild     | 40 ++++++++++++++++++++++
 2 files changed, 68 insertions(+)

diff --git 
a/gnustep-base/libobjc2/files/libobjc-2.2.1-remove-flags-from-eh_trampoline.patch
 
b/gnustep-base/libobjc2/files/libobjc-2.2.1-remove-flags-from-eh_trampoline.patch
new file mode 100644
index 000000000000..4f5e786c29c3
--- /dev/null
+++ 
b/gnustep-base/libobjc2/files/libobjc-2.2.1-remove-flags-from-eh_trampoline.patch
@@ -0,0 +1,28 @@
+https://bugs.gentoo.org/926875
+https://bugs.gentoo.org/940647
+https://github.com/gnustep/libobjc2/pull/288
+https://github.com/gnustep/libobjc2/commit/4a0c2f1afee5a6c618d51fb33efb9ccb95b808b8
+https://github.com/gnustep/libobjc2/issues/177
+
+From 4a0c2f1afee5a6c618d51fb33efb9ccb95b808b8 Mon Sep 17 00:00:00 2001
+From: Frederik Carlier <[email protected]>
+Date: Tue, 2 Apr 2024 14:53:43 +0200
+Subject: [PATCH] Don't use CXXFLAGS when compiling eh_trampoline.cc
+
+We don't want the user to override these flags because that file
+needs to be compiled in a very specific way.
+
+Re-applies #178 (365e53632e8be41e49f21ee47a63e41be424a237)
+Related to #183
+Fixes #177
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -230,7 +230,7 @@ elseif (MINGW)
+       message(STATUS "Using MinGW-compatible exception model")
+       list(APPEND libobjc_CXX_SRCS objcxx_eh.cc objcxx_eh_mingw.cc)
+ else ()
+-      separate_arguments(EH_PERSONALITY_FLAGS NATIVE_COMMAND 
${CMAKE_CXX_FLAGS})
++      set(EH_PERSONALITY_FLAGS "")
+       if (CMAKE_CXX_COMPILER_TARGET)
+               list(APPEND EH_PERSONALITY_FLAGS 
"${CMAKE_CXX_COMPILE_OPTIONS_TARGET}${CMAKE_CXX_COMPILER_TARGET}")
+       endif ()

diff --git a/gnustep-base/libobjc2/libobjc2-2.2.1-r1.ebuild 
b/gnustep-base/libobjc2/libobjc2-2.2.1-r1.ebuild
new file mode 100644
index 000000000000..e8052aa857a7
--- /dev/null
+++ b/gnustep-base/libobjc2/libobjc2-2.2.1-r1.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+inherit cmake flag-o-matic toolchain-funcs
+
+DESCRIPTION="GNUstep Objective-C runtime"
+HOMEPAGE="https://gnustep.github.io";
+SRC_URI="https://github.com/gnustep/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="dev-cpp/robin-map"
+BDEPEND="${RDEPEND}
+       llvm-core/clang"
+
+PATCHES=(
+       "${FILESDIR}"/libobjc-2.2.1-remove-flags-from-eh_trampoline.patch
+)
+
+src_configure() {
+       if tc-is-gcc; then
+               einfo "Forcing clang"
+               export CC="${CHOST}-clang"
+               export CXX="${CHOST}-clang++"
+
+               # Strip unsupported flags for clang. bug #871933
+               strip-unsupported-flags
+       fi
+
+       local mycmakeargs=(
+               -DGNUSTEP_CONFIG=GNUSTEP_CONFIG-NOTFOUND
+               -DTESTS="$(usex test)"
+       )
+       cmake_src_configure
+}

Reply via email to