NetBSD Problem Report #49782

From www@NetBSD.org  Tue Mar 24 04:41:54 2015
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id B32B6A582D
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 24 Mar 2015 04:41:54 +0000 (UTC)
Message-Id: <20150324044153.51183A6552@mollari.NetBSD.org>
Date: Tue, 24 Mar 2015 04:41:53 +0000 (UTC)
From: bnjf+netbsd@bnjf.id.au
Reply-To: bnjf+netbsd@bnjf.id.au
To: gnats-bugs@NetBSD.org
Subject: textproc/mdocml won't build on Solaris
X-Send-Pr-Version: www-1.0

>Number:         49782
>Category:       pkg
>Synopsis:       textproc/mdocml won't build on Solaris
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    solaris-pkg-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 24 04:45:00 +0000 2015
>Closed-Date:    Tue Apr 12 08:15:07 +0000 2016
>Last-Modified:  Tue Apr 12 08:20:01 +0000 2016
>Originator:     Brad Forschinger
>Release:        2014Q4
>Organization:
>Environment:
SunOS x 5.10 Generic_Virtual sun4u sparc SUNW,SPARC-Enterprise
>Description:

No dirfd() on Solaris
>How-To-Repeat:

>Fix:

In compat_fts.c:

#ifndef __sun
        if (fts_safe_changedir(sp, cur, dirfd(dirp), NULL)) {
#else
        if (fts_safe_changedir(sp, cur, dirp->dd_fd, NULL)) {
#endif

>Release-Note:

>Audit-Trail:
From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/49782: textproc/mdocml won't build on Solaris
Date: Tue, 24 Mar 2015 05:58:52 +0000

 On Tue, Mar 24, 2015 at 04:45:00AM +0000, bnjf+netbsd@bnjf.id.au wrote:
  > In compat_fts.c:
  > 
  > #ifndef __sun
  >         if (fts_safe_changedir(sp, cur, dirfd(dirp), NULL)) {
  > #else
  >         if (fts_safe_changedir(sp, cur, dirp->dd_fd, NULL)) {
  > #endif

 Does it work to do

    #ifndef dirfd
    #define dirfd(dirp) dirp->dd_fd
    #endif

 ?

 -- 
 David A. Holland
 dholland@netbsd.org

From: Brad Forschinger <bnjf@bnjf.id.au>
To: gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org, 
	bnjf+netbsd@bnjf.id.au
Subject: Re: pkg/49782: textproc/mdocml won't build on Solaris
Date: Tue, 24 Mar 2015 17:05:52 +1100

 Yep!

 --- compat_fts.c.orig   Tue Mar 24 17:02:51 2015
 +++ compat_fts.c        Tue Mar 24 17:04:04 2015
 @@ -73,6 +73,13 @@

  #define        FCHDIR(sp, fd)  (!ISSET(FTS_NOCHDIR) && fchdir(fd))

 +#ifndef dirfd
 +#define dirfd(dirp) (dirp)->dd_fd
 +#endif
 +#ifndef O_CLOEXEC
 +#define O_CLOEXEC 0
 +#endif
 +
  FTS *
  fts_open(char * const *argv, int options, void *dummy)
  {

Responsible-Changed-From-To: pkg-manager->solaris-pkg-people
Responsible-Changed-By: wiz@NetBSD.org
Responsible-Changed-When: Tue, 24 Mar 2015 07:50:57 +0000
Responsible-Changed-Why:
Please try mdocml from pkgsrc-current.


State-Changed-From-To: open->feedback
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Tue, 24 Mar 2015 07:50:57 +0000
State-Changed-Why:


From: Brad Forschinger <bnjf@bnjf.id.au>
To: gnats-bugs@netbsd.org
Cc: solaris-pkg-people@netbsd.org, pkg-manager@netbsd.org, 
	pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org, wiz@netbsd.org, 
	bnjf+netbsd@bnjf.id.au
Subject: Re: pkg/49782 (textproc/mdocml won't build on Solaris)
Date: Wed, 8 Apr 2015 10:24:33 +1000

 No good.  The patch is looking for __sun__, not __sun.

 +#ifdef __sun__

 should be

 +#ifdef __sun

 in patch-compat_fts.c.

From: Brad Forschinger <bnjf@bnjf.id.au>
To: gnats-bugs@netbsd.org
Cc: solaris-pkg-people@netbsd.org, pkg-manager@netbsd.org, 
	pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org, wiz@netbsd.org, 
	bnjf+netbsd@bnjf.id.au
Subject: Re: pkg/49782 (textproc/mdocml won't build on Solaris)
Date: Wed, 8 Apr 2015 10:34:29 +1000

 diff --git a/textproc/mdocml/distinfo b/textproc/mdocml/distinfo
 index ed4b90e..b591712 100644
 --- a/textproc/mdocml/distinfo
 +++ b/textproc/mdocml/distinfo
 @@ -3,5 +3,5 @@ $NetBSD: distinfo,v 1.40 2015/03/26 19:59:53 sevan Exp $
  SHA1 (mdocml-1.13.3.tar.gz) = 3ccfbb492a477b84343c97de743b3dd5bd3c763b
  RMD160 (mdocml-1.13.3.tar.gz) = 47d1096708b45b15d8f198404fd6608d164bb66a
  Size (mdocml-1.13.3.tar.gz) = 358971 bytes
 -SHA1 (patch-compat_fts.c) = bc20484964d8ff0aa2af07d581bad39a6c056a5a
 +SHA1 (patch-compat_fts.c) = f2ffc9266f76c164b58b3e2bd1f2d180f2676a70
  SHA1 (patch-roff.7) = 22335024f83abc347ca39aabf7ab8d9cb38f7db2
 diff --git a/textproc/mdocml/patches/patch-compat_fts.c
 b/textproc/mdocml/patches/patch-compat_fts.c
 index 102632d..8371c94 100644
 --- a/textproc/mdocml/patches/patch-compat_fts.c
 +++ b/textproc/mdocml/patches/patch-compat_fts.c
 @@ -8,7 +8,7 @@ Fix build under Solaris 10.

   #define       FCHDIR(sp, fd)  (!ISSET(FTS_NOCHDIR) && fchdir(fd))

 -+#ifdef __sun__
 ++#ifdef __sun
  +#define dirfd(fd) ((fd)->dd_fd)
  +#endif
  +

From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, solaris-pkg-people@NetBSD.org, 
	gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org, bnjf+netbsd@bnjf.id.au
Cc: 
Subject: Re: pkg/49782 (textproc/mdocml won't build on Solaris)
Date: Tue, 7 Apr 2015 21:17:07 -0400

 On Apr 8, 12:25am, bnjf@bnjf.id.au (Brad Forschinger) wrote:
 -- Subject: Re: pkg/49782 (textproc/mdocml won't build on Solaris)

 | The following reply was made to PR pkg/49782; it has been noted by GNATS.
 | 
 | From: Brad Forschinger <bnjf@bnjf.id.au>
 | To: gnats-bugs@netbsd.org
 | Cc: solaris-pkg-people@netbsd.org, pkg-manager@netbsd.org, 
 | 	pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org, wiz@netbsd.org, 
 | 	bnjf+netbsd@bnjf.id.au
 | Subject: Re: pkg/49782 (textproc/mdocml won't build on Solaris)
 | Date: Wed, 8 Apr 2015 10:24:33 +1000
 | 
 |  No good.  The patch is looking for __sun__, not __sun.
 |  
 |  +#ifdef __sun__
 |  
 |  should be
 |  
 |  +#ifdef __sun
 |  
 |  in patch-compat_fts.c.

 This is compiler-dependent. You should check for either like:

     #if defined(__sun) || defined(__sun__)

 to be safe...

 christos

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: Christos Zoulas <christos@netbsd.org>
Subject: Re: pkg/49782 (textproc/mdocml won't build on Solaris)
Date: Thu, 28 May 2015 19:57:31 +0000

 On Wed, Apr 08, 2015 at 01:20:01AM +0000, Christos Zoulas wrote:
  >  |  No good.  The patch is looking for __sun__, not __sun.
  >  |  
  >  |  +#ifdef __sun__
  >  |  
  >  |  should be
  >  |  
  >  |  +#ifdef __sun
  >  |  
  >  |  in patch-compat_fts.c.
  >  
  >  This is compiler-dependent. You should check for either like:
  >  
  >      #if defined(__sun) || defined(__sun__)
  >  
  >  to be safe...

 pkglint has been telling us for years to use only __sun; is that
 wrong?

 -- 
 David A. Holland
 dholland@netbsd.org

From: christos@zoulas.com (Christos Zoulas)
To: David Holland <dholland-pbugs@netbsd.org>, gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/49782 (textproc/mdocml won't build on Solaris)
Date: Thu, 28 May 2015 16:22:35 -0400

 On May 28,  7:57pm, dholland-pbugs@netbsd.org (David Holland) wrote:
 -- Subject: Re: pkg/49782 (textproc/mdocml won't build on Solaris)

 | pkglint has been telling us for years to use only __sun; is that
 | wrong?

 gcc -dM -E - < /dev/null...

 I believe that __foo__ symbols are the new and preferred way, where
 __foo are historical...

 christos

From: Jonathan Perkin <jperkin@pkgsrc.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/49782 (textproc/mdocml won't build on Solaris)
Date: Thu, 28 May 2015 22:23:41 +0100

 * On 2015-05-28 at 21:25 BST, Christos Zoulas wrote:

 > On May 28,  7:57pm, dholland-pbugs@netbsd.org (David Holland) wrote:
 >  
 > > pkglint has been telling us for years to use only __sun; is that
 > > wrong?
 >
 > gcc -dM -E - < /dev/null...
 >
 > I believe that __foo__ symbols are the new and preferred way, where
 > __foo are historical...

 GCC defines both, but I believe Studio only defines __sun.

 Just use __sun, as we already do in the vast majority of patches.

 -- 
 Jonathan Perkin       www.perkin.org.uk
 github.com/jperkin  twitter.com/jperkin

From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, solaris-pkg-people@NetBSD.org, 
	gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org, bnjf+netbsd@bnjf.id.au
Cc: 
Subject: Re: pkg/49782 (textproc/mdocml won't build on Solaris)
Date: Thu, 28 May 2015 20:00:47 -0400

 On May 28,  9:25pm, jperkin@pkgsrc.org (Jonathan Perkin) wrote:
 -- Subject: Re: pkg/49782 (textproc/mdocml won't build on Solaris)

 |  > I believe that __foo__ symbols are the new and preferred way, where
 |  > __foo are historical...
 |  
 |  GCC defines both, but I believe Studio only defines __sun.
 |  
 |  Just use __sun, as we already do in the vast majority of patches.

 Doing both is safer... There are many symbols where __foo__ is
 defined and __foo is not. I can think of one important example
 (__STDC__). Having a unified rule for all of them is less thinking
 when you need to decide what to code.

 christos

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/49782 (textproc/mdocml won't build on Solaris)
Date: Fri, 29 May 2015 08:36:14 +0000

 On Fri, May 29, 2015 at 12:05:01AM +0000, Christos Zoulas wrote:
  >  |  > I believe that __foo__ symbols are the new and preferred way, where
  >  |  > __foo are historical...
  >  |  
  >  |  GCC defines both, but I believe Studio only defines __sun.
  >  |  
  >  |  Just use __sun, as we already do in the vast majority of patches.
  >  
  >  Doing both is safer... There are many symbols where __foo__ is
  >  defined and __foo is not. I can think of one important example
  >  (__STDC__). Having a unified rule for all of them is less thinking
  >  when you need to decide what to code.

 That's why pkglint is there to keep track of it for us...

 -- 
 David A. Holland
 dholland@netbsd.org

From: Brad Forschinger <bnjf@bnjf.id.au>
To: gnats-bugs@netbsd.org
Cc: solaris-pkg-people@netbsd.org, gnats-admin@netbsd.org, 
	pkgsrc-bugs@netbsd.org, bnjf+netbsd@bnjf.id.au
Subject: Re: pkg/49782 (textproc/mdocml won't build on Solaris)
Date: Mon, 7 Sep 2015 12:47:29 +1000

 I keep getting pestered by GNATS, so I thought I'd better reply.

 The patch still hasn't been included, so it still doesn't build.

 On Fri, May 29, 2015 at 6:40 PM, David Holland
 <dholland-pbugs@netbsd.org> wrote:
 > The following reply was made to PR pkg/49782; it has been noted by GNATS.
 >
 > From: David Holland <dholland-pbugs@netbsd.org>
 > To: gnats-bugs@NetBSD.org
 > Cc:
 > Subject: Re: pkg/49782 (textproc/mdocml won't build on Solaris)
 > Date: Fri, 29 May 2015 08:36:14 +0000
 >
 >  On Fri, May 29, 2015 at 12:05:01AM +0000, Christos Zoulas wrote:
 >   >  |  > I believe that __foo__ symbols are the new and preferred way, where
 >   >  |  > __foo are historical...
 >   >  |
 >   >  |  GCC defines both, but I believe Studio only defines __sun.
 >   >  |
 >   >  |  Just use __sun, as we already do in the vast majority of patches.
 >   >
 >   >  Doing both is safer... There are many symbols where __foo__ is
 >   >  defined and __foo is not. I can think of one important example
 >   >  (__STDC__). Having a unified rule for all of them is less thinking
 >   >  when you need to decide what to code.
 >
 >  That's why pkglint is there to keep track of it for us...
 >
 >  --
 >  David A. Holland
 >  dholland@netbsd.org
 >

From: Brad Forschinger <bnjf@bnjf.id.au>
To: gnats-bugs@netbsd.org
Cc: solaris-pkg-people@netbsd.org, gnats-admin@netbsd.org, 
	pkgsrc-bugs@netbsd.org
Subject: Re: pkg/49782 (textproc/mdocml won't build on Solaris)
Date: Tue, 12 Apr 2016 15:53:41 +1000

 pkgsrc_2016q1 still hasn't fixed this PR.

 --- a/textproc/mdocml/patches/patch-compat_fts.c
 +++ b/textproc/mdocml/patches/patch-compat_fts.c
 @@ -8,7 +8,7 @@ Fix build under Solaris 10 and HP-UX.

   #define       FCHDIR(sp, fd)  (!ISSET(FTS_NOCHDIR) && fchdir(fd))

 -+#if defined(__sun__) || defined(__hpux)
 ++#if defined(__sun) || defined(__hpux)
  +#define dirfd(fd) ((fd)->dd_fd)
  +#endif
  +

State-Changed-From-To: feedback->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Tue, 12 Apr 2016 08:15:07 +0000
State-Changed-Why:
Changed as suggested, thanks!


From: "Thomas Klausner" <wiz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49782 CVS commit: pkgsrc/textproc/mdocml
Date: Tue, 12 Apr 2016 08:14:50 +0000

 Module Name:	pkgsrc
 Committed By:	wiz
 Date:		Tue Apr 12 08:14:50 UTC 2016

 Modified Files:
 	pkgsrc/textproc/mdocml: distinfo
 	pkgsrc/textproc/mdocml/patches: patch-compat_fts.c

 Log Message:
 Use __sun instead of __sun__.

 From Brad Forschinger in PR 49782.


 To generate a diff of this commit:
 cvs rdiff -u -r1.44 -r1.45 pkgsrc/textproc/mdocml/distinfo
 cvs rdiff -u -r1.6 -r1.7 pkgsrc/textproc/mdocml/patches/patch-compat_fts.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.