How to build _everything_ with (usable) debug symbols

Hi all,

how do I build everything with debug symbols and without optimization? I want to disable -O2 so that the optimizations don't get into my way when debugging. Right now I have
Code:
makeoptions DEBUG=-g
in my kernel config and my /etc/src.conf looks like this:
Code:
CFLAGS?=-pipe
WITH_CTF=1
DEBUG_FLAGS=-g
but removing -O2 that way won't work, any idea?

What do I do about ports? Is there a generic way to build everything with debug info?
 
Have a look at /usr/share/examples/etc/make.conf. Set the options in /etc/make.conf.
 
Ok, I removed src.conf and now have the following in my /etc/make.conf
Code:
CFLAGS=-pipe
WITH_CTF=1
DEBUG_FLAGS=-g
Building openssl breaks with this CFLAGS but a
Code:
make buildworld WITHOUT_OPENSSL=1
works.
But somehow I broke the loader with installworld'ing this world (it hangs after loading the kernel modules). Any ideas?

Update: old loader (/boot/loader.old) is working. I'll try to investigate.
 
You don't have to use make.conf. To explain how they're used:
- make.conf is used by all invocations of BSD's make. Hence, this also applies to ports.
- src.conf is used the build system for world/kernel and anything you build yourself by using the build system in /usr/share/mk, unless you define _WITHOUT_SRC_CONF before bsd.own.mk is included.

Your previous error was to use:
CFLAGS?=-pipe

Removing the question mark will properly omit optimization from CFLAGS.

CTF is used for DTRACE, this is most likely why loader is broken. It doesn't affect gdb and as such you can turn it off.
If CTF is the cause of the broken loader, you may want to file a bugreport, so that loader can be fixed or NO_CTF be set in it's Makefile's.
 
Back
Top