newer glibc version changes definition of SIGSTKSZ

Christoph Karl <[email protected]> Mon, 5 Apr 2021 09:59:30 +0200
Newsgroups gmane.comp.version-control.rcs.bugs
Message-ID <[email protected]>
Hello!

Due to a newer release of glibc there is the following problem with rcs:

--------
In file included from /usr/include/signal.h:315,
                  from ../lib/signal.h:52,
                  from b-isr.c:29:
b-isr.c: In function 'isr_init':
b-isr.c:202:31: error: missing binary operator before token "("
   202 | #define ISR_STACK_SIZE  (10 * SIGSTKSZ)
       |                               ^~~~~~~~
b-isr.c:212:5: note: in expansion of macro 'ISR_STACK_SIZE'
   212 | #if ISR_STACK_SIZE
       |     ^~~~~~~~~~~~~~
make[2]: *** [Makefile:1723: b-isr.o] Error 1
--------

Reason seems to be
https://www.spinics.net/lists/fedora-devel/msg285093.html

The problem poped up due to regression testing in fedora on autoconf,
but is unrelated:
Please see
https://bugzilla.redhat.com/show_bug.cgi?id=1943055

IMO the following patch will help (and is correct):
--------
diff -up rcs-5.10.0.orig/src/b-isr.c rcs-5.10.0/src/b-isr.c
--- rcs-5.10.0.orig/src/b-isr.c 2021-04-04 14:13:59.185941494 +0200
+++ rcs-5.10.0/src/b-isr.c      2021-04-04 14:15:21.087397267 +0200
@@ -198,22 +198,16 @@ setup_catchsig (size_t count, int const
  #undef MUST
  }

-#if defined HAVE_SIGALTSTACK && defined SIGSTKSZ
-#define ISR_STACK_SIZE  (10 * SIGSTKSZ)
-#else
-#define ISR_STACK_SIZE  0
-#endif
-
  struct isr_scratch *
  isr_init (bool *be_quiet)
  {
    struct isr_scratch *scratch = ZLLOC (1, struct isr_scratch);

-#if ISR_STACK_SIZE
+#if defined HAVE_SIGALTSTACK && defined SIGSTKSZ
    stack_t ss =
      {
-      .ss_sp = alloc (PLEXUS, ISR_STACK_SIZE),
-      .ss_size = ISR_STACK_SIZE,
+      .ss_sp = alloc (PLEXUS, (10 * SIGSTKSZ)),
+      .ss_size = (10 * SIGSTKSZ),
        .ss_flags = 0
      };

--------

Best regards
Christoph