NetBSD Problem Report #48695

From www@NetBSD.org  Tue Apr  1 03:52:18 2014
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 96F89A5803
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  1 Apr 2014 03:52:18 +0000 (UTC)
Message-Id: <20140401035115.80227A580F@mollari.NetBSD.org>
Date: Tue,  1 Apr 2014 03:51:15 +0000 (UTC)
From: jdbaker@mylinuxisp.com
Reply-To: jdbaker@mylinuxisp.com
To: gnats-bugs@NetBSD.org
Subject: cross/binutils-mips-current fails configuring in "opcodes" subdirectory
X-Send-Pr-Version: www-1.0

>Number:         48695
>Category:       pkg
>Synopsis:       cross/binutils-mips-current fails configuring in "opcodes" subdirectory
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    martin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 01 03:55:01 +0000 2014
>Closed-Date:    Fri Apr 04 07:09:00 +0000 2014
>Last-Modified:  Fri Apr 04 07:09:00 +0000 2014
>Originator:     John D. Baker
>Release:        NetBSD/i386-5.2_STABLE, pkgsrc-2014Q1 (plus cross/binutils/mips-current from pkgsrc-HEAD)
>Organization:
>Environment:
NetBSD verthandi.technoskunk.fur 5.2_STABLE NetBSD 5.2_STABLE (VERTHANDI) #13: Wed Dec 18 05:44:53 CST 2013  sysop@verthandi.technoskunk.fur:/d0/build/netbsd-5/obj/i386/sys/arch/i386/compile/VERTHANDI i386

>Description:
Building "cross/binutils-mips-current" (to support building
port-playstation2) fails while configuring in the "opcodes" subdirectory
as follows:

[...]
Configuring in ./opcodes
configure: creating cache ./config.cache
checking build system type... i386--netbsdelf
checking host system type... i386--netbsdelf
checking target system type... mips--netbsdelf
checking for i386--netbsdelf-gcc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking for library containing strerror... none required
./configure.lineno: 3236: Syntax error: Bad substitution
*** Error code 1

Stop.
make: stopped in /d0/build/pkgsrc/cross/binutils-mips-current/work/binutils-2.23.91
[...]


The failing line reported is:

[...]
       choke me
[...]

which is part of a here-document test program embedded in the fragment:

[...]
if test "${ac_cv_c_compiler_gnu+set}" = set; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{
#ifndef __GNUC__
       choke me
#endif

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "3243"; then :
  ac_compiler_gnu=yes
else
  ac_compiler_gnu=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu

fi
[...]
>How-To-Repeat:
Attempt to build "cross/binutils-mips-current" from pkgsrc-HEAD
(on netbsd-5/i386 if it matters).
>Fix:

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->martin
Responsible-Changed-By: obache@NetBSD.org
Responsible-Changed-When: Tue, 01 Apr 2014 08:53:03 +0000
Responsible-Changed-Why:
Over to maintainer.


From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/48695 (cross/binutils-mips-current fails configuring in "opcodes" subdirectory)
Date: Tue, 1 Apr 2014 11:13:16 +0200

 > Attempt to build "cross/binutils-mips-current" from pkgsrc-HEAD
 > (on netbsd-5/i386 if it matters).

 It does matter: I think it is a /bin/sh bug that has been fixed lately,
 maybe we should force configure to use /bin/ksh on older NetBSD?

 Martin

From: "OBATA Akio" <obata@lins.jp>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/48695 (cross/binutils-mips-current fails configuring in
 "opcodes" subdirectory)
Date: Tue, 01 Apr 2014 18:24:51 +0900

 On Tue, 01 Apr 2014 18:15:01 +0900, Martin Husemann <martin@duskware.de> wrote:

 >  It does matter: I think it is a /bin/sh bug that has been fixed lately,
 >  maybe we should force configure to use /bin/ksh on older NetBSD?

 as followings?

 Index: Makefile
 ===================================================================
 RCS file: /cvsroot/pkgsrc/cross/binutils-mips-current/Makefile,v
 retrieving revision 1.1
 diff -u -r1.1 Makefile
 --- Makefile    31 Mar 2014 09:46:57 -0000      1.1
 +++ Makefile    1 Apr 2014 09:23:07 -0000
 @@ -31,6 +31,11 @@

   BINDIR=                        ${PREFIX}/bin

 +.include "../../mk/bsd.prefs.mk"
 +.if !empty(MACHINE_PLATFORM:MNetBSD-[0-5].*-*)
 +CONFIG_SHELL=  /bin/ksh
 +.endif
 +
   # Prevent the need to run texi2pod.pl and pod2man hence
   # the need for perl as build dependency.
   post-patch:


 -- 
 OBATA Akio / obata@lins.jp

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/48695 (cross/binutils-mips-current fails configuring in "opcodes" subdirectory)
Date: Tue, 1 Apr 2014 13:16:51 +0200

 I just tested, it helps, but is also needed on netbsd-6.

 Is this the right way to test for it?

 .if !empty(MACHINE_PLATFORM:MNetBSD-[0-6].*-*)  \
     && empty(MACHINE_PLATFORM:MNetBSD-6.99-*)
 CONFIG_SHELL=  /bin/ksh
 .endif


 Martin

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/48695 (cross/binutils-mips-current fails configuring in
 "opcodes" subdirectory)
Date: Tue, 1 Apr 2014 08:44:36 -0500 (CDT)

 On Tue, 1 Apr 2014, Martin Husemann wrote:

 > I just tested, it helps, but is also needed on netbsd-6.

 I just checked that everything works as-is on -current (i386-6.99.38).

 I'll try your suggested change on my netbsd-5/i386 host soon.  (That
 machine also builds for netsbsd-6 via NFS-root, but is engaged building
 releases of -HEAD right now.  Will switch it to -6 when updates are
 finished.)

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: martin@NetBSD.org
Subject: Re: pkg/48695 (cross/binutils-mips-current fails configuring in
 "opcodes" subdirectory)
