[2179] in SIPB_Linux_Development
Re: Official policy on what build flags to use for the release?
daemon@ATHENA.MIT.EDU (Greg Hudson)
Wed Sep 30 08:44:27 1998
To: Salvatore Valente <svalente@MIT.EDU>
Cc: tytso@MIT.EDU, linux-dev@MIT.EDU
In-Reply-To: Your message of "Wed, 30 Sep 1998 01:57:33 EDT."
<199809300557.BAA08200@StarbaseZero.ne.mediaone.net>
Date: Wed, 30 Sep 1998 08:44:07 EDT
From: Greg Hudson <ghudson@MIT.EDU>
> What are the advantages of compiling the release with -g?
Versus no flags at all, it makes it much easier to debug the resulting
binaries, since you will have debugging symbols (which, in the
debugger, gives you the names and types of function arguments, the
names of static symbols, and some other things).
Versus -g -O, it makes it somewhat easier to debug the resulting
binaries, since debugging a program compiled with -O can yield some
mildly confusing behavior.
> Is some part of that advantage lost if the release is compiled with
> -g and stripped?
Stripped binaries have no symbol information at all (not even the
names of non-static symbols), so it you cannot use them for symbolic
deugging.
If you have a binary A and a stripped binary A' which came from it,
and A' produces a core dump, you can debug that core dump just fine
using binary A. Likewise, you can gdb attach to a process of A' using
binary A just fine. So, if you preserve the unstripped binaries
somewhere, you can still do your debugging just as well. Of course,
this approach is more error-prone: the person doing the debugging
might not know where to find the unstripped binaries, and the stripped
and unstripped binaries might turn out to be slightly different
compiles.