Hyrum K Wright <hy...@hyrumwright.org> writes: > I just built a version of trunk to use on my "production" working > copies, and configured it without maintainer mode. I noticed that it > was using '-g -O2' in the CFLAGS, which seems completely nonsensical: > debug symbols often refer to stuff that gets optimized away, and just > bloats the final executable. Although I don't know if this has any > impact on the processor i-cache, I still don't see much reason for > using '-g -O2' in non-maintainer mode. > > Some voice in the back of my head says we've had this discussion > before, but I can't seem to find it. I just wanted to check here > before I went and changed things. (And for the record, I hacked my > local Makefile to remove '-g' from CFLAGS.)
I believe it is a GNU standard. Debug symbols can be used with an optimised build although it is obviously easier to debug without optimisation Most distributions strip debug symbols from their binary packages automatically. These days GDB supports debug symbols in files separate from the executables, so some distributions have started shipping debug packages that contain the debug symbols for the stripped binaries. -- Philip