Source: python3.13
Version: 3.13.0-2
Severity: important
Tags: ftbfs patch
X-Debbugs-Cc: debian-sup...@lists.debian.org, debian-h...@lists.debian.org

This patch does several things:


1. Use EXTRA_OPT_CFLAGS again

It seems this broke in 3.12.2-5:
https://salsa.debian.org/cpython-team/python3/-/commit/5e66301cb668a50e147e5a4c07e7ff69a2b6f58c


2. -fno-inline-small-functions was no longer passed on hppa/sh4

-fno-inline-small-functions was no longer passed on hppa (porters CC'ed)
and sh4 due to 1., and apparently noone noticed.

I'm removing it instead of re-adding it with the fix for 1.,
please speak up if it is still desirable.


3. Workaround sh4 FTBFS with -Os

-fno-inline-small-functions or -O2 do not fix the build,
-Os as workaround works for me.


4. noopt builds are again using -O0

noopt was broken by 1., fixed by this patch.


5. LTO builds are again using LTO

LTO was broken by 1., fixed by this patch.




--- debian/rules.old    2024-11-16 18:54:40.023658886 +0000
+++ debian/rules        2024-11-16 17:07:20.575372748 +0000
@@ -189,9 +189,9 @@
     DPKG_CPPFLAGS += -DWITH_PYMALLOC_RADIX_TREE=0
     DPKG_PIE_CPPFLAGS += -DWITH_PYMALLOC_RADIX_TREE=0
 endif
-# see #972202, and https://gcc.gnu.org/PR97431
-ifneq (,$(filter $(DEB_HOST_ARCH), hppa sh4))
-    EXTRA_OPT_CFLAGS += -fno-inline-small-functions
+# see https://gcc.gnu.org/PR81426
+ifneq (,$(filter $(DEB_HOST_ARCH), sh4))
+    EXTRA_OPT_CFLAGS += -Os
 endif
 ifneq (,$(filter $(DEB_HOST_ARCH), ppc64 ppc64el))
     OPT_CFLAGS += -fexceptions
@@ -395,7 +395,7 @@
        mkdir -p $(buildd_shared)
        cd $(buildd_shared) && \
          AR="$(AR)" RANLIB="$(RANLIB)" \
-         CFLAGS_NODIST="$(DPKG_CPPFLAGS) $(OPT_CFLAGS)" \
+         CFLAGS_NODIST="$(DPKG_CPPFLAGS) $(OPT_CFLAGS) $(EXTRA_OPT_CFLAGS)" \
          LDFLAGS_NODIST="$(DPKG_LDFLAGS) $(LTO_CFLAGS)" \
            $(config_site) \
            ../configure \
@@ -438,7 +438,7 @@
        mkdir -p $(buildd_static)
        cd $(buildd_static) && \
          AR="$(AR)" RANLIB="$(RANLIB)" \
-         CFLAGS_NODIST="$(DPKG_PIE_CPPFLAGS) $(OPT_PIE_CFLAGS)" \
+         CFLAGS_NODIST="$(DPKG_PIE_CPPFLAGS) $(OPT_PIE_CFLAGS) 
$(EXTRA_OPT_CFLAGS)" \
          LDFLAGS_NODIST="$(DPKG_PIE_LDFLAGS) $(LTO_CFLAGS)" \
            $(config_site) \
            ../configure \
@@ -452,7 +452,7 @@
        mkdir -p $(buildd_nopie)
        cd $(buildd_nopie) && \
          AR="$(AR)" RANLIB="$(RANLIB)" \
-         CFLAGS_NODIST="$(DPKG_CPPFLAGS) $(OPT_CFLAGS)" \
+         CFLAGS_NODIST="$(DPKG_CPPFLAGS) $(OPT_CFLAGS) $(EXTRA_OPT_CFLAGS)" \
          LDFLAGS_NODIST="$(DPKG_LDFLAGS) $(LTO_CFLAGS)" \
            $(config_site) \
            ../configure \
@@ -481,7 +481,7 @@
        mkdir -p $(buildd_debug)
        cd $(buildd_debug) && \
          AR="$(AR)" RANLIB="$(RANLIB)" \
-         CFLAGS_NODIST="$(DPKG_CPPFLAGS) $(DEBUG_CFLAGS)" \
+         CFLAGS_NODIST="$(DPKG_CPPFLAGS) $(DEBUG_CFLAGS) $(EXTRA_OPT_CFLAGS)" \
          LDFLAGS_NODIST="$(DPKG_LDFLAGS)" \
            $(config_site) \
            ../configure \
@@ -507,7 +507,7 @@
        mkdir -p $(buildd_shdebug)
        cd $(buildd_shdebug) && \
          AR="$(AR)" RANLIB="$(RANLIB)" \
-         CFLAGS_NODIST="$(DPKG_CPPFLAGS) $(DEBUG_CFLAGS)" \
+         CFLAGS_NODIST="$(DPKG_CPPFLAGS) $(DEBUG_CFLAGS) $(EXTRA_OPT_CFLAGS)" \
          LDFLAGS_NODIST="$(DPKG_LDFLAGS)" \
            $(config_site) \
            ../configure \

Reply via email to