NetBSD Problem Report #50589

From www@NetBSD.org  Thu Dec 24 16:18:43 2015
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.NetBSD.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 0441E7ABFD
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 24 Dec 2015 16:18:43 +0000 (UTC)
Message-Id: <20151224161841.C59D97ACC8@mollari.NetBSD.org>
Date: Thu, 24 Dec 2015 16:18:41 +0000 (UTC)
From: jba@sdf.lonestar.org
Reply-To: jba@sdf.lonestar.org
To: gnats-bugs@NetBSD.org
Subject: libarchive build fails during bootstrap on OSF/1
X-Send-Pr-Version: www-1.0

>Number:         50589
>Category:       pkg
>Synopsis:       libarchive build fails during bootstrap on OSF/1
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    joerg
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 24 16:20:00 +0000 2015
>Closed-Date:    
>Last-Modified:  Thu Jun 30 11:20:01 +0000 2016
>Originator:     Jeff Armstrong
>Release:        pkgsrc-current
>Organization:
>Environment:
OSF1 <hostname> V5.1 2650 alpha
>Description:
During bootstrap under Tru64, libarchive fails when bootstrapping with the Compaq C Compiler (ccc):

...

  CC     libarchive/archive_string.lo
  CC     libarchive/archive_string_sprintf.lo
cc: Error: libarchive/archive_string_sprintf.c, line 69: In this statement, "INTMAX_MIN" is not declared. (undeclared)
                ud = (d == INTMAX_MIN) ? (uintmax_t)(INTMAX_MAX) + 1 : (uintmax_t)(-d);
---------------------------^
cc: Error: libarchive/archive_string_sprintf.c, line 69: In this statement, "INTMAX_MAX" is not declared. (undeclared)
                ud = (d == INTMAX_MIN) ? (uintmax_t)(INTMAX_MAX) + 1 : (uintmax_t)(-d);
-----------------------------------------------------^
*** [libarchive/archive_string_sprintf.lo] Error code 1

bmake[1]: stopped in /usr/pkg/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work/libarchive
1 error

bmake[1]: stopped in /usr/pkg/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work/libarchive
*** [all] Error code 2

bmake: stopped in /usr/pkg/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work/libarchive
1 error

bmake: stopped in /usr/pkg/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work/libarchive
*** Error code 2

Stop.
bmake[1]: stopped in /usr/pkg/pkgsrc/pkgtools/pkg_install
*** Error code 1

Stop.
bmake: stopped in /usr/pkg/pkgsrc/pkgtools/pkg_install
===> exited with status 1
aborted.
# 

With this error present, pkgsrc cannot be bootstrapped on Tru64.
>How-To-Repeat:
cd /usr/pkg/pkgsrc/bootstrap
env CPP=/usr/bin/cpp CC=/usr/bin/cc ./bootstrap --compiler ccc

>Fix:
The constants INTMAX_MAX and INTMAX_MIN are apparently not defined on Tru64.  There should be some checking to determine if they are defined.

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->joerg
Responsible-Changed-By: hauke@NetBSD.org
Responsible-Changed-When: Fri, 25 Dec 2015 13:34:54 +0000
Responsible-Changed-Why:
Over to maintainer, with season's greetings!


From: Jeffrey Armstrong <jba@sdf.lonestar.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/50589
Date: Sun, 27 Dec 2015 21:10:59 +0000 (UTC)

 This bug has since been fixed upstream on libarchive's GitHub account with 
 pull request 628.  Original bug report is now closed:

 https://github.com/libarchive/libarchive/issues/627


From: coypu@SDF.ORG
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/50589: libarchive build fails during bootstrap on OSF/1
Date: Tue, 10 May 2016 16:28:51 +0000

 This was apparently fixed upstream, but I don't think the relevant
 changes occurred in pkgsrc too...

State-Changed-From-To: open->feedback
State-Changed-By: maya@NetBSD.org
State-Changed-When: Mon, 20 Jun 2016 22:16:30 +0000
State-Changed-Why:
libarchive updated, is your problem fixed?


