gnustep-dev
[Top][All Lists]
Advanced

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

Re: common.make -- debug=yes


From: Ivan Vučica
Subject: Re: common.make -- debug=yes
Date: Sun, 21 Aug 2016 23:38:39 +0100

On Fri, Aug 19, 2016 at 4:14 PM, Stefan Bidigaray <address@hidden> wrote:

On Aug 18, 2016 7:14 PM, "Ivan Vučica" <address@hidden> wrote:

> Also, when debugging information is needed, you are typically debugging and would preferably want to have the execution to be in order. At least that's my expectation. Rarely - but not never - would I find optimisation + debuginfo useful.

I actually think the opposite to be true. Whatever the case, i think GNUstep make should honor the intent of the person compiling the code. If I set -O1 and debug=yes, I would expect the executable to be optimized to level 1, regardless of debugging symbols.

I would expect that as well, except I would /usually/ not want that. You are giving good examples of when that would be useful; it's just not something I do usually.

I agree that it would be correct if the build system respected author's wishes. I would expect they would be respected if you do not use "make debug=yes", and instead e.g.: 'CFLAGS="-g3 -O2" CXXFLAGS="-g3 -O2" OBJCFLAGS="-g3 -O2" make'; if I use 'make debug=yes' I personally already expect some magic to be happening. If that magic also happens to remove -O flags that were specified elsewhere in the build system, so be it. If it removes flags I manually passed (via environment variables, for example), I would be more concerned and consider it a bug, but a smaller one.

A few examples:
1. Distributed binaries: most distributions compile with "-O2 -g" and later remove debugging info from the binary to a different file. This saves space and still allows debugging to happen on production code.
2. Debugging real code: we often see, even on this list, cases where crashes can't be reproduced in debugging mode. To avoid adding another unknown (optimized vs unoptimized code) to the equation, the only thing debug=yes should do is add debugging info.
3. Convention: GNU autotools uses "-O2 -g" if CFLAGS is not given. Most folks compiling their own code are going to expect that to be the case, and doing things differently might cause more confusion.

Additionally, I think it is a reasonable expectation that debug=yes isn't going to do anything but add debugging symbols to the binary.

Just a few thoughts.

To add, you may be right about all this. The above is just my personal expectations.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]