]> granicus.if.org Git - python/commitdiff
bpo-30345: Add -g to LDFLAGS for LTO (GH-7709) (GH-7824)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 22 Jun 2018 07:10:20 +0000 (00:10 -0700)
committerVictor Stinner <vstinner@redhat.com>
Fri, 22 Jun 2018 07:10:20 +0000 (09:10 +0200)
Add -g to LDFLAGS when compiling with LTO to get debug symbols.
(cherry picked from commit 06fe77a84bd29d51506ab2ff703ae585a6121af2)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
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 e0389649ae0655ec17cf48725d2267cc1da4b0b2..3e52e60f915792cc1a7adf06b5164d87ae110aab 100755 (executable)
--- a/configure
+++ b/configure
@@ -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
index b5beb0857475bd949970bcad9b22b695ec5ede62..3885786aab2ae36326e2adac665126fd4a47ab4f 100644 (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