From: Jeffrey Armstrong <jba@sdf.lonestar.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/50589 (libarchive build fails during bootstrap on OSF/1)
Date: Wed, 22 Jun 2016 16:43:32 +0000 (UTC)

 A new bug has been introduced.  The configure script is now properly 
 looking for INTMAX_MAX et al, but the script fails checking for 
 "sizeof(wchar_t)."  The config.log relevant portion is:

 configure:16384: checking size of wchar_t
 configure:16389: /usr/bin/cc -o conftest -g -Wall -Wformat 
 -Wformat-security   conftest.c  >&5
 ld:
 Invalid flag usage: Wall, -Wx,-option must appear after -_SYSTYPE_SVR4
 ld: Usage: ld [options] file [...]
 configure:16389: $? = 1
 configure: program exited with status 1
 configure: failed program was:
 ...

 So libarchive still appears to fail (in a new, exciting way) on OSF/1. 
 Prior to the updates, it would proceed through the configure script fine, 
 but fail during the actual build process.

 On Mon, 20 Jun 2016, maya@NetBSD.org wrote:

 > Date: Mon, 20 Jun 2016 22:16:30 +0000 (UTC)
 > From: maya@NetBSD.org
 > Reply-To: gnats-bugs@NetBSD.org
 > To: joerg@NetBSD.org, pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org,
 >     maya@NetBSD.org, jba@sdf.lonestar.org
 > Subject: Re: pkg/50589 (libarchive build fails during bootstrap on OSF/1)
 > 
 > Synopsis: libarchive build fails during bootstrap on OSF/1
 >
 > State-Changed-From-To: open->feedback
 > State-Changed-By: maya@NetBSD.org
 > State-Changed-When: Mon, 20 Jun 2016 22:16:30 +0000
 > State-Changed-Why:
 > libarchive updated, is your problem fixed?
 >
 >
 >
 >

 Jeff Armstrong - jba@sdf.lonestar.org
 SDF Public Access UNIX System - http://sdf.lonestar.org

From: Jeffrey Armstrong <jba@sdf.lonestar.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/50589 (libarchive build fails during bootstrap on OSF/1)
Date: Wed, 22 Jun 2016 17:13:30 +0000 (UTC)

 After trying to configure libarchive-3.2.1 directly from the project's 
 website, it seems the bug is present as well.  This bug is upstream, 
 apparently.

 This bug has been reported upstream as bug 728:

 https://github.com/libarchive/libarchive/issues/728

State-Changed-From-To: feedback->open
State-Changed-By: leot@NetBSD.org
State-Changed-When: Wed, 22 Jun 2016 21:20:06 +0000
State-Changed-Why:
Feedback provided


From: Joerg Sonnenberger <joerg@bec.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/50589 (libarchive build fails during bootstrap on OSF/1)
Date: Wed, 22 Jun 2016 23:33:52 +0200

 On Wed, Jun 22, 2016 at 09:20:06PM +0000, leot@NetBSD.org wrote:
 > Synopsis: libarchive build fails during bootstrap on OSF/1
 > 
 > State-Changed-From-To: feedback->open
 > State-Changed-By: leot@NetBSD.org
 > State-Changed-When: Wed, 22 Jun 2016 21:20:06 +0000
 > State-Changed-Why:
 > Feedback provided

 As I wrote in the upstream bug report, this looks like a insanely broken
 compiler. The test for wchar_t existance passes, but it doesn't have a
 size. Sounds like a good case of "don't use this".

 Joerg

From: Jeffrey Armstrong <jba@sdf.lonestar.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/50589 (libarchive build fails during bootstrap on OSF/1)
Date: Wed, 22 Jun 2016 23:06:36 +0000 (UTC)

 I've also updated the upstream bug report.  The following runs 
 delightfully well:

 #include <stdio.h>
 #include <wchar.h>

 int main(int argc, char *argv[])
 {

          printf("size is %d\n", sizeof(wchar_t));
          return 0;
 }

 and sizeof(wchar_t) works fine.

 As I suggested, something is wrong with the compiler flags if you check 
 the config.log file.  If it doesn't work, I guess it doesn't work, and 
 OSF/1 support can be dropped from pkgsrc.

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/50589 (libarchive build fails during bootstrap on OSF/1)
Date: Thu, 23 Jun 2016 16:36:58 +0000

 On Wed, Jun 22, 2016 at 09:35:01PM +0000, Joerg Sonnenberger wrote:
  >  As I wrote in the upstream bug report, this looks like a insanely broken
  >  compiler. The test for wchar_t existance passes, but it doesn't have a
  >  size. Sounds like a good case of "don't use this".

 Given the UB in the failing test program, I'm not sure it has a leg to
 stand on.

 -- 
 David A. Holland
 dholland@netbsd.org