Date: Tue, 1 Apr 2014 10:07:40 -0500 (CDT)

 On Tue, 1 Apr 2014, Martin Husemann wrote:

 > Is this the right way to test for it?
 >
 > .if !empty(MACHINE_PLATFORM:MNetBSD-[0-6].*-*)  \
 >     && empty(MACHINE_PLATFORM:MNetBSD-6.99-*)
 > CONFIG_SHELL=  /bin/ksh
 > .endif

 I think you want "6.99.*-*" in the second match...

 Either as given, or with my suggested modification, I get the following
 on netbsd-5/i386:

 make: "/x/pkgsrc/cross/binutils-mips-current/Makefile" line 25: Malformed conditional (!empty(MACHINE_PLATFORM:MNetBSD-[0-6].*-*)        && empty(MACHINE_PLATFORM:MNetBSD-6.99.*-*))
 make: Fatal errors encountered -- cannot continue

 Even though shown as a single line, the line reference is to the second
 "empty()" test.

 Also, need:

    .include	"../../mk/bsd.prefs.mk"

 somewhere before the above test, then the conditionals work.

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/48695 (cross/binutils-mips-current fails configuring in "opcodes" subdirectory)
Date: Tue, 1 Apr 2014 17:17:49 +0200

 I am confused, but it seems overall we seem to agree that

 	CONFIG_SHELL=/bin/ksh

 for NetBSD-6 or older works. Obata-san, could you commit the proper
 conditional for that, please?

 Thanks,

 Martin

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: martin@NetBSD.org
Subject: Re: pkg/48695 (cross/binutils-mips-current fails configuring in
 "opcodes" subdirectory)
Date: Tue, 1 Apr 2014 17:08:24 -0500 (CDT)

 On Tue, 1 Apr 2014, Martin Husemann wrote:

 > I am confused, but it seems overall we seem to agree that
 >
 > 	CONFIG_SHELL=/bin/ksh
 >
 > for NetBSD-6 or older works. Obata-san, could you commit the proper
 > conditional for that, please?

 Here's what I eventually did to make it work for me:

 +Index: cross/binutils-mips-current/Makefile
 +===================================================================
 +RCS file: /cvsroot/pkgsrc/cross/binutils-mips-current/Makefile,v
 +retrieving revision 1.1
 +diff -u -p -r1.1 Makefile
 +--- cross/binutils-mips-current/Makefile	31 Mar 2014 09:46:57 -0000	1.1
 ++++ cross/binutils-mips-current/Makefile	1 Apr 2014 22:05:44 -0000
 +@@ -16,11 +16,17 @@ HOMEPAGE=		http://www.gnu.org/
 + COMMENT=		binutils for NetBSD/playstation2
 + LICENSE=		gnu-gpl-v3 AND gnu-lgpl-v3
 + 
 ++.include	"../../mk/bsd.prefs.mk"
 + BUILDLINK_TRANSFORM+=	rm:-Werror
 + 
 + USE_TOOLS+=		gm4 pod2man yacc
 + USE_LIBTOOL=		yes
 + 
 ++.if !empty(MACHINE_PLATFORM:MNetBSD-[0-6].*-*)	\
 ++    && empty(MACHINE_PLATFORM:MNetBSD-6.99.*-*)
 ++CONFIG_SHELL=	/bin/ksh
 ++.endif
 ++
 + GNU_CONFIGURE=		yes
 + CONFIGURE_ARGS+=	--enable-64-bit-bfd
 + CONFIGURE_ARGS+=	--target=mips--netbsdelf

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/48695 CVS commit: pkgsrc/cross/binutils-mips-current
Date: Wed, 2 Apr 2014 12:49:25 +0000

 Module Name:	pkgsrc
 Committed By:	obache
 Date:		Wed Apr  2 12:49:25 UTC 2014

 Added Files:
 	pkgsrc/cross/binutils-mips-current: hacks.mk

 Log Message:
 Add an hack to avoid /bin/sh bug in NetBSD-6 release or prior.
 PR pkg/48695.


 To generate a diff of this commit:
 cvs rdiff -u -r0 -r1.1 pkgsrc/cross/binutils-mips-current/hacks.mk

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

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/48695 (cross/binutils-mips-current fails configuring in
 "opcodes" subdirectory)
Date: Wed, 2 Apr 2014 09:14:18 -0500 (CDT)

 The recently-committed changes make it work for me on netbsd-5/i386.
 Will confirm on netbsd-6 and -current as opportunity arises.

 Thanks.

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Fri, 04 Apr 2014 07:09:00 +0000
State-Changed-Why:
fixed, thanks


>Unformatted:

NetBSD Home
NetBSD PR Database Search

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