summaryrefslogtreecommitdiff
path: root/configure.ac
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.ac
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.ac')
-rw-r--r--configure.ac8
1 files changed, 8 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index b5beb08574..3885786aab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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