NetBSD Problem Report #53521

From www@NetBSD.org  Mon Aug 13 18:48:41 2018
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 "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 281C57A158
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 13 Aug 2018 18:48:41 +0000 (UTC)
Message-Id: <20180813184826.8E1347A1FE@mollari.NetBSD.org>
Date: Mon, 13 Aug 2018 18:48:26 +0000 (UTC)
From: nullnilaki@gmail.com
Reply-To: nullnilaki@gmail.com
To: gnats-bugs@NetBSD.org
Subject: Failed to build disable DDB kernel on sgimips.
X-Send-Pr-Version: www-1.0

>Number:         53521
>Category:       port-sgimips
>Synopsis:       Failed to build disable DDB kernel on sgimips.
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    tsutsui
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 13 18:50:00 +0000 2018
>Closed-Date:    Fri Sep 14 19:43:12 +0000 2018
>Last-Modified:  Fri Sep 14 19:43:12 +0000 2018
>Originator:     Naruaki Etomi
>Release:        NetBSD/sgimips 8.99.21
>Organization:
Japan
>Environment:
NetBSD  8.99.21 NetBSD 8.99.21 (GENERIC32_IP12) #1: Sun Aug 12 14:48:19 UTC 2018  naruaki@xserve:/usr/obj.sgimips/sys/arch/sgimips/compile/GENERIC32_IP2x sgimips

>Description:
1.Disable DDB

-options 	DDB		# in-kernel debugger
-options 	DDB_HISTORY_SIZE=512	# enable history editing in DDB
+#options 	DDB		# in-kernel debugger
+#options 	DDB_HISTORY_SIZE=512	# enable history editing in DDB

2.kernel build

/usr/src/sys/arch/sgimips/sgimips/machdep.c: In function 'mach_init':
/usr/src/sys/arch/sgimips/sgimips/machdep.c:251:24: error: unused variable 'bi_syms' [-Werror=unused-variable]
  struct btinfo_symtab *bi_syms;
                        ^~~~~~~
-

nbmake: stopped in /usr/obj.sgimips/sys/arch/sgimips/compile/GENERIC32_IP12

ERROR: Failed to make all in "/usr/src/../obj.sgimips/sys/arch/sgimips/compile/GENERIC32_IP12"
*** BUILD ABORTED ***

>How-To-Repeat:

>Fix:
--- src.orig/sys/arch/sgimips/sgimips/machdep.c	2017-11-07 03:01:06.000000000 +0000
+++ src/sys/arch/sgimips/sgimips/machdep.c	2018-08-13 17:04:22.232247994 +0000
@@ -248,7 +248,6 @@
 	int nsym = 0;
 	char *ssym = NULL;
 	char *esym = NULL;
-	struct btinfo_symtab *bi_syms;
 #endif
 #ifdef _LP64
 	char *argv[20];
@@ -308,6 +307,7 @@
 		bootinfo_msg = "no bootinfo found. (old bootblocks?)\n";

 #if NKSYM > 0 || defined(DDB) || defined(MODULAR)
+	struct btinfo_symtab *bi_syms;
 	bi_syms = lookup_bootinfo(BTINFO_SYMTAB);

 	/* check whether there is valid bootinfo symtab info */

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: port-sgimips-maintainer->tsutsui
Responsible-Changed-By: tsutsui@NetBSD.org
Responsible-Changed-When: Sun, 02 Sep 2018 09:36:21 +0000
Responsible-Changed-Why:
I'll handle this.


State-Changed-From-To: open->analyzed
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Sun, 02 Sep 2018 09:36:21 +0000
State-Changed-Why:
Also happens with IP2x and IP3x kernels.
It looks typo and inconsistency around NKSYMS:
% grep NKSYM ../../sgimips/machdep.c 
#if NKSYMS || defined(DDB) || defined(MODULAR) || defined(KGDB)
#if NKSYMS > 0 || defined(DDB) || defined(MODULAR)
#if NKSYM > 0 || defined(DDB) || defined(MODULAR)
#if NKSYMS || defined(DDB) || defined(MODULAR)
#endif /* NKSYMS || defined(DDB) || defined(MODULAR) */

At least NKSYM should be NKSYMS.


From: "Izumi Tsutsui" <tsutsui@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53521 CVS commit: src/sys/arch/sgimips/sgimips
Date: Sun, 2 Sep 2018 09:57:33 +0000

 Module Name:	src
 Committed By:	tsutsui
 Date:		Sun Sep  2 09:57:33 UTC 2018

 Modified Files:
 	src/sys/arch/sgimips/sgimips: machdep.c

 Log Message:
 Fix build failure without options DDB and with pseudo-device ksyms.

 There is a typo for ksyms (NKSYMS vs NKSYM).
 Also use consistent "#if NKSYMS" rather than "#if NKSYMS > 0" etc.
 and add comments after corresponding #endif for readability.

 Fixes PR port-sgimips/53521 from Naruaki Etomi.
 Should be pulled up to (at least) netbsd-8.


 To generate a diff of this commit:
 cvs rdiff -u -r1.145 -r1.146 src/sys/arch/sgimips/sgimips/machdep.c

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

State-Changed-From-To: analyzed->needs-pullups
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Sun, 02 Sep 2018 10:11:45 +0000
State-Changed-Why:


State-Changed-From-To: needs-pullups->pending-pullups
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Sun, 09 Sep 2018 04:51:47 +0000
State-Changed-Why:
[pullup-8 #1017]


State-Changed-From-To: pending-pullups->closed
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Fri, 14 Sep 2018 19:43:12 +0000
State-Changed-Why:
Pulled up.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.