summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-06-22 00:10:20 -0700
committerVictor Stinner <vstinner@redhat.com>2018-06-22 09:10:20 +0200
commit1bb9dd337ed5aa9eafc8e2ce017ceedf044145e3 (patch)
treede6fcccf27d0b29b9408bcd1147cf5e37ec7a5f2 /configure
parentd554414d981a8bfe38cc5df5751bc3efcb0c36c3 (diff)
downloadcpython-git-1bb9dd337ed5aa9eafc8e2ce017ceedf044145e3.tar.gz
bpo-30345: Add -g to LDFLAGS for LTO (GH-7709) (GH-7824)
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>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure8
1 files changed, 8 insertions, 0 deletions
diff --git a/configure b/configure
index e0389649ae..3e52e60f91 100755
--- 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