Skip to content

Commit

Permalink
bpo-30345: Add -g to LDFLAGS for LTO (GH-7709) (GH-7824)
Browse files Browse the repository at this point in the history
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
miss-islington and vstinner committed Jun 22, 2018
1 parent d554414 commit 1bb9dd3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
@@ -0,0 +1 @@
Add -g to LDFLAGS when compiling with LTO to get debug symbols.
8 changes: 8 additions & 0 deletions configure
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
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

0 comments on commit 1bb9dd3

Please sign in to comment.