diff options
author | Victor Stinner <vstinner@redhat.com> | 2018-06-22 07:10:42 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-22 07:10:42 (GMT) |
commit | 78392885c9b08021c89649728053d31503d8a509 (patch) | |
tree | 51ebf236ba009fc11a13934bcd6a95f10fcf786e | |
parent | a0622f1071164bc67a307cfec1173c295901c4b9 (diff) | |
download | cpython-78392885c9b08021c89649728053d31503d8a509.zip cpython-78392885c9b08021c89649728053d31503d8a509.tar.gz cpython-78392885c9b08021c89649728053d31503d8a509.tar.bz2 |
bpo-30345: Add -g to LDFLAGS for LTO (GH-7709) (GH-7826)
Add -g to LDFLAGS when compiling with LTO to get debug symbols.
-rw-r--r-- | Misc/NEWS.d/next/Build/2018-06-15-18-18-16.bpo-30345.j-xRE1.rst | 1 | ||||
-rwxr-xr-x | configure | 7 | ||||
-rw-r--r-- | configure.ac | 7 |
3 files changed, 15 insertions, 0 deletions
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 0000000..f8db09b --- /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. @@ -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 338be3b..f2cd117 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. |