Skip to content

Commit 319cfb5

Browse files
authored
bpo-30345: Add -g to LDFLAGS for LTO (GH-7709) (GH-7825)
Add -g to LDFLAGS when compiling with LTO to get debug symbols.
1 parent 7b383a5 commit 319cfb5

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed
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
@@ -6481,6 +6481,13 @@ if test "$Py_LTO" = 'true' ; then
64816481
esac
64826482
;;
64836483
esac
6484+
6485+
if test "$ac_cv_prog_cc_g" = "yes"
6486+
then
6487+
# bpo-30345: Add -g to LDFLAGS when compiling with LTO
6488+
# to get debug symbols.
6489+
LTOFLAGS="$LTOFLAGS -g"
6490+
fi
64846491
fi
64856492
64866493

configure.ac

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,6 +1455,13 @@ if test "$Py_LTO" = 'true' ; then
14551455
esac
14561456
;;
14571457
esac
1458+
1459+
if test "$ac_cv_prog_cc_g" = "yes"
1460+
then
1461+
# bpo-30345: Add -g to LDFLAGS when compiling with LTO
1462+
# to get debug symbols.
1463+
LTOFLAGS="$LTOFLAGS -g"
1464+
fi
14581465
fi
14591466

14601467

0 commit comments

Comments
 (0)