bpo-30345: Add -g to LDFLAGS for LTO (GH-7709) (GH-7824)

Add -g to LDFLAGS when compiling with LTO to get debug symbols.
(cherry picked from commit 06fe77a84bd29d51506ab2ff703ae585a6121af2)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
3 files changed