NetBSD Problem Report #38674
From martin@duskware.de Fri May 16 20:21:33 2008
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by narn.NetBSD.org (Postfix) with ESMTP id 0033F63B9EE
for <gnats-bugs@gnats.netbsd.org>; Fri, 16 May 2008 20:21:32 +0000 (UTC)
Message-Id: <20080516190755.8917663B8BC@narn.NetBSD.org>
Date: Fri, 16 May 2008 19:07:55 +0000 (UTC)
From: tnn@NetBSD.org
Reply-To: tnn@NetBSD.org
To: netbsd-bugs-owner@NetBSD.org
Subject: libarchive broken on IRIX
X-Send-Pr-Version: www-1.0
>Number: 38674
>Category: pkg
>Synopsis: libarchive broken on IRIX
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: joerg
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri May 16 20:25:00 +0000 2008
>Closed-Date: Tue Sep 16 13:37:31 +0000 2008
>Last-Modified: Tue Sep 16 13:37:31 +0000 2008
>Originator: Tobias Nygren
>Release: n/a
>Organization:
>Environment:
IRIX irixbulk 6.5 07202013 IP32
>Description:
Build of pkg_install fails with:
libarchive/archive_string.c:261: error: wcrtomb undeclared (first use in this function)
The problem is that even though wchar.h exists, there is no prototype for wcrtomb() in the preprocessed output. It does exist in libc, though.
wchar.h contains this rather cryptic statement:
--8<--8<--8<--
#if (_MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64)
__SGI_LIBC_USING_FROM_STD(mbrlen)
__SGI_LIBC_USING_FROM_STD(mbrtowc)
__SGI_LIBC_USING_FROM_STD(wcrtomb)
#endif
--8<--8<--8<--
>How-To-Repeat:
build pkg_install on IRIX using gcc.
>Fix:
Following patch makes pkg_install build.
Index: archive_string.c
===================================================================
RCS file: /cvsroot/pkgsrc/archivers/libarchive/files/libarchive/archive_string.c,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 archive_string.c
--- archive_string.c 25 Apr 2008 15:07:25 -0000 1.1.1.3
+++ archive_string.c 16 May 2008 18:10:48 -0000
@@ -39,6 +39,10 @@
#endif
#ifdef HAVE_WCHAR_H
#include <wchar.h>
+#if defined(__sgi)
+/* Not in wchar.h? prototype taken from mbrchar(3S) */
+size_t wcrtomb(char *s, wchar_t wchar, mbstate_t *ps);
+#endif
#endif
#include "archive_private.h"
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: pkg-manager->joerg
Responsible-Changed-By: reed@NetBSD.org
Responsible-Changed-When: Tue, 20 May 2008 01:27:44 +0000
Responsible-Changed-Why:
Assign to maintainer.
From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: pkg/38674: libarchive broken on IRIX
Date: Sun, 25 May 2008 21:51:05 +0200
On Fri, May 16, 2008 at 08:25:01PM +0000, tnn@NetBSD.org wrote:
> >Fix:
> Following patch makes pkg_install build.
The fix should be merged via the update to 2.5.4b. Can you check if it
works now?
Joerg
From: Tobias Nygren <tnn@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: Joerg Sonnenberger <joerg@britannica.bec.de>
Subject: Re: pkg/38674: libarchive broken on IRIX
Date: Sun, 25 May 2008 22:56:07 +0200
On Sun, 25 May 2008 19:55:03 +0000 (UTC)
Joerg Sonnenberger <joerg@britannica.bec.de> wrote:
> The following reply was made to PR pkg/38674; it has been noted by GNATS.
>
> From: Joerg Sonnenberger <joerg@britannica.bec.de>
> To: gnats-bugs@NetBSD.org
> Cc:
> Subject: Re: pkg/38674: libarchive broken on IRIX
> Date: Sun, 25 May 2008 21:51:05 +0200
>
> On Fri, May 16, 2008 at 08:25:01PM +0000, tnn@NetBSD.org wrote:
> > >Fix:
> > Following patch makes pkg_install build.
>
> The fix should be merged via the update to 2.5.4b. Can you check if it
> works now?
>
> Joerg
>
That issue is fixed, but now there is a new problem.
gcc -DHAVE_CONFIG_H -I. -I/tmp/pkgsrc-obj/archivers/libarchive/work.irixbulk/.buildlink/include -O2 -MT libarchive/archive_read_support_compression_program.lo -MD -MP -MF libarchive/.deps/archive_read_support_compression_program.Tpo -c libarchive/archive_read_support_compression_program.c -DPIC -o libarchive/.libs/archive_read_support_compression_program.o
libarchive/archive_read_support_compression_program.c:38: warning: 'struct archive' declared inside parameter list
libarchive/archive_read_support_compression_program.c:38: warning: its scope is only this definition or declaration, which is probably not what you want
libarchive/archive_read_support_compression_program.c: In function 'archive_read_support_compression_program':
libarchive/archive_read_support_compression_program.c:42: error: 'ARCHIVE_FATAL' undeclared (first use in this function)
libarchive/archive_read_support_compression_program.c:42: error: (Each undeclared identifier is reported only once
libarchive/archive_read_support_compression_program.c:42: error: for each function it appears in.)
The problem might be the HAVE_VFORK ifdef (IRIX only has fork).
AC_FUNC_VFORK can be used to provide that.
Anyway, the local #includes need to be moved higher for that fallback
code segment to work.
From: "Stuart Shelton" <srcshelton@gmail.com>
To: gnats-bugs@netbsd.org
Cc: joerg@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
tnn@NetBSD.org
Subject: Re: pkg/38674 (libarchive broken on IRIX)
Date: Tue, 3 Jun 2008 15:12:17 +0100
> The problem might be the HAVE_VFORK ifdef (IRIX only has fork).
> AC_FUNC_VFORK can be used to provide that.
> Anyway, the local #includes need to be moved higher for that fallback
> code segment to work.
Actually, the manpage for fork() says:
"
NAME
fork, vfork - create a new process
C SYNOPSIS
#include <sys/types.h>
#include <unistd.h>
pid_t fork (void);
#if _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED==1
pid_t vfork (void);
#endif
Only when in the X/Open XPG4 Extended Unix name space are vfork and fork
exactly the same in this system and any reference to fork in this
document also applies to vfork. It should also be noted that this vfork
is NOT and DOES NOT have the same semantics as the original BSD vfork.
"
So it appears that *a* vfork() is available (with the correct symbols
defined), but that it may not work as intended...
All this seems to affect is whether external compression programs can
be used - will this have any effect on the use of pkg_install?
From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: pkg/38674: libarchive broken on IRIX
Date: Tue, 3 Jun 2008 17:02:18 +0200
--huq684BweRXVnRxX
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On Sun, May 25, 2008 at 09:00:08PM +0000, Tobias Nygren wrote:
> That issue is fixed, but now there is a new problem.
Attached is the version of the upstream patch for testing.
Joerg
--huq684BweRXVnRxX
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="libarchive-fork.diff"
Index: files/config.h.in
===================================================================
RCS file: /data/repo/netbsd/pkgsrc/archivers/libarchive/files/config.h.in,v
retrieving revision 1.1.1.7
diff -u -p -r1.1.1.7 config.h.in
--- files/config.h.in 25 May 2008 19:41:21 -0000 1.1.1.7
+++ files/config.h.in 3 Jun 2008 14:32:32 -0000
@@ -126,6 +126,9 @@
/* Define to 1 if fnmatch(3) supports the FNM_LEADING_DIR flag */
#undef HAVE_FNM_LEADING_DIR
+/* Define to 1 if you have the `fork' function. */
+#undef HAVE_FORK
+
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
#undef HAVE_FSEEKO
Index: files/configure
===================================================================
RCS file: /data/repo/netbsd/pkgsrc/archivers/libarchive/files/configure,v
retrieving revision 1.1.1.9
diff -u -p -r1.1.1.9 configure
--- files/configure 25 May 2008 19:41:23 -0000 1.1.1.9
+++ files/configure 3 Jun 2008 14:33:14 -0000
@@ -24855,7 +24855,7 @@ done
-for ac_func in chflags chown fchdir fchflags fchmod fchown fcntl fstat
+for ac_func in chflags chown fchdir fchflags fchmod fchown fcntl fork
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -24953,7 +24953,7 @@ done
-for ac_func in ftruncate futimes geteuid getopt_long getpid
+for ac_func in fstat ftruncate futimes geteuid getopt_long getpid
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
Index: files/configure.ac
===================================================================
RCS file: /data/repo/netbsd/pkgsrc/archivers/libarchive/files/configure.ac,v
retrieving revision 1.1.1.8
diff -u -p -r1.1.1.8 configure.ac
--- files/configure.ac 25 May 2008 19:41:18 -0000 1.1.1.8
+++ files/configure.ac 3 Jun 2008 14:32:39 -0000
@@ -239,8 +239,8 @@ AC_FUNC_STAT
AC_FUNC_STRERROR_R
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([chflags chown fchdir fchflags fchmod fchown fcntl fstat])
-AC_CHECK_FUNCS([ftruncate futimes geteuid getopt_long getpid])
+AC_CHECK_FUNCS([chflags chown fchdir fchflags fchmod fchown fcntl fork])
+AC_CHECK_FUNCS([fstat ftruncate futimes geteuid getopt_long getpid])
AC_CHECK_FUNCS([lchflags lchmod lchown])
AC_CHECK_FUNCS([lutimes memmove memset mkdir mkfifo mknod])
AC_CHECK_FUNCS([nl_langinfo pipe poll select setenv setlocale])
Index: files/libarchive/archive_read_support_compression_program.c
===================================================================
RCS file: /data/repo/netbsd/pkgsrc/archivers/libarchive/files/libarchive/archive_read_support_compression_program.c,v
retrieving revision 1.1.1.3
diff -u -p -r1.1.1.3 archive_read_support_compression_program.c
--- files/libarchive/archive_read_support_compression_program.c 25 May 2008 19:41:25 -0000 1.1.1.3
+++ files/libarchive/archive_read_support_compression_program.c 3 Jun 2008 14:33:44 -0000
@@ -28,7 +28,8 @@ __FBSDID("$FreeBSD: src/lib/libarchive/a
/* This capability is only available on POSIX systems. */
-#if !defined(HAVE_PIPE) || !defined(HAVE_VFORK) || !defined(HAVE_FCNTL)
+#if !defined(HAVE_PIPE) || !defined(HAVE_FCNTL) || \
+ !(defined(HAVE_FORK) || defined(HAVE_VFORK))
/*
* On non-Posix systems, allow the program to build, but choke if
Index: files/libarchive/archive_write_set_compression_program.c
===================================================================
RCS file: /data/repo/netbsd/pkgsrc/archivers/libarchive/files/libarchive/archive_write_set_compression_program.c,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 archive_write_set_compression_program.c
--- files/libarchive/archive_write_set_compression_program.c 25 May 2008 19:41:26 -0000 1.1.1.2
+++ files/libarchive/archive_write_set_compression_program.c 3 Jun 2008 14:33:46 -0000
@@ -28,7 +28,9 @@
__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_compression_program.c,v 1.1 2007/05/29 01:00:19 kientzle Exp $");
/* This capability is only available on POSIX systems. */
-#if !defined(HAVE_PIPE) || !defined(HAVE_VFORK) || !defined(HAVE_FCNTL)
+#if !defined(HAVE_PIPE) || !defined(HAVE_FCNTL) || \
+ !(defined(HAVE_FORK) || defined(HAVE_VFORK))
+#include "archive.h"
/*
* On non-Posix systems, allow the program to build, but choke if
Index: files/libarchive/filter_fork.c
===================================================================
RCS file: /data/repo/netbsd/pkgsrc/archivers/libarchive/files/libarchive/filter_fork.c,v
retrieving revision 1.1.1.4
diff -u -p -r1.1.1.4 filter_fork.c
--- files/libarchive/filter_fork.c 25 May 2008 19:41:26 -0000 1.1.1.4
+++ files/libarchive/filter_fork.c 3 Jun 2008 14:33:40 -0000
@@ -26,7 +26,8 @@
#include "archive_platform.h"
/* This capability is only available on POSIX systems. */
-#if defined(HAVE_PIPE) && defined(HAVE_VFORK) && defined(HAVE_FCNTL)
+#if defined(HAVE_PIPE) && defined(HAVE_FCNTL) && \
+ (defined(HAVE_FORK) || defined(HAVE_VFORK))
__FBSDID("$FreeBSD: src/lib/libarchive/filter_fork.c,v 1.2 2007/12/30 04:58:22 kientzle Exp $");
@@ -75,7 +76,11 @@ __archive_create_child(const char *path,
stdout_pipe[1] = tmp;
}
+#if HAVE_VFORK
switch ((child = vfork())) {
+#else
+ switch ((child = fork())) {
+#endif
case -1:
goto stdout_opened;
case 0:
--huq684BweRXVnRxX--
State-Changed-From-To: open->feedback
State-Changed-By: joerg@NetBSD.org
State-Changed-When: Wed, 11 Jun 2008 20:07:58 +0000
State-Changed-Why:
I sent a patch.
State-Changed-From-To: feedback->open
State-Changed-By: tnn@NetBSD.org
State-Changed-When: Sun, 15 Jun 2008 14:44:34 +0000
State-Changed-Why:
Proposed patch works, thanks.
From: Joerg Sonnenberger <joerg@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/38674 CVS commit: pkgsrc
Date: Sun, 13 Jul 2008 14:25:05 +0000 (UTC)
Module Name: pkgsrc
Committed By: joerg
Date: Sun Jul 13 14:25:05 UTC 2008
Modified Files:
pkgsrc/archivers/bsdtar: Makefile
pkgsrc/archivers/libarchive: Makefile
pkgsrc/pkgtools/pkg_install: Makefile
Added Files:
pkgsrc/archivers/libarchive: hacks.mk
Log Message:
Add a temporary workaround for missing vfork on IRIX.
Fixes PR 38674, tested by tnn@.
To generate a diff of this commit:
cvs rdiff -r1.8 -r1.9 pkgsrc/archivers/bsdtar/Makefile
cvs rdiff -r1.26 -r1.27 pkgsrc/archivers/libarchive/Makefile
cvs rdiff -r0 -r1.1 pkgsrc/archivers/libarchive/hacks.mk
cvs rdiff -r1.156 -r1.157 pkgsrc/pkgtools/pkg_install/Makefile
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->closed
State-Changed-By: joerg@NetBSD.org
State-Changed-When: Tue, 16 Sep 2008 13:37:31 +0000
State-Changed-Why:
A fix was commited a while ago.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.