-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Make --enable-debug to pick better options #13005
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Various changes: * Don't check $GCC and $GXX * Prefer -Og instead of -O0 * If -g3 isn't available, use -g This also incidentally fixes compiler warnings with GCC and glibc when using --enable-debug, as the old default values mixed poorly with the hardening flags.
One small thing that needs to be fixed before merge is that
I'll find a way to fix that. |
952d861
to
d58454d
Compare
Added a commit fixing the annoying extra whitespace:
Please review :-) |
f99689a
to
8a0ad1a
Compare
utACK 8a0ad1a2333b329d6eb8d34a25277181ee675f23. The first commit is just rebased and has no changes since my previous review in the other PR. The second commit is new and looks ok, though I think the echo_joined function is overkill. I think you should just drop quotes around the variables and let the shell collapse spaces: echo " CXXFLAGS =" $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $ERROR_CXXFLAGS $CXXFLAGS |
Agree with @ryanofsky about echo_joined. I'd prefer to just drop the second commit. |
Apologies, I was travelling without access to my laptop while this was put up for grabs. This seems fine but I think we came to the conclusion that we should not try to join the output, which was where my first commit was at. We can fix the whitespace formatting in another pass using AX_APPEND_COMPILE_FLAGS. |
@eklitzke Good idea about fixing the whitespace with |
@practicalswift That's worth handling in a separate PR. It will be a pretty huge diff. |
@practicalswift From reading the above discussion, and on the original PR, you still need to drop the second commit. Then this can be reviewed, and a follow-up PR can introduce the |
8a0ad1a
to
9e49db2
Compare
@fanquake Updated! Please re-review! :-) |
re-utACK 9e49db2 |
9e49db2 Make --enable-debug to pick better options (Evan Klitzke) Pull request description: Cherry-picked (and rebased) 9418964 from the "up for grabs" PR: "[build] Make --enable-debug pick better options" (#12695). See previous review in #12695. Tree-SHA512: a93cdadcf13e2ef8519acb1ce4f41ce95057a388347bb0a86a5c164dc7d0b0d14d4bb2a466082d5a100b8d50de65c605c40abaed555e8ea77c99e28800a34439
[-Og], | ||
[[DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -Og"]], | ||
[AX_CHECK_COMPILE_FLAG([-O0],[[DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -O0"]],,[[$CXXFLAG_WERROR]])], | ||
[[$CXXFLAG_WERROR]]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if -Og
and -O0
are unavailable? (Both of these may compromise spectre mitigations, so I have my x86 compiler not support them at all)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question! @eklitzke, what do you say? :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer making this -O1. Completely un-optimized code barely resembles anything that ever gets run, and macro/inline expansions make it hard to deal with anyway.
./configure updates Includes code cherry-picked from the following upstream Bitcoin Core PRs: - bitcoin/bitcoin#6748 - bitcoin/bitcoin#12373 - bitcoin/bitcoin#12692 - bitcoin/bitcoin#12901 - bitcoin/bitcoin#13005 - bitcoin/bitcoin#13445 - bitcoin/bitcoin#12686 - bitcoin/bitcoin#16435 Part of #2074.
9e49db2 Make --enable-debug to pick better options (Evan Klitzke) Pull request description: Cherry-picked (and rebased) 9418964 from the "up for grabs" PR: "[build] Make --enable-debug pick better options" (bitcoin#12695). See previous review in bitcoin#12695. Tree-SHA512: a93cdadcf13e2ef8519acb1ce4f41ce95057a388347bb0a86a5c164dc7d0b0d14d4bb2a466082d5a100b8d50de65c605c40abaed555e8ea77c99e28800a34439
9e49db2 Make --enable-debug to pick better options (Evan Klitzke) Pull request description: Cherry-picked (and rebased) 9418964 from the "up for grabs" PR: "[build] Make --enable-debug pick better options" (bitcoin#12695). See previous review in bitcoin#12695. Tree-SHA512: a93cdadcf13e2ef8519acb1ce4f41ce95057a388347bb0a86a5c164dc7d0b0d14d4bb2a466082d5a100b8d50de65c605c40abaed555e8ea77c99e28800a34439
9e49db2 Make --enable-debug to pick better options (Evan Klitzke) Pull request description: Cherry-picked (and rebased) 9418964 from the "up for grabs" PR: "[build] Make --enable-debug pick better options" (bitcoin#12695). See previous review in bitcoin#12695. Tree-SHA512: a93cdadcf13e2ef8519acb1ce4f41ce95057a388347bb0a86a5c164dc7d0b0d14d4bb2a466082d5a100b8d50de65c605c40abaed555e8ea77c99e28800a34439
Cherry-picked (and rebased) 9418964 from the "up for grabs" PR: "[build] Make --enable-debug pick better options" (#12695).
See previous review in #12695.