View Full Version : How to build _everything_ with (usable) debug symbols
Maledictus
February 17th, 2009, 16:03
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
makeoptions DEBUG=-g
in my kernel config and my /etc/src.conf looks like this:
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?
SirDice
February 17th, 2009, 16:20
Have a look at /usr/share/examples/etc/make.conf. Set the options in /etc/make.conf.
Maledictus
February 18th, 2009, 21:06
Ok, I removed src.conf and now have the following in my /etc/make.conf
CFLAGS=-pipe
WITH_CTF=1
DEBUG_FLAGS=-g
Building openssl breaks with this CFLAGS but a 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.
Mel_Flynn
March 2nd, 2009, 17:16
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.
Maledictus
March 5th, 2009, 12:36
Thanks Mel!
Another problem was that the world is currently broken with -O0 (without optimization) in openssl. If you want to build world with -O0 you have to revert this patch:
http://svn.freebsd.org/viewvc/base/head/crypto/openssl/crypto/engine/eng_padlock.c?r1=160837&r2=167615
I use dtrace so CTF is needed here. But I will take a look if that breaks the loader, thanks for the hint!
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.