summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2021-03-19 22:11:14 +0000
committerLars Wendler <polynomial-c@gentoo.org>2021-03-22 09:57:42 +0100
commit9c56995f410c33050133c71a45da78f4d3ee9868 (patch)
tree9bb13e1a9d1c955f0bb77cae69514840e1e3c0c7 /sys-apps/grep
parentsys-apps/grep: update metadata indentation (diff)
downloadgentoo-9c56995f410c33050133c71a45da78f4d3ee9868.tar.gz
gentoo-9c56995f410c33050133c71a45da78f4d3ee9868.tar.bz2
gentoo-9c56995f410c33050133c71a45da78f4d3ee9868.zip
sys-apps/grep: use dev-libs/libsigsegv for stack overflow handling on sparc
This fixes test failures on sparc in grep 3.6, although 3.5 still fails. (This seems to be because of an older copy of gnulib in that version.) It seems too risky to to backport gnulib changes to grep 3.5. [Note that I ended up discovering an independent issue because filename-lineno.pl failed on sparc too. This ended up being a real bug in that libpcre upstream doesn't support JIT on sparc64 which manifested in both the test failing and e.g. grep -P foo dying with SIGBUS. I've therefore masked dev-libs/libpcre[jit] on sparc64 in fd573f4.] URL: https://lists.gnu.org/archive/html/bug-gnulib/2021-02/msg00002.html URL: https://debbugs.gnu.org/46227 Bug: https://bugs.gentoo.org/673524 Closes: https://bugs.gentoo.org/768135 Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
Diffstat (limited to 'sys-apps/grep')
-rw-r--r--sys-apps/grep/grep-3.5.ebuild15
-rw-r--r--sys-apps/grep/grep-3.6.ebuild15
2 files changed, 24 insertions, 6 deletions
diff --git a/sys-apps/grep/grep-3.5.ebuild b/sys-apps/grep/grep-3.5.ebuild
index c66425de5967..4360f8880ff0 100644
--- a/sys-apps/grep/grep-3.5.ebuild
+++ b/sys-apps/grep/grep-3.5.ebuild
@@ -15,7 +15,11 @@ SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="nls pcre static"
-LIB_DEPEND="pcre? ( >=dev-libs/libpcre-7.8-r1[static-libs(+)] )"
+# We lack dev-libs/libsigsegv[static-libs] for now
+REQUIRED_USE="static? ( !sparc )"
+
+LIB_DEPEND="pcre? ( >=dev-libs/libpcre-7.8-r1[static-libs(+)] )
+ sparc? ( dev-libs/libsigsegv )"
RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
nls? ( virtual/libintl )
virtual/libiconv"
@@ -39,8 +43,13 @@ src_prepare() {
src_configure() {
use static && append-ldflags -static
- # don't link against libsigsegv even when available, bug #673524
- export ac_cv_libsigsegv=no
+
+ # We used to turn this off unconditionally (bug #673524) but we now
+ # allow it for cases where libsigsegv is better for userspace handling
+ # of stack overflows.
+ # In particular, it's necessary for sparc: bug #768135
+ export ac_cv_libsigsegv=$(usex sparc)
+
# Always use pkg-config to get lib info for pcre.
export ac_cv_search_pcre_compile=$(
usex pcre "$($(tc-getPKG_CONFIG) --libs $(usex static --static '') libpcre)" ''
diff --git a/sys-apps/grep/grep-3.6.ebuild b/sys-apps/grep/grep-3.6.ebuild
index 576125c1c746..5d2f499deab4 100644
--- a/sys-apps/grep/grep-3.6.ebuild
+++ b/sys-apps/grep/grep-3.6.ebuild
@@ -14,7 +14,11 @@ SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="nls pcre static"
-LIB_DEPEND="pcre? ( >=dev-libs/libpcre-7.8-r1[static-libs(+)] )"
+# We lack dev-libs/libsigsegv[static-libs] for now
+REQUIRED_USE="static? ( !sparc )"
+
+LIB_DEPEND="pcre? ( >=dev-libs/libpcre-7.8-r1[static-libs(+)] )
+ sparc? ( dev-libs/libsigsegv )"
RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
nls? ( virtual/libintl )
virtual/libiconv"
@@ -38,8 +42,13 @@ src_prepare() {
src_configure() {
use static && append-ldflags -static
- # don't link against libsigsegv even when available, bug #673524
- export ac_cv_libsigsegv=no
+
+ # We used to turn this off unconditionally (bug #673524) but we now
+ # allow it for cases where libsigsegv is better for userspace handling
+ # of stack overflows.
+ # In particular, it's necessary for sparc: bug #768135
+ export ac_cv_libsigsegv=$(usex sparc)
+
# Always use pkg-config to get lib info for pcre.
export ac_cv_search_pcre_compile=$(
usex pcre "$($(tc-getPKG_CONFIG) --libs $(usex static --static '') libpcre)" ''