HomePhabricator

Make --enable-debug to pick better options

Description

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

Details

Provenance
Evan Klitzke <evan@eklitzke.org>Authored on Mar 15 2018, 12:05
FabienCommitted on Feb 19 2019, 17:44
FabienPushed on Feb 19 2019, 17:45
Reviewer
Restricted Project
Differential Revision
D2561: Make --enable-debug to pick better options
Parents
rABC123637a3840c: Remove contrib/devtools/clang-format-diff.py
Branches
Unknown
Tags
Unknown