summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2022-05-04 14:58:32 +0200
committerUlrich Müller <ulm@gentoo.org>2022-05-04 14:59:34 +0200
commit18147fe4079060b6a55d013ad58773ddf45f6efb (patch)
treed85d4f7b96353eea13079a2238a936f11b95c2e1 /app-misc/detachtty
parentapp-emacs/request: bump to 0.3.3_p20220318 (diff)
downloadgentoo-18147fe4079060b6a55d013ad58773ddf45f6efb.tar.gz
gentoo-18147fe4079060b6a55d013ad58773ddf45f6efb.tar.bz2
gentoo-18147fe4079060b6a55d013ad58773ddf45f6efb.zip
app-misc/detachtty: Fix compilation on sparc
Closes: https://bugs.gentoo.org/807184 Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Diffstat (limited to 'app-misc/detachtty')
-rw-r--r--app-misc/detachtty/detachtty-11.0.0.ebuild4
-rw-r--r--app-misc/detachtty/files/detachtty-11.0.0-sparc.patch121
2 files changed, 124 insertions, 1 deletions
diff --git a/app-misc/detachtty/detachtty-11.0.0.ebuild b/app-misc/detachtty/detachtty-11.0.0.ebuild
index 2a826d210e63..352a9433f0a6 100644
--- a/app-misc/detachtty/detachtty-11.0.0.ebuild
+++ b/app-misc/detachtty/detachtty-11.0.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -13,6 +13,8 @@ LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ppc ~sparc x86"
+PATCHES=( "${FILESDIR}/${P}-sparc.patch" )
+
src_compile() {
emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
}
diff --git a/app-misc/detachtty/files/detachtty-11.0.0-sparc.patch b/app-misc/detachtty/files/detachtty-11.0.0-sparc.patch
new file mode 100644
index 000000000000..a65907abf92b
--- /dev/null
+++ b/app-misc/detachtty/files/detachtty-11.0.0-sparc.patch
@@ -0,0 +1,121 @@
+Fix compilation on sparc.
+Patch from upstream, backported to the 11.0.0 release.
+
+commit db785c7975e364acbf76a4db90296820d36b0740
+Author: matoro <matoro@users.noreply.github.com>
+Date: Wed May 4 08:28:11 2022 -0400
+
+ check for signal existence before registering in handler (#5)
+
+ Some signals are only defined on certain platforms. For example,
+ SIGSTKFLT does not exist on sparc. Use preprocessor macros to check for
+ signal's existence before registering signal handler for it.
+
+ Note that this is the same technique cpython uses:
+ https://github.com/python/cpython/blob/3.10/Modules/signalmodule.c#L1427
+
+ See: https://bugs.gentoo.org/807184
+
+--- detachtty-11.0.0/attachtty.c
++++ detachtty-11.0.0/attachtty.c
+@@ -94,8 +94,45 @@
+ static void init_signal_handlers(void) {
+ struct sigaction act;
+ int i, fatal_sig[] = {
+- SIGHUP, SIGQUIT, SIGILL, SIGABRT, SIGBUS, SIGFPE, SIGSEGV, SIGPIPE,
+- SIGTERM, SIGSTKFLT, SIGCHLD, SIGXCPU, SIGXFSZ,
++#ifdef SIGHUP
++ SIGHUP,
++#endif
++#ifdef SIGQUIT
++ SIGQUIT,
++#endif
++#ifdef SIGILL
++ SIGILL,
++#endif
++#ifdef SIGABRT
++ SIGABRT,
++#endif
++#ifdef SIGBUS
++ SIGBUS,
++#endif
++#ifdef SIGFPE
++ SIGFPE,
++#endif
++#ifdef SIGSEGV
++ SIGSEGV,
++#endif
++#ifdef SIGPIPE
++ SIGPIPE,
++#endif
++#ifdef SIGTERM
++ SIGTERM,
++#endif
++#ifdef SIGSTKFLT
++ SIGSTKFLT,
++#endif
++#ifdef SIGCHLD
++ SIGCHLD,
++#endif
++#ifdef SIGXCPU
++ SIGXCPU,
++#endif
++#ifdef SIGXFSZ
++ SIGXFSZ,
++#endif
+ };
+
+ /* catch SIGINT and send character \003 over the link */
+--- detachtty-11.0.0/detachtty.c
++++ detachtty-11.0.0/detachtty.c
+@@ -392,9 +392,47 @@
+
+ static void init_signal_handlers(void) {
+ struct sigaction act;
+- int i, fatal_sig[] = { SIGHUP, SIGQUIT, SIGILL, SIGABRT, SIGBUS, SIGFPE,
+- SIGSEGV, /*SIGPIPE,*/ SIGTERM, SIGSTKFLT, SIGCHLD,
+- SIGXCPU, SIGXFSZ, };
++ int i, fatal_sig[] = {
++#ifdef SIGHUP
++ SIGHUP,
++#endif
++#ifdef SIGQUIT
++ SIGQUIT,
++#endif
++#ifdef SIGILL
++ SIGILL,
++#endif
++#ifdef SIGABRT
++ SIGABRT,
++#endif
++#ifdef SIGBUS
++ SIGBUS,
++#endif
++#ifdef SIGFPE
++ SIGFPE,
++#endif
++#ifdef SIGSEGV
++ SIGSEGV,
++#endif
++#ifdef SIGPIPE
++ /*SIGPIPE,*/
++#endif
++#ifdef SIGTERM
++ SIGTERM,
++#endif
++#ifdef SIGSTKFLT
++ SIGSTKFLT,
++#endif
++#ifdef SIGCHLD
++ SIGCHLD,
++#endif
++#ifdef SIGXCPU
++ SIGXCPU,
++#endif
++#ifdef SIGXFSZ
++ SIGXFSZ,
++#endif
++ };
+
+ /* catch SIGCHLD, SIGQUIT, SIGTERM, SIGILL, SIGFPE... and exit */
+ act.sa_handler = fatal_signal_handler;