zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@zsh.org>
To: "Claes Nästén" <pekdon@gmail.com>
Cc: zsh-workers <zsh-workers@zsh.org>
Subject: Re: [PATCH] Do not define _POSIX_C_SOURCE when checking for sigset_t on Solaris
Date: Tue, 07 Dec 2021 19:20:45 +0100	[thread overview]
Message-ID: <2857-1638901245.652587@SP8t.pF8U.pPnY> (raw)
In-Reply-To: <1637648446-sup-9516@debian9>

On 23 Nov, Claes Nästén wrote:
> Trying to compile zsh on Solaris 10 fails for me right after
> configuration due to misleading information in config.h
>
> The check for sigset_t fails, due to:

Thank you for isolating the cause of this and for the clear report.

The definition of _POSIX_C_SOURCE was added in 28989 (April 2011) for
compatibility with musl libc.

I was thinking it'd be better to define it only for musl rather building
up a list of exceptions such as Solaris. Trying a zsh build on a recent
Alpine Linux system running within podman, it appears to return "yes"
for the sigset_t test both with and without the #define. Perhaps musl
has evolved for greater compatibility with glibc since 2011. I don't
think we should be too concerned about the potential for someone to still
be using old musl. Solaris 10, while quite a bit older than that if
you don't count updates, is still relevant.

patch -R wouldn't work with 28989 because it was using the old
AC_TRY_COMPILE macro at that time so I have attached a patch.

Oliver

diff --git a/configure.ac b/configure.ac
index 1af5a2854..8bba78c56 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1135,8 +1135,7 @@ dnl Check for sigset_t.  Currently I'm looking in
 dnl <sys/types.h> and <signal.h>.  Others might need
 dnl to be added.
 AC_CACHE_CHECK(for sigset_t, zsh_cv_type_sigset_t,
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _POSIX_C_SOURCE 200809L
-#include <sys/types.h>
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
 #include <signal.h>]], [[sigset_t tempsigset;]])],[zsh_cv_type_sigset_t=yes],[zsh_cv_type_sigset_t=no])])
 AH_TEMPLATE([sigset_t],
 [Define to `unsigned int' if <sys/types.h> or <signal.h> doesn't define])


  reply	other threads:[~2021-12-07 18:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23  6:46 Claes Nästén
2021-12-07 18:20 ` Oliver Kiddle [this message]
2021-12-08  6:23   ` Claes Nästén

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2857-1638901245.652587@SP8t.pF8U.pPnY \
    --to=opk@zsh.org \
    --cc=pekdon@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).