From root@hathor.isnic.is  Thu Dec 23 12:45:01 2004
Return-Path: <root@hathor.isnic.is>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 2556116A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 23 Dec 2004 12:45:01 +0000 (GMT)
Received: from hathor.isnic.is (hathor.isnic.is [193.4.58.92])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 6F4CD43D1F
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 23 Dec 2004 12:45:00 +0000 (GMT)
	(envelope-from root@hathor.isnic.is)
Received: from hathor.isnic.is (smmsp@localhost [127.0.0.1])
	by hathor.isnic.is (8.13.1/8.13.1) with ESMTP id iBNCixMf018824
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 23 Dec 2004 12:44:59 GMT
	(envelope-from root@hathor.isnic.is)
Received: (from root@localhost)
	by hathor.isnic.is (8.13.1/8.13.1/Submit) id iBNCiwRi018823;
	Thu, 23 Dec 2004 12:44:58 GMT
	(envelope-from root)
Message-Id: <200412231244.iBNCiwRi018823@hathor.isnic.is>
Date: Thu, 23 Dec 2004 12:44:58 GMT
From: Olafur Osvaldsson <oli@isnic.is>
Reply-To: Olafur Osvaldsson <oli@isnic.is>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Unable to build kernel with DEBUG option set
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         75430
>Category:       kern
>Synopsis:       Unable to build kernel with DEBUG option set
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 23 12:50:26 GMT 2004
>Closed-Date:    Thu Dec 23 13:52:21 GMT 2004
>Last-Modified:  Thu Dec 23 13:52:21 GMT 2004
>Originator:     Olafur Osvaldsson
>Release:        FreeBSD 5.3-RELEASE-p2 i386
>Organization:
ISNIC
>Environment:
System: FreeBSD hathor.isnic.is 5.3-RELEASE-p2 FreeBSD 5.3-RELEASE-p2 #1: Mon Dec 13 14:24:39 GMT 2004 root@hathor.isnic.is:/usr/obj/usr/src/sys/ISNIC i386


	
>Description:
After adding "options         DEBUG=-g" to the kernel config file I get the
following error on every machine I tried with 5.3-RELEASE-p2:

=============================================================================
cc -c -O -pipe  -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -fformat-extensions -std=c99  -nostdinc -I-  -I. -I/usr/src/sys -I/usr/src/sys/contrib/dev/acpica -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/ipfilter -I/usr/src/sys/contrib/pf -I/usr/src/sys/contrib/dev/ath -I/usr/src/sys/contrib/dev/ath/freebsd -I/usr/src/sys/contrib/ngatm -D_KERNEL -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000  -mno-align-long-strings -mpreferred-stack-boundary=2 -ffreestanding -Werror  /usr/src/sys/ufs/ffs/ffs_snapshot.c
/usr/src/sys/ufs/ffs/ffs_snapshot.c:65:1: "DEBUG" redefined
In file included from <command line>:3:
./opt_global.h:1:1: this is the location of the previous definition
*** Error code 1
                                                                                                                                
Stop in /usr/obj/usr/src/sys/ISNIC
*** Error code 1
                                                                                                                                
Stop in /usr/src.
*** Error code 1
                                                                                                                                
Stop in /usr/src.
=============================================================================

I was running the same kernel without the DEBUG option fine before, no updates before
adding the option and recompiling.
	
>How-To-Repeat:
Add "options         DEBUG=-g" to your kernel config.
	
>Fix:
Attached is a patch that fixes this for me.

Maybe the DEBUG define should be removed completely from that file?

	

--- ffs_snapshot.c.diff begins here ---
--- sys/ufs/ffs/ffs_snapshot.c.orig	Thu Dec 23 12:29:05 2004
+++ sys/ufs/ffs/ffs_snapshot.c	Thu Dec 23 12:29:30 2004
@@ -62,7 +62,9 @@
 #include <ufs/ffs/ffs_extern.h>
 
 #define KERNCRED thread0.td_ucred
+#ifndef DEBUG
 #define DEBUG 1
+#endif
 
 static int cgaccount(int, struct vnode *, struct buf *, int);
 static int expunge_ufs1(struct vnode *, struct inode *, struct fs *,
--- ffs_snapshot.c.diff ends here ---


>Release-Note:
>Audit-Trail:

From: Olafur Osvaldsson <oli@isnic.is>
To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-bugs@FreeBSD.org
Cc:  
Subject: Re: kern/75430: Unable to build kernel with DEBUG option set
Date: Thu, 23 Dec 2004 13:45:03 +0000

 Damn, could someone close this...I think the lack of sleep before
 christmas is affecting my work...
 
 options is not the same as makeoptions
 
 /Oli
 
 -- 
 Olafur Osvaldsson
 Systems Administrator
 Internet a Islandi hf.
 Tel:   +354 525-5291
 Email: oli@isnic.is
State-Changed-From-To: open->closed 
State-Changed-By: maxim 
State-Changed-When: Thu Dec 23 13:51:43 GMT 2004 
State-Changed-Why:  
Closed at the submitter's request. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=75430 
>Unformatted:
