]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-30345: Add -g to LDFLAGS for LTO (GH-7709) (GH-7825)
authorVictor Stinner <vstinner@redhat.com>
Fri, 22 Jun 2018 07:11:33 +0000 (09:11 +0200)
committerGitHub <noreply@github.com>
Fri, 22 Jun 2018 07:11:33 +0000 (09:11 +0200)
Add -g to LDFLAGS when compiling with LTO to get debug symbols.

Misc/NEWS.d/next/Build/2018-06-15-18-18-16.bpo-30345.j-xRE1.rst [new file with mode: 0644]
configure
configure.ac

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 (file)
index 0000000..f8db09b
--- /dev/null
@@ -0,0 +1 @@
+Add -g to LDFLAGS when compiling with LTO to get debug symbols.
index 4a047e69bda1fee42887b327d1bee76ecee2a88f..a75ca3a0f5c9f2bfb718d1dc20a2956b7590bbb6 100755 (executable)
--- a/configure
+++ b/configure
@@ -6481,6 +6481,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
 
 
index 913d5469d06e34735ee1a5a6387ce76d10f0392f..36625f7b82a34366ae0e0ec1a0bb9f976bc11cf9 100644 (file)
@@ -1455,6 +1455,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