[Python-checkins] bpo-30345: Add -g to LDFLAGS for LTO (GH-7709) (GH-7826)

Victor Stinner webhook-mailer at python.org
Fri Jun 22 03:10:45 EDT 2018


https://github.com/python/cpython/commit/78392885c9b08021c89649728053d31503d8a509
commit: 78392885c9b08021c89649728053d31503d8a509
branch: 3.6
author: Victor Stinner <vstinner at redhat.com>
committer: GitHub <noreply at github.com>
date: 2018年06月22日T09:10:42+02:00
summary:
bpo-30345: Add -g to LDFLAGS for LTO (GH-7709) (GH-7826)
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 986ab871bd53..8c2a0ca54666 100755
--- 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.
diff --git a/configure.ac b/configure.ac
index 338be3b9a6bd..f2cd11730b69 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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.


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /