kern/75430: Unable to build kernel with DEBUG option set

Olafur Osvaldsson oli at isnic.is
Thu Dec 23 04:50:27 PST 2004


>Number:         75430
>Category:       kern
>Synopsis:       Unable to build kernel with DEBUG option set
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 23 12:50:26 GMT 2004
>Closed-Date:
>Last-Modified:
>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 at 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:
>Unformatted:


More information about the freebsd-bugs mailing list