From f8c9943482bcd05553cbd15c011d84d8945f65ad Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Mon, 18 Jul 2022 08:47:03 +0200 Subject: [PATCH 1/2] gh-94847: Don't force inlining in debug builds of libmpdec (GH-94848) (cherry picked from commit 97b4121f9373a1b5312b90ac00eae9960deacfdb) Co-authored-by: Christian Heimes --- .../Build/2022-07-14-11-13-26.gh-issue-94847.s3Kr5p.rst | 2 ++ configure | 6 ++++++ configure.ac | 5 +++++ 3 files changed, 13 insertions(+) create mode 100644 Misc/NEWS.d/next/Build/2022-07-14-11-13-26.gh-issue-94847.s3Kr5p.rst diff --git a/Misc/NEWS.d/next/Build/2022-07-14-11-13-26.gh-issue-94847.s3Kr5p.rst b/Misc/NEWS.d/next/Build/2022-07-14-11-13-26.gh-issue-94847.s3Kr5p.rst new file mode 100644 index 00000000000000..a6d1e7277da4c0 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2022-07-14-11-13-26.gh-issue-94847.s3Kr5p.rst @@ -0,0 +1,2 @@ +Fixed ``_decimal`` module build issue on GCC when compiling with LTO and +pydebug. Debug builds no longer force inlining of functions. diff --git a/configure b/configure index be8935937c8f44..6e578c74d6c8a7 100755 --- a/configure +++ b/configure @@ -12552,6 +12552,12 @@ else have_supported_sqlite3=no + if test "x$with_pydebug" = xyes; then : + + as_fn_append LIBMPDEC_CFLAGS " -DTEST_COVERAGE" + +fi + fi diff --git a/configure.ac b/configure.ac index 695576a46e87e6..09f3f902a6b585 100644 --- a/configure.ac +++ b/configure.ac @@ -3628,6 +3628,11 @@ AS_VAR_IF([with_system_libmpdec], [yes], [ LIBMPDEC_CFLAGS="-I\$(srcdir)/Modules/_decimal/libmpdec" LIBMPDEC_LDFLAGS="-lm \$(LIBMPDEC_A)" LIBMPDEC_INTERNAL="\$(LIBMPDEC_A)" + + dnl Disable forced inlining in debug builds, see GH-94847 + AS_VAR_IF([with_pydebug], [yes], [ + AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -DTEST_COVERAGE"]) + ]) ]) AC_SUBST([LIBMPDEC_CFLAGS]) From 4e6d5b0360f60aa2742880c4da12fd5c77fd3ee2 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Mon, 18 Jul 2022 11:43:30 +0200 Subject: [PATCH 2/2] regen configure --- configure | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 6e578c74d6c8a7..078bb5bef1350c 100755 --- a/configure +++ b/configure @@ -11990,6 +11990,12 @@ else LIBMPDEC_LDFLAGS="-lm \$(LIBMPDEC_A)" LIBMPDEC_INTERNAL="\$(LIBMPDEC_A)" + if test "x$with_pydebug" = xyes; then : + + as_fn_append LIBMPDEC_CFLAGS " -DTEST_COVERAGE" + +fi + fi @@ -12552,12 +12558,6 @@ else have_supported_sqlite3=no - if test "x$with_pydebug" = xyes; then : - - as_fn_append LIBMPDEC_CFLAGS " -DTEST_COVERAGE" - -fi - fi