NetBSD Problem Report #40513

From www@NetBSD.org  Thu Jan 29 13:06:50 2009
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 3312663C04A
	for <gnats-bugs@gnats.netbsd.org>; Thu, 29 Jan 2009 13:06:50 +0000 (UTC)
Message-Id: <20090129130649.C78A963C040@narn.NetBSD.org>
Date: Thu, 29 Jan 2009 13:06:49 +0000 (UTC)
From: kanaoka@ann.hi-ho.ne.jp
Reply-To: kanaoka@ann.hi-ho.ne.jp
To: gnats-bugs@NetBSD.org
Subject: kernel does not compile with LKM
X-Send-Pr-Version: www-1.0

>Number:         40513
>Category:       kern
>Synopsis:       kernel does not compile with LKM
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 29 13:10:00 +0000 2009
>Closed-Date:    Mon Feb 02 16:04:09 +0000 2009
>Last-Modified:  Mon Feb 02 16:04:09 +0000 2009
>Originator:     Masanori Kanaoka
>Release:        NetBSD 5.99.7 i386
>Organization:
none
>Environment:
NetBSD lab.k.vnop.net 5.99.7 NetBSD 5.99.7 (LAB) #0: Tue Jan 20 22:28:57 JST 2009  root@lab.k.vnop.net:/usr/obj/sys/arch/i386/compile/LAB i386

>Description:
kernel does not compile with old config(include options LKM).

#   compile  LAB/if_lmc.o
/usr/src/tooldir.NetBSD-5.99.7-i386/bin/i386--netbsdelf-gcc -ffreestanding -fno-zero-initialized-in-bss -O2 -std=gnu99 -fno-strict-aliasing -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wno-unreachable-code -Wno-sign-compare -Wno-pointer-sign -Wno-attributes -Wextra -Wno-unused-parameter -Werror -march=i486 -mtune=pentiumpro -Di386 -I. -I/usr/src/sys/../common/include -I/usr/src/sys/arch -I/usr/src/sys -nostdinc -DLKM -DMODULAR -DMAXUSERS=64 -D_KERNEL -D_KERNEL_OPT -I/usr/src/sys/lib/libkern/../../../common/lib/libc/quad -I/usr/src/sys/lib/libkern/../../../common/lib/libc/string -I/usr/src/sys/lib/libkern/../../../common/lib/libc/arch/i386/string -I/usr/src/sys/external/isc/atheros_hal/dist -I/usr/src/sys/external/isc/atheros_hal/ic -I/usr/src/sys/dist/ipf -c /usr/src/sys/dev/pci/if_lmc.c
/usr/src/sys/dev/pci/if_lmc.c:7221: error: expected declaration specifiers or '...' before string constant
/usr/src/sys/dev/pci/if_lmc.c:7221: error: expected declaration specifiers or '...' before 'cfdrivers'
/usr/src/sys/dev/pci/if_lmc.c:7221: error: expected declaration specifiers or '...' before 'cfattachs'
/usr/src/sys/dev/pci/if_lmc.c:7221: error: expected declaration specifiers or '...' before 'cfdatas'
cc1: warnings being treated as errors
/usr/src/sys/dev/pci/if_lmc.c:7221: warning: data definition has no type or storage class
/usr/src/sys/dev/pci/if_lmc.c:7221: warning: type defaults to 'int' in declaration of 'MOD_DRV'
/usr/src/sys/dev/pci/if_lmc.c:7221: warning: function declaration isn't a prototype
/usr/src/sys/dev/pci/if_lmc.c:7223: warning: 'struct lkm_table' declared inside parameter list
/usr/src/sys/dev/pci/if_lmc.c:7223: warning: its scope is only this definition or declaration, which is probably not what you want
/usr/src/sys/dev/pci/if_lmc.c:7224: warning: no previous prototype for 'if_lmc_lkmentry'
/usr/src/sys/dev/pci/if_lmc.c: In function 'if_lmc_lkmentry':
/usr/src/sys/dev/pci/if_lmc.c:7224: warning: implicit declaration of function 'LKM_DISPATCH'
/usr/src/sys/dev/pci/if_lmc.c:7224: error: 'lkm_nofunc' undeclared (first use in this function)
/usr/src/sys/dev/pci/if_lmc.c:7224: error: (Each undeclared identifier is reported only once
/usr/src/sys/dev/pci/if_lmc.c:7224: error: for each function it appears in.)
*** [if_lmc.o] Error code 1

