NetBSD Problem Report #49014

From www@NetBSD.org  Fri Jul 18 14:52:22 2014
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" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 9825DA5672
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 18 Jul 2014 14:52:22 +0000 (UTC)
Message-Id: <20140718145221.3178CA6553@mollari.NetBSD.org>
Date: Fri, 18 Jul 2014 14:52:21 +0000 (UTC)
From: jdbaker@mylinuxisp.com
Reply-To: jdbaker@mylinuxisp.com
To: gnats-bugs@NetBSD.org
Subject: chat/ircservices needs "-fno-stack-protector" on NetBSD/sparc-6.99.43
X-Send-Pr-Version: www-1.0

>Number:         49014
>Category:       pkg
>Synopsis:       chat/ircservices needs "-fno-stack-protector" on NetBSD/sparc-6.99.43
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 18 14:55:00 +0000 2014
>Last-Modified:  Sat Jul 19 06:35:01 +0000 2014
>Originator:     John D. Baker
>Release:        NetBSD/sparc-6.99.43, pkgsrc-2014Q2
>Organization:
>Environment:
NetBSD jean.technoskunk.fur 6.99.43 NetBSD 6.99.43 (JEAN) #9: Tue May 27 14:56:45 CDT 2014  sysop@verthandi.technoskunk.fur:/d0/build/current/obj/sparc/sys/arch/sparc/compile/JEAN sparc

>Description:
"chat/ircservices" fails during configure phase as follows:

===> Configuring for ircservices-5.0.64nb3

Beginning IRC Services configuration.

Executable (program) file will be installed in /usr/pkg/sbin
Data files will be installed in /usr/pkg/lib/services
Checking sanity of /bin/sh... high.
Searching for a suitable compiler... (supplied) using gcc.
Compiler flags supplied: -O2

*** WHOA THERE! ***

Your compiler is not compiling certain code correctly; this will result in
crashes when running Services.  If you have specified compiler flags, please
add "-fno-stack-protector" to the flags, or remove "-fstack-protector" if it
is present.  If this does not help, please reinstall or upgrade your
compiler.  See section 2-1 of the manual for details.

Configuration aborted.

*** Error code 1

Stop.
make[1]: stopped in /x/pkgsrc/chat/ircservices
*** Error code 1

Stop.
make: stopped in /x/pkgsrc/chat/ircservices


As the error message suggests, adding "-fno-stack-protector" to
CFLAGS allows the package to configure, build, and install.
>How-To-Repeat:
Attempt to build "chat/ircservices" on NetBSD/sparc-current (6.99.43
as of this date).  (Other ports/versions?)

Add something like:

  .if "${PKGPATH}" == "chat/ircservices"
    CFLAGS+=-fno-stack-protector
  .endif

to "/etc/mk.conf" and build again.
>Fix:
Something like:

Index: chat/ircservices/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/chat/ircservices/Makefile,v
retrieving revision 1.45
diff -u -p -r1.45 Makefile
--- chat/ircservices/Makefile   29 May 2014 23:35:18 -0000      1.45
+++ chat/ircservices/Makefile   18 Jul 2014 14:50:20 -0000
@@ -25,6 +25,10 @@ RCD_SCRIPTS= ircservices
 PKG_GROUPS=    services
 BUILD_DEFS=    VARBASE

+.if !empty(MACHINE_PLATFORM:MNetBSD-6.99.[4-9]?-sparc)
+  CFLAGS+=-fno-stack-protector
+.endif
+
 CONFIGURE_ARGS+=       -prefix ${PREFIX:Q}
 CONFIGURE_ARGS+=       -cc ${CC:Q}
 CONFIGURE_ARGS+=       ${empty(CFLAGS):?:-cflags ${CFLAGS:Q}}


Don't know if this affects HEAD prior to GCC48 switch or non-sparc
platforms (yet), so this is just a rough draft...

>Audit-Trail:
From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/49014: chat/ircservices needs "-fno-stack-protector" on
 NetBSD/sparc-6.99.43
Date: Fri, 18 Jul 2014 16:27:39 -0500 (CDT)

 Building on NetBSD/sparc-6.1_STABLE fails the same way, so the same
 fix applies.  As such, the fix (for now) looks like:

 +Index: chat/ircservices/Makefile
 +===================================================================
 +RCS file: /cvsroot/pkgsrc/chat/ircservices/Makefile,v
 +retrieving revision 1.45
 +diff -u -p -r1.45 Makefile
 +--- chat/ircservices/Makefile	29 May 2014 23:35:18 -0000	1.45
 ++++ chat/ircservices/Makefile	18 Jul 2014 21:24:03 -0000
 +@@ -25,6 +25,10 @@ RCD_SCRIPTS=	ircservices
 + PKG_GROUPS=	services
 + BUILD_DEFS=	VARBASE
 + 
 ++.if !empty(MACHINE_PLATFORM:MNetBSD-6.*-sparc)
 ++  CFLAGS+=-fno-stack-protector
 ++.endif
 ++
 + CONFIGURE_ARGS+=	-prefix ${PREFIX:Q}
 + CONFIGURE_ARGS+=	-cc ${CC:Q}
 + CONFIGURE_ARGS+=	${empty(CFLAGS):?:-cflags ${CFLAGS:Q}}

 Nothing extra is needed on netbsd-5/i386.  Will check netbsd-6/i386 and
 -current/i386 soon-ish.

 -- 
 |/"\ 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: 
Subject: Re: pkg/49014: chat/ircservices needs "-fno-stack-protector" on
 NetBSD/sparc-6.99.43
Date: Sat, 19 Jul 2014 01:32:30 -0500 (CDT)

 Building on netbsd-6/i386 requires no extra compiler directives.  Will
 try i386-6.99.47 soon-ish.

 -- 
 |/"\ 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

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-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.