From: Joerg Sonnenberger <joerg@bec.de>
To: gnats-bugs@NetBSD.org
Cc: joerg@NetBSD.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
	jba@sdf.lonestar.org
Subject: Re: pkg/50589 (libarchive build fails during bootstrap on OSF/1)
Date: Thu, 23 Jun 2016 19:31:07 +0200

 On Thu, Jun 23, 2016 at 04:40:00PM +0000, David Holland wrote:
 > The following reply was made to PR pkg/50589; it has been noted by GNATS.
 > 
 > From: David Holland <dholland-pbugs@netbsd.org>
 > To: gnats-bugs@NetBSD.org
 > Cc: 
 > Subject: Re: pkg/50589 (libarchive build fails during bootstrap on OSF/1)
 > Date: Thu, 23 Jun 2016 16:36:58 +0000
 > 
 >  On Wed, Jun 22, 2016 at 09:35:01PM +0000, Joerg Sonnenberger wrote:
 >   >  As I wrote in the upstream bug report, this looks like a insanely broken
 >   >  compiler. The test for wchar_t existance passes, but it doesn't have a
 >   >  size. Sounds like a good case of "don't use this".
 >  
 >  Given the UB in the failing test program, I'm not sure it has a leg to
 >  stand on.

 The real problem is that the compiler accepts -Wall...
 ...by passing it down to the linker.

 Joerg

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/50589 (libarchive build fails during bootstrap on OSF/1)
Date: Thu, 23 Jun 2016 17:33:11 +0000

 On Thu, Jun 23, 2016 at 07:31:07PM +0200, Joerg Sonnenberger wrote:
  > >  Given the UB in the failing test program, I'm not sure it has a leg to
  > >  stand on.
  > 
  > The real problem is that the compiler accepts -Wall...
  > ...by passing it down to the linker.

 Yes, well, that's stupid but dealing with such crap is what configure
 scripts are for.

 Meanwhile though if that's the problem it shouldn't happen in pkgsrc...

 -- 
 David A. Holland
 dholland@netbsd.org

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/50589 (libarchive build fails during bootstrap on OSF/1)
Date: Sat, 25 Jun 2016 17:16:40 +0000

 On Wed, Jun 22, 2016 at 11:10:01PM +0000, Jeffrey Armstrong wrote:
  >  I've also updated the upstream bug report.  The following runs 
  >  delightfully well:
  >  
  >  #include <stdio.h>
  >  #include <wchar.h>
  >  
  >  int main(int argc, char *argv[])
  >  {
  >  
  >           printf("size is %d\n", sizeof(wchar_t));
  >           return 0;
  >  }
  >  
  >  and sizeof(wchar_t) works fine.
  >  
  >  As I suggested, something is wrong with the compiler flags if you check 
  >  the config.log file.  If it doesn't work, I guess it doesn't work, and 
  >  OSF/1 support can be dropped from pkgsrc.

 It should be made to work, and it shouldn't be difficult to do so. If
 you have a chance, try the following hack:

 Index: files/configure
 ===================================================================
 RCS file: /cvsroot/pkgsrc/archivers/libarchive/files/configure,v
 retrieving revision 1.13
 diff -u -r1.13 configure
 --- files/configure	23 Jun 2016 13:39:03 -0000	1.13
 +++ files/configure	25 Jun 2016 17:13:55 -0000
 @@ -15593,7 +15593,7 @@
    return 0;
  }
  _ACEOF
 -if ac_fn_c_try_compile "$LINENO"; then :
 +if ac_fn_c_try_link "$LINENO"; then :
    eval "$as_CACHEVAR=yes"
  else
    eval "$as_CACHEVAR=no"


 -- 
 David A. Holland
 dholland@netbsd.org