>How-To-Repeat:
# cd /usr/src
# ./build.sh tools
# ./build.sh kernel=MYCONFIG(include option LKM)
>Fix:
1. remove "option LKM" form config file.

or

2. a little patch fot sys/dev/pci/if_lmc.c

Index: sys/dev/pci/if_lmc.c
===================================================================
RCS file: /ftp/cvs/src/sys/dev/pci/if_lmc.c,v
retrieving revision 1.45
diff -u -r1.45 if_lmc.c
--- sys/dev/pci/if_lmc.c        12 Nov 2008 12:36:12 -0000      1.45
+++ sys/dev/pci/if_lmc.c        29 Jan 2009 12:54:35 -0000
@@ -7202,7 +7202,7 @@
 CFATTACH_DECL(lmc, sizeof(softc_t),            /* lmc_ca */
  nbsd_match, nbsd_attach, nbsd_detach, NULL);

-# if defined(LKM)
+# if defined(_MODULE)

 static struct cfattach *cfattach[] = { &lmc_ca, NULL };
 static const struct cfattachlkminit cfattachs[] =
@@ -7223,7 +7223,7 @@
 int if_lmc_lkmentry(struct lkm_table *lkmtp, int cmd, int ver)
   { LKM_DISPATCH(lkmtp, cmd, ver, lkm_nofunc, lkm_nofunc, lkm_nofunc); }

-# endif /* LKM */
+# endif /* _MODULE */

 #endif  /* __NetBSD__ */

>Release-Note:

>Audit-Trail:
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@NetBSD.org, gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org,
        tsutsui@ceres.dti.ne.jp
Subject: Re: kern/40513: kernel does not compile with LKM
Date: Thu, 29 Jan 2009 22:14:44 +0900

 > 1. remove "option LKM" form config file.

 It was removed from GENERIC long ago, so you should also remove it.

 > 2. a little patch fot sys/dev/pci/if_lmc.c

 Whole #ifdef part should be removed since it won't work as MODULAR.
 ---
 Izumi Tsutsui

From: Masanori Kanaoka <kanaoka@ann.hi-ho.ne.jp>
To: gnats-bugs@NetBSD.org, tsutsui@ceres.dti.ne.jp
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: kern/40513: kernel does not compile with LKM
Date: Thu, 29 Jan 2009 22:29:42 +0900 (JST)

 Hi,

        From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
     Subject: Re: kern/40513: kernel does not compile with LKM
       Date : Thu, 29 Jan 2009 13:15:05 +0000 (UTC)
  Message-ID: <20090129131505.5804D63C040@narn.NetBSD.org>

 $  > 1. remove "option LKM" form config file.
 $  It was removed from GENERIC long ago, so you should also remove it.

 Yes,
 I removed it from MYCONFIG.


 $ > 2. a little patch fot sys/dev/pci/if_lmc.c
 $ Whole #ifdef part should be removed since it won't work as MODULAR.

 Sorry,
 I don't know whether it is right or not.

 Best Regards!
 ---
  Masanori Kanaoka        kanaoka AT ann.hi-ho.ne.jp

From: Izumi Tsutsui <tsutsui@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/40513 CVS commit: src/sys/dev/pci
Date: Mon,  2 Feb 2009 15:57:51 +0000 (UTC)

 Module Name:	src
 Committed By:	tsutsui
 Date:		Mon Feb  2 15:57:51 UTC 2009

 Modified Files:
 	src/sys/dev/pci: if_lmc.c

 Log Message:
 Remove obsolete #if defined(LKM) block.  PR kern/40513


 To generate a diff of this commit:
 cvs rdiff -r1.45 -r1.46 src/sys/dev/pci/if_lmc.c

 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: tsutsui@NetBSD.org
State-Changed-When: Tue, 03 Feb 2009 01:04:09 +0900
State-Changed-Why:
fixed.


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