]> git.feebdaed.xyz Git - 0xmirror/buildroot.git/commit
package/python3: work around GCC bug 121567
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sat, 16 Aug 2025 09:15:12 +0000 (11:15 +0200)
committerJulien Olivain <ju.o@free.fr>
Sun, 24 Aug 2025 10:29:30 +0000 (12:29 +0200)
commita68899d49ec4c7f97dea0dcb9995e6a5d7b282c9
treead747f5ef895175121a3c0f4da7990d7744341de
parent1838d8e5ea7e5c3497cefc16980da330c38e7967
package/python3: work around GCC bug 121567

When Python 3 is built with -O2 or -O3 on SuperH, the build fails
with:

Objects/obmalloc.c:503:1: error: unable to find a register to spill in class ‘R0_REGS’
  503 | }
      | ^
Objects/obmalloc.c:503:1: error: this is the insn:
(insn 18 243 23 2 (parallel [
            (set (subreg:SI (reg:QI 176) 0)
                (unspec_volatile:SI [
                        (mem/v:QI (reg:SI 4 r4 [175]) [-1  S1 A32])
                        (reg:QI 7 r7 [178])
                        (reg:QI 6 r6 [180])
                    ] UNSPECV_CMPXCHG_1))
            (set (mem/v:QI (reg:SI 4 r4 [175]) [-1  S1 A32])
                (unspec_volatile:QI [
                        (const_int 0 [0])
                    ] UNSPECV_CMPXCHG_2))
            (set (reg:SI 147 t)
                (unspec_volatile:SI [
                        (const_int 0 [0])
                    ] UNSPECV_CMPXCHG_3))
            (clobber (scratch:SI))
            (clobber (reg:SI 0 r0))
            (clobber (reg:SI 1 r1))
        ]) "./Include/cpython/pyatomic_gcc.h":105:10 407 {atomic_compare_and_swapqi_soft_gusa}
     (expr_list:REG_DEAD (reg:QI 6 r6 [180])
        (expr_list:REG_DEAD (reg:QI 7 r7 [178])
            (expr_list:REG_UNUSED (reg:QI 176)
                (expr_list:REG_UNUSED (reg:SI 1 r1)
                    (expr_list:REG_UNUSED (reg:SI 0 r0)
                        (nil)))))))
Objects/obmalloc.c:503: confused by earlier errors, bailing out

THe bug has been reported upstream, but until it gets fixed, let's
work it around by using -O1 instead. Note that
BR2_TOOLCHAIN_HAS_GCC_BUG_121567 is only set when -O2 or -O3 is
configured, so there's no need to check again.

Fixes:

  https://autobuild.buildroot.net/results/cac123ee9f3a6df6263b69dce3ac0d535518ec3f/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Julien Olivain <ju.o@free.fr>
package/python3/python3.mk