← Back to DAGDA | Support | Source: https://github.com/python/cpython/commit/78392885c9b08021c89649728053d31503d8a509
Skip to content

Commit 7839288

Browse files
authored
bpo-30345: Add -g to LDFLAGS for LTO (GH-7709) (GH-7826)
Add -g to LDFLAGS when compiling with LTO to get debug symbols.
1 parent a0622f1 commit 7839288

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add -g to LDFLAGS when compiling with LTO to get debug symbols.

‎configure‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6618,6 +6618,13 @@ if test "$Py_LTO" = 'true' ; then
66186618
esac
66196619
;;
66206620
esac
6621+
6622+
if test "$ac_cv_prog_cc_g" = "yes"
6623+
then
6624+
# bpo-30345: Add -g to LDFLAGS when compiling with LTO
6625+
# to get debug symbols.
6626+
LTOFLAGS="$LTOFLAGS -g"
6627+
fi
66216628
fi
66226629

66236630
# Enable PGO flags.

‎configure.ac‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,6 +1347,13 @@ if test "$Py_LTO" = 'true' ; then
13471347
esac
13481348
;;
13491349
esac
1350+
1351+
if test "$ac_cv_prog_cc_g" = "yes"
1352+
then
1353+
# bpo-30345: Add -g to LDFLAGS when compiling with LTO
1354+
# to get debug symbols.
1355+
LTOFLAGS="$LTOFLAGS -g"
1356+
fi
13501357
fi
13511358

13521359
# Enable PGO flags.

0 commit comments

Comments
 (0)