Make --enable-debug to pick better options
Summary:
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.
Backport of core PR13005
This is a follow-up for D2556
Note: there is a dependency which is not backported here, and provides
gprof support. As it is not related with this diff, and likely no one is
running gprof, I prefer not backporting it. It can always be added later
if necessary.
Test Plan:
./autogen.sh mkdir build && cd build ../configure --enable-debug
Check in the configure report that the optimization CXXFLAGS are correct
(depends on your compiler, but likely -Og -g3)
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Subscribers: teamcity, schancel
Differential Revision: https://reviews.bitcoinabc.org/D2561