On Fri, Aug 19, 2016 at 4:14 PM, Stefan Bidigaray <stefanb...@gmail.com> wrote:
> On Aug 18, 2016 7:14 PM, "Ivan Vučica" <i...@vucica.net> 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.
_______________________________________________ Gnustep-dev mailing list Gnustep-dev@gnu.org https://lists.gnu.org/mailman/listinfo/gnustep-dev