[Python-checkins] bpo-30345: Add -g to LDFLAGS for LTO (GH-7709)
Victor Stinner
webhook-mailer at python.org
Tue Jun 19 12:25:22 EDT 2018
https://github.com/python/cpython/commit/06fe77a84bd29d51506ab2ff703ae585a6121af2
commit: 06fe77a84bd29d51506ab2ff703ae585a6121af2
branch: master
author: Victor Stinner <vstinner at redhat.com>
committer: GitHub <noreply at github.com>
date: 2018-06-19T18:24:58+02:00
summary:
bpo-30345: Add -g to LDFLAGS for LTO (GH-7709)
Add -g to LDFLAGS when compiling with LTO to get debug symbols.
files:
A Misc/NEWS.d/next/Build/2018-06-15-18-18-16.bpo-30345.j-xRE1.rst
M configure
M 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
index 000000000000..f8db09bdbc66
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2018-06-15-18-18-16.bpo-30345.j-xRE1.rst
@@ -0,0 +1 @@
+Add -g to LDFLAGS when compiling with LTO to get debug symbols.
diff --git a/configure b/configure
index 5187c6ff2b95..d427703f8e86 100755
--- a/configure
+++ b/configure
@@ -6427,6 +6427,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
diff --git a/configure.ac b/configure.ac
index b13728e37d7b..b98ceb2b1427 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1302,6 +1302,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
More information about the Python-checkins
mailing list