bpo-30345: Add -g to LDFLAGS for LTO (GH-7709)

Add -g to LDFLAGS when compiling with LTO to get debug symbols.
This commit is contained in:
Victor Stinner 2018-06-19 18:24:58 +02:00 committed by GitHub
parent c44d8e5db6
commit 06fe77a84b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1 @@
Add -g to LDFLAGS when compiling with LTO to get debug symbols.

8
configure vendored
View File

@ -6427,6 +6427,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

View File

@ -1302,6 +1302,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