autoconf: Sane --enable-debug defaults. #16435

pull dongcarl wants to merge 1 commits into bitcoin:master from dongcarl:2019-07-better-debuggability changing 1 files +4 −7
  1. dongcarl commented at 3:14 pm on July 22, 2019: member
    0Don't optimize even if variables adhere to as-if rule. This is a
    1somewhat sane default for debugging.
    

    Fixes: #14830

    This is more of a “do something dumb and have people correct you” kind of PR. The end goal is to have a configure flag that will allow for debugging without annoying “optimized out” messages, for developer experiences’ sake. This is the minimal diff, but people have suggested --enable-debug-slow in the past.

  2. dongcarl added the label Build system on Jul 22, 2019
  3. jonasschnelli commented at 3:21 pm on July 22, 2019: contributor
    Yes. Please! On macOS, without that fix, debugging with lldb/gdb is impossible. Concept ACK
  4. in configure.ac:274 in e85368fb89 outdated
    270@@ -271,11 +271,11 @@ if test "x$enable_debug" = xyes; then
    271   if test "x$CXXFLAGS_overridden" = xno; then
    272 	CXXFLAGS=""
    273   fi
    274-  # Prefer -Og, fall back to -O0 if that is unavailable.
    275+  # Prefer -O0, fall back to -Og if that is unavailable.
    


    laanwj commented at 4:58 pm on July 22, 2019:
    I think it’s fine to add -O0 unconditionally. E.g.: I would be very surprised if a compiler supports -Og but not -O0,
  5. achow101 commented at 5:21 pm on July 22, 2019: member

    Concept ACK.

    One thing to note is that on Clang 8, I get a bunch of compiler warnings about things needing optimization if -O0 is set.

  6. laanwj commented at 6:10 pm on July 22, 2019: member
    BTW: this effectively reverts 9e49db2426cd4508d9dd95c7461e107bab7fd7de (#13005)
  7. autoconf: Sane --enable-debug defaults.
    Don't optimize at all when --enable-debug is supplied. This makes sure
    that nothing is optimized out.
    d6ac25bdd9
  8. dongcarl force-pushed on Jul 30, 2019
  9. dongcarl commented at 8:00 pm on July 30, 2019: member
    Addressed comments, there was some discussion on this here: http://gnusha.org/bitcoin-builds/2019-07-30.log
  10. theuni commented at 3:00 pm on July 31, 2019: member

    From the above discussion: -0 from me.

    I would expect –enable-debug to turn on Og:

    -Og Optimize debugging experience. -Og enables optimizations that do not interfere with debugging. It should be the optimization level of choice for the standard edit-compile-debug cycle, offering a reasonable level of optimization while maintaining fast compilation and a good debugging experience.

    But I don’t care that much, and the people that do care seem to want –enable-debug to mean more than the “standard edit-compile-debug cycle”. That seems reasonable enough, so sure.

  11. dongcarl marked this as ready for review on Jul 31, 2019
  12. jonasschnelli commented at 8:11 am on August 8, 2019: contributor
    Tested ACK d6ac25bdd96589a71006e3ab3f303b091ffaa9e4 Brings back debugability on macOS 10.14 with clang version Apple LLVM version 10.0.1 (clang-1001.0.46.4).
  13. MarcoFalke added this to the milestone 0.19.0 on Aug 8, 2019
  14. jonasschnelli merged this on Aug 14, 2019
  15. jonasschnelli closed this on Aug 14, 2019

  16. jonasschnelli referenced this in commit f418c3379c on Aug 14, 2019
  17. sidhujag referenced this in commit 77ab8ab575 on Aug 17, 2019
  18. zkbot referenced this in commit 8e8a9350c3 on Jan 30, 2020
  19. PastaPastaPasta referenced this in commit 1be9a5c86f on Jun 27, 2021
  20. PastaPastaPasta referenced this in commit 3bb5f530f2 on Jun 28, 2021
  21. PastaPastaPasta referenced this in commit a5540f0faf on Jun 29, 2021
  22. PastaPastaPasta referenced this in commit 146e8fdf57 on Jul 1, 2021
  23. PastaPastaPasta referenced this in commit 7e72e15e5d on Jul 1, 2021
  24. PastaPastaPasta referenced this in commit 9510931a8a on Jul 12, 2021
  25. DrahtBot locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-22 03:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me