From: Jeffrey Armstrong <jba@sdf.lonestar.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/50589 (libarchive build fails during bootstrap on OSF/1)
Date: Sun, 26 Jun 2016 15:51:32 +0000 (UTC)

 On Sat, 25 Jun 2016, David Holland wrote:

 > It should be made to work, and it shouldn't be difficult to do so. If
 > you have a chance, try the following hack:
 >
 > Index: files/configure
 > ===================================================================
 > RCS file: /cvsroot/pkgsrc/archivers/libarchive/files/configure,v
 > retrieving revision 1.13
 > diff -u -r1.13 configure
 > --- files/configure	23 Jun 2016 13:39:03 -0000	1.13
 > +++ files/configure	25 Jun 2016 17:13:55 -0000
 > @@ -15593,7 +15593,7 @@
 >    return 0;
 >  }
 >  _ACEOF
 > -if ac_fn_c_try_compile "$LINENO"; then :
 > +if ac_fn_c_try_link "$LINENO"; then :
 >    eval "$as_CACHEVAR=yes"
 >  else
 >    eval "$as_CACHEVAR=no"
 >

 The hack above does indeed work, which I expected.  The configure script 
 mostly finishes, but I am getting an error towards the end related to a 
 missing aclocal script:

 config.status: executing mkdirs commands
 CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/ksh 
 /usr/pkg/pkgsrc/bootstrap/work/libarchive/build/autoconf/missing 
 aclocal-1.15 -I build/autoconf
 /usr/pkg/pkgsrc/bootstrap/work/libarchive/build/autoconf/missing[81]: 
 aclocal-1.15:  not found
 WARNING: 'aclocal-1.15' is missing on your system.
           You should only need it if you modified 'acinclude.m4' or
           'configure.ac' or m4 files included by 'configure.ac'.
           The 'aclocal' program is part of the GNU Automake package:
           <http://www.gnu.org/software/automake>
           It also requires GNU Autoconf, GNU m4 and Perl in order to run:
           <http://www.gnu.org/software/autoconf>
           <http://www.gnu.org/software/m4/>
           <http://www.perl.org/>
 *** [./aclocal.m4] Error code 127

 bmake: stopped in /usr/pkg/pkgsrc/bootstrap/work/libarchive
 1 error

 bmake: stopped in /usr/pkg/pkgsrc/bootstrap/work/libarchive
 ===> exited with status 2
 aborted.

 Regardless, the patch does fix the problem surrounding the warning flags. 
 Upstream libarchive fixes have stalled a bit, I think, since there was an 
 autoconf bug in a fix that should actually work.

 Jeff Armstrong - jba@sdf.lonestar.org
 SDF Public Access UNIX System - http://sdf.lonestar.org

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/50589 (libarchive build fails during bootstrap on OSF/1)
Date: Sun, 26 Jun 2016 19:01:41 +0000

 On Sun, Jun 26, 2016 at 03:55:01PM +0000, Jeffrey Armstrong wrote:
  >  > It should be made to work, and it shouldn't be difficult to do so. If
  >  > you have a chance, try the following hack:
  >  > [snip]
  >  
  >  The hack above does indeed work, which I expected.

 That's good; now we just have to figure out how to fix it in
 configure.ac, because I'm sure otherwise Joerg will refuse to allow
 it.

  >  The configure script 
  >  mostly finishes, but I am getting an error towards the end related to a 
  >  missing aclocal script:
  >  [snip]

 That's... odd. Can you check the timestamps on the files involved?

 The do-extract rule that copies the source from files/ into the work
 directory doesn't preserve times, so I wonder if some of the results
 need to be strategically touched afterwards.

 (if so I'm not sure why it shouldn't trigger for other people, but
 maybe the speed of the platform's a factor...)

 -- 
 David A. Holland
 dholland@netbsd.org

From: Jeffrey Armstrong <jba@sdf.lonestar.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/50589 (libarchive build fails during bootstrap on OSF/1)
Date: Thu, 30 Jun 2016 11:19:47 +0000 (UTC)

 On Sun, 26 Jun 2016, David Holland wrote:

 > On Sun, Jun 26, 2016 at 03:55:01PM +0000, Jeffrey Armstrong wrote:
 >  >  The configure script
 >  >  mostly finishes, but I am getting an error towards the end related to a
 >  >  missing aclocal script:
 >  >  [snip]
 >
 > That's... odd. Can you check the timestamps on the files involved?

 Oops, that aclocal error was my fault.  A poorly timed CVS update and 
 copying a modified configure script caused some time stamp inconsistencies 
 due only to my own carelessness.  libarchive completes the configure 
 script.

 Jeff Armstrong - jba@sdf.lonestar.org
 SDF Public Access UNIX System - http://sdf.lonestar.org

>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.