Want to compile GENERIC w/o DEBUG symbols.

I've been building my local STABLE kernel for a long time, making localization changes to GENERIC after every csup, which has become a pain. Recently from http://forums.freebsd.org/showthread.php?t=32637 I followed the suggestion of wblock@ to build a local config that includes GENERIC. I did so and have had success with most all of the driver/options I've tried except for "makeoptions".
From # man 5 conf I was led to believe that declaring
Code:
makeoptions     DEBUG
in my local config (where DEBUG has a null value) would overload the
Code:
makeoptions       DEBUG=-g
declaration in GENERIC, but no joy. All the "makeoptions" permutations that might make sense to me (and wild guesses too), result in debug symbols being built.

My LOCAL config file:
Code:
# Local kernel config diffs.

include GENERIC

ident   LOCAL

makeoptions     DEBUG

nodevice        eisa
nodevice        fdc

options VESA
options SC_PIXEL_MODE
What have I done wrong here?
 
Untested, but I'd expect it to be
Code:
makeoptions DEBUG=

Remember that the *.symbols files will still be there in /boot/kernel from previous builds until you delete them.
 
Wow, worked Warren! Thank you. Totally missed it. I tried:
Code:
makeoptions  DEBUG
and
Code:
makeoptions    DEBUG=""

Again, thanks for the nudge.
 
Woah there mister, not so fast. Turns out I snookered myself with a stale
Code:
#makeoptions   DEBUG=-g
in /usr/src/sys/amd64/conf/GENERIC. Today when making additions to my /usr/src/sys/amd64/conf/LOCAL, I took a quick look at GENERIC and noticed the error. After a fix and rebuild of the kernel, again symbols were built and installed.

Still looking for a fix, I applied some arcane logic and came up with a try of
Code:
nomakeoptions      DEBUG
for LOCAL and poof, it works. I tested it on two kernel builds/installs into an empty /boot/kernel directory.

So, now I know how to compile and install GENERIC without debug symbols. Of course this is all covered if one reads past the tantalizing suggestion (in the third example of makeoptions in config(5)) that one knows how to turn off or null a previously declared makeoptions. On down the man page nomakeoptions is clearly explained.

Mea culpa but I'm not going to lose any sleep over it, I'm old. Instead, I'm taking satisfaction that I'm still learning.
 
Not tested either, but how does writing

Code:
.if ${.CURDIR:M/usr/src*} || ${.CURDIR:M/usr/obj*}
  CFLAGS:=${CFLAGS:S/-g//}
.endif
into make.conf or src.conf sound?
 
xibo: Thanks, looks like that should work too. But, with all respect, for now I'll stick with the mainstream solution.
 
Back
Top