NetBSD Problem Report #56519

From www@netbsd.org  Tue Nov 23 19:52:32 2021
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 778151A9239
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 23 Nov 2021 19:52:32 +0000 (UTC)
Message-Id: <20211123195230.DD8481A923B@mollari.NetBSD.org>
Date: Tue, 23 Nov 2021 19:52:30 +0000 (UTC)
From: pekdon@gmail.com
Reply-To: pekdon@gmail.com
To: gnats-bugs@NetBSD.org
Subject: zsh fails to build on Solaris 10
X-Send-Pr-Version: www-1.0

>Number:         56519
>Category:       pkg
>Synopsis:       zsh fails to build on Solaris 10
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 23 19:55:00 +0000 2021
>Closed-Date:    Thu May 26 22:05:28 +0000 2022
>Last-Modified:  Thu May 26 22:05:28 +0000 2022
>Originator:     Claes Nästén
>Release:        trunk 2021-11-21
>Organization:
>Environment:
SunOS 5.10 sun4u sparc SUNW,Sun-Blade-1500

>Description:
Compiling zsh fails on Solaris 10 due to checks in configure not detecting the presence of sigset_t (and others).

From the config.log:

configure:8654: checking for sigset_t
configure:8673: gcc -c  -Wall -Wmissing-prototypes -O2  conftest.c >&5
In file included from /usr/include/sys/types.h:17,
                 from conftest.c:85:
/usr/pkg/gcc8/lib/gcc/sparc64-sun-solaris2.10/8.4.0/include-fixed/sys/feature_tee
sts.h:346:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open aa
pplications     and pre-2001 POSIX applications"
 #error "Compiler or options invalid for pre-UNIX 03 X/Open applications \
  ^~~~~
conftest.c: In function 'main':
conftest.c:90:10: warning: unused variable 'tempsigset' [-Wunused-variable]
 sigset_t tempsigset;
          ^~~~~~~~~~
configure:8673: $? = 1
>How-To-Repeat:
Build zsh on Solaris 10.
>Fix:
--- shells/zsh/patches/patch-configure.ac.orig  Tue Nov 23 12:17:21 2021
+++ shells/zsh/patches/patch-configure.ac       Tue Nov 23 12:12:26 2021
@@ -7,9 +7,20 @@

 Fix SunOS flags.

---- configure.ac.orig  2020-02-27 02:06:19.620472371 +0000
-+++ configure.ac
-@@ -1934,77 +1934,9 @@ zsh_LIMIT_PRESENT(RLIMIT_SWAP)
+---- configure.ac.orig Fri Feb 14 23:06:57 2020
++++ configure.ac       Tue Nov 23 07:05:55 2021
+@@ -1136,7 +1136,9 @@
+ 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
++[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifndef __sun
++#  define _POSIX_C_SOURCE 200809L
++#endif
+ #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],
+@@ -1934,78 +1936,10 @@
  zsh_LIMIT_PRESENT(RLIMIT_KQUEUES)
  zsh_LIMIT_PRESENT(RLIMIT_UMTXP)

@@ -31,7 +42,10 @@
 -#endif
 -return ret;
 -}]])],[zsh_cv_rlimit_vmem_is_rss=yes],[zsh_cv_rlimit_vmem_is_rss=no],[zsh_cv_rlimit_vmem_is_rss=no])])
--
++zsh_LIMITS_EQUAL(VMEM, vmem, RSS, rss)
++zsh_LIMITS_EQUAL(VMEM, vmem, AS, as)
++zsh_LIMITS_EQUAL(RSS, rss, AS, as)
+ 
 -if test x$zsh_cv_rlimit_vmem_is_rss = xyes; then
 -  AC_DEFINE(RLIMIT_VMEM_IS_RSS)
 -fi
@@ -84,13 +98,11 @@
 -  AC_DEFINE(RLIMIT_RSS_IS_AS)
 -fi
 -
-+zsh_LIMITS_EQUAL(VMEM, vmem, RSS, rss)
-+zsh_LIMITS_EQUAL(VMEM, vmem, AS, as)
-+zsh_LIMITS_EQUAL(RSS, rss, AS, as)
- 
+-
  dnl --------------------------------------------
  dnl Check for members of struct rusage
-@@ -2857,7 +2789,7 @@ char *argv[];
+ dnl --------------------------------------------
+@@ -2857,7 +2791,7 @@
      sunos*)       DLLDFLAGS="${DLLDFLAGS=-assert nodefinitions}" ;;
      sysv4*|esix*) DLLDFLAGS="${DLLDFLAGS=-G $ldflags}" ;;
      aix*)         DLLDFLAGS="${DLLDFLAGS=-G -bexpall -lc}" ;;

>Release-Note:

>Audit-Trail:
From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/56519: zsh fails to build on Solaris 10
Date: Sun, 22 May 2022 23:43:38 +0000

 On Tue, Nov 23, 2021 at 07:55:00PM +0000, pekdon@gmail.com wrote:
  > >Description:
  > Compiling zsh fails on Solaris 10 due to checks in configure not
  > detecting the presence of sigset_t (and others).
  > 
  > From the config.log:
  > 
  > sts.h:346:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications     and pre-2001 POSIX applications"
  >  #error "Compiler or options invalid for pre-UNIX 03 X/Open applications \
  >   ^~~~~
  > [...]
  > +-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _POSIX_C_SOURCE 200809L
  > ++[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifndef __sun
  > ++#  define _POSIX_C_SOURCE 200809L
  > ++#endif

 Wouldn't it be better to pass whatever CFLAGS are needed to be allowed
 to set _POSIX_C_SOURCE as upstream wants?

 -- 
 David A. Holland
 dholland@netbsd.org

From: Claes =?utf-8?B?TsOkc3TDqW4=?= <pekdon@gmail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/56519: zsh fails to build on Solaris 10
Date: Thu, 26 May 2022 15:42:36 +0200

 This should be fine to close now, zsh 5.9 includes a change to the
 configure script to make it run on Solaris 10.

State-Changed-From-To: open->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Thu, 26 May 2022 22:05:28 +0000
State-Changed-Why:
Reported fixed, thanks for the update!


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.