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 06fe77a84b)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
This commit is contained in:
Miss Islington (bot) 2018-06-22 00:10:20 -07:00 committed by Victor Stinner
parent d554414d98
commit 1bb9dd337e
3 changed files with 17 additions and 0 deletions

View file

@ -0,0 +1 @@
Add -g to LDFLAGS when compiling with LTO to get debug symbols.

8
configure vendored
View file

@ -6482,6 +6482,14 @@ if test "$Py_LTO" = 'true' ; then
esac
;;
esac
if test "$ac_cv_prog_cc_g" = "yes"
then
# bpo-30345: Add -g to LDFLAGS when compiling with LTO
# to get debug symbols.
LTOFLAGS="$LTOFLAGS -g"
fi
CFLAGS="$CFLAGS $LTOFLAGS"
LDFLAGS="$LDFLAGS $LTOFLAGS"
fi

View file

@ -1339,6 +1339,14 @@ if test "$Py_LTO" = 'true' ; then
esac
;;
esac
if test "$ac_cv_prog_cc_g" = "yes"
then
# bpo-30345: Add -g to LDFLAGS when compiling with LTO
# to get debug symbols.
LTOFLAGS="$LTOFLAGS -g"
fi
CFLAGS="$CFLAGS $LTOFLAGS"
LDFLAGS="$LDFLAGS $LTOFLAGS"
fi