tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Confused about MKBUILD=yes



Greg A. Woods wrote:
I think COPTS is for other things, like -mcpu, -pipe, -mtune, etc.

Both mk.conf(5) and bsd.README use '-g' with COPTS in examples, so it seems like a safe place to put the debug flag.

There are way too many ways to pass flags to the compiler.  :-)

Indeed! :)

I don't think the debug symbols are stripped -- they're just *copied* to /usr/libdata/debug. Here are the relevant lines from bsd.prog.mk:

Indeed -- they're not stripped unless you also set STRIPFLAG=-s

Ah ha!  STRIPFLAG!  That's what I was missing.  Thanks!

I'm assuming the binaries are stripped after the debug symbols are copied to /usr/libdata/debug... Correct?

So it seems like what I want to do is:

COPTS += -ggdb
STRIPFLAG = -S -g
MKDEBUG = yes

This gets me everything I want, EXCEPT it still only splits up programs, not libraries. The debug symbols are still integrated inside the installed library binaries, not moved to /usr/libdata/debug.

In netbsd-1.6.x I used STRIPFLAG="-sS -g", but I've found that with /usr/libdata/debug I don't really need to leave any symbols in the executable files any more.

Since only the debug symbols are copied to /usr/libdata/debug, wouldn't it be better to strip only the debug symbols? Or is there nothing of value in the non-debug symbols?

I don't think the symbol-file command is needed; gdb will see the .gnu_debuglink section in the ELF binary and simply load the file listed there.

Well, it is needed if your binaries have been stripped of symbols.  :-)

I think strip leaves the .gnu_debuglink section alone.

-Richard


Home | Main Index | Thread Index | Old Index