Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bpo-30345: Add -g to LDFLAGS for LTO (GH-7709)
Add -g to LDFLAGS when compiling with LTO to get debug symbols.
(cherry picked from commit 06fe77a)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
  • Loading branch information
vstinner authored and miss-islington committed Jun 20, 2018
commit cf1c3877e9135c1c2032e3384362fa96e7f26bd9
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add -g to LDFLAGS when compiling with LTO to get debug symbols.
8 changes: 8 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -6482,6 +6482,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
Expand Down
8 changes: 8 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down