From: Victor Stinner Date: Fri, 22 Jun 2018 07:10:42 +0000 (+0200) Subject: bpo-30345: Add -g to LDFLAGS for LTO (GH-7709) (GH-7826) X-Git-Tag: v3.6.7rc1~255 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=78392885c9b08021c89649728053d31503d8a509;p=thirdparty%2FPython%2Fcpython.git bpo-30345: Add -g to LDFLAGS for LTO (GH-7709) (GH-7826) Add -g to LDFLAGS when compiling with LTO to get debug symbols. --- diff --git a/Misc/NEWS.d/next/Build/2018-06-15-18-18-16.bpo-30345.j-xRE1.rst b/Misc/NEWS.d/next/Build/2018-06-15-18-18-16.bpo-30345.j-xRE1.rst new file mode 100644 index 000000000000..f8db09bdbc66 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2018-06-15-18-18-16.bpo-30345.j-xRE1.rst @@ -0,0 +1 @@ +Add -g to LDFLAGS when compiling with LTO to get debug symbols. diff --git a/configure b/configure index 986ab871bd53..8c2a0ca54666 100755 --- a/configure +++ b/configure @@ -6618,6 +6618,13 @@ 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 fi # Enable PGO flags. diff --git a/configure.ac b/configure.ac index 338be3b9a6bd..f2cd11730b69 100644 --- a/configure.ac +++ b/configure.ac @@ -1347,6 +1347,13 @@ 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 fi # Enable PGO flags.