]> granicus.if.org Git - python/commitdiff
bpo-30345: Add -g to LDFLAGS for LTO (GH-7709) (GH-7826)
authorVictor Stinner <vstinner@redhat.com>
Fri, 22 Jun 2018 07:10:42 +0000 (09:10 +0200)
committerGitHub <noreply@github.com>
Fri, 22 Jun 2018 07:10:42 +0000 (09:10 +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 986ab871bd53ec32476440e602fa883c43a70322..8c2a0ca5466614d5de2c664431c3d3dd9070416b 100755 (executable)
--- 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.
index 338be3b9a6bd4454c7d326a8c9f49366d9849bbd..f2cd11730b6951070e058d11ec60c572d9f670b3 100644 (file)
@@ -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.