Subject: bug#50098: closed (Re: bug#50098: Configuring --with-libsigsegv results in link error)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 17 Aug 2021 19:13:01 +0000

Your bug report

#50098: Configuring --with-libsigsegv results in link error

which was filed against the grep package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
50098: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=50098
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#50098: Configuring --with-libsigsegv results in link error
From: Paul Eggert <[email-masked]>
To: Evan Miller <[email-masked]>
Cc: Gnulib bugs <[email-masked]>, [email-masked]
Date: Tue, 17 Aug 2021 12:12:17 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

On 8/17/21 11:06 AM, Evan Miller wrote:
> Using grep 3.7 (as well as master), I'm seeing undefined symbol errors after pointing the build to use a local installation of libsigsegv (version 2.13).

Thanks for reporting that. It's a bug in Gnulib's c-stack module, which 
I fixed in Gnulib by installing the attached. The problem should be 
fixed in the next Grep release. In the meantime you should be able work 
around the Grep problem by not using --with-libsigsegv.
>From 592555eb0ed347452cf3834e1638ab474e948532 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Tue, 17 Aug 2021 12:06:42 -0700
Subject: [PATCH] c-stack: fix libsigsegv dependency

Problem reported for GNU grep by Evan Miller (Bug#50098).
* m4/c-stack.m4 (gl_C_STACK): Call gl_LIBSIGSEGV before
testing gl_cv_lib_sigsegv.
---
 ChangeLog     | 7 +++++++
 m4/c-stack.m4 | 3 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index ddf2943b0..d42551ce1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-08-17  Paul Eggert  <[email-masked]>
+
+	c-stack: fix libsigsegv dependency
+	Problem reported for GNU grep by Evan Miller (Bug#50098).
+	* m4/c-stack.m4 (gl_C_STACK): Call gl_LIBSIGSEGV before
+	testing gl_cv_lib_sigsegv.
+
 2021-08-14  Bruno Haible  <[email-masked]>
 
 	doc: Update for glibc 2.34.
diff --git a/m4/c-stack.m4 b/m4/c-stack.m4
index 7cccb06c1..f3de54fad 100644
--- a/m4/c-stack.m4
+++ b/m4/c-stack.m4
@@ -7,12 +7,13 @@
 
 # Written by Paul Eggert.
 
-# serial 23
+# serial 24
 
 AC_DEFUN([gl_C_STACK],
 [
   dnl 'c-stack' needs -lsigsegv if and only if the 'sigsegv' module needs it.
   if test "$with_libsigsegv" = yes; then
+    gl_LIBSIGSEGV
     if test "$gl_cv_lib_sigsegv" = yes; then
       AC_SUBST([LIBCSTACK], [$LIBSIGSEGV])
       AC_SUBST([LTLIBCSTACK], [$LTLIBSIGSEGV])
-- 
2.30.2

Subject: Configuring --with-libsigsegv results in link error
From: Evan Miller <[email-masked]>
To: [email-masked]
Date: Tue, 17 Aug 2021 14:06:09 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Using grep 3.7 (as well as master), I'm seeing undefined symbol errors after pointing the build to use a local installation of libsigsegv (version 2.13).

Making all in src
  CCLD     grep
Undefined symbols:
  "_stackoverflow_install_handler", referenced from:
      _c_stack_action in libgreputils.a(c-stack.o)
  "_sigsegv_install_handler", referenced from:
      _c_stack_action in libgreputils.a(c-stack.o)
ld: symbol(s) not found

Configure appears to find the library (which is provided by MacPorts) correctly. The config.log contains:

LIBSIGSEGV='-L/opt/local/lib -lsigsegv'

Compiler

powerpc-apple-darwin8-gcc-apple-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3) (MacPorts apple-gcc42 5666.3_16)

System

8.11.0 Darwin Kernel Version 8.11.0: Wed Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC Power Macintosh powerpc

It's an older system but seems close to building the program. Let me know what additional information would be useful for debugging.

Evan