greenlet 3.0.3 fails to build on ppc64el (and riscv64)

Bug #2060108 reported by Frank Heimes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
The Ubuntu-power-systems project
Triaged
Undecided
bugproxy
greenlet
New
Unknown
python-greenlet (Ubuntu)
New
Undecided
bugproxy

Bug Description

greenlet 3.0.3 fails to build on riscv64 and ppc64el:

complete build logs at
https://launchpad.net/ubuntu/+source/python-greenlet/3.0.3-0ubuntu2

riscv64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -fno-omit-frame-pointer -ffile-prefix-map=/<>=. -fstack-protector-strong -Wformat -Werror=format-security -fdebug-prefix-map=/<>=/usr/src/python-greenlet-3.0.3-0ubuntu2 -Wdate-time -D_FORTIFY_SOURCE=3 -fPIC -I/usr/include/python3.11 -c /<>/src/greenlet/greenlet.cpp -o build/temp.linux-riscv64-cpython-311/<>/src/greenlet/greenlet.o -Os

So the reason is that recent Linux distros decided to build with -fno-omit-frame-pointer by default. Apparently both the riscv64 and the ppc64el implementations cannot cope with that.

The issue can be reproduce by adding -fno-omit-frame-pointer to the build flags.

https://launchpad.net/ubuntu/+source/python-greenlet/3.0.3-0ubuntu4
_____

There is also this upstream github issue:
https://github.com/python-greenlet/greenlet/issues/395

Frank Heimes (fheimes)
description: updated
tags: added: reverse-proxy-bugzilla
description: updated
Changed in greenlet:
status: Unknown → New
Frank Heimes (fheimes)
Changed in python-greenlet (Ubuntu):
assignee: nobody → bugproxy (bugproxy)
bugproxy (bugproxy)
tags: added: architecture-all bugnameltc-206019 severity-medium targetmilestone-inin---
Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2024-04-09 11:22 EDT-------
According to https://github.com/python-greenlet/greenlet/issues/395 this is the source with asm affected:

https://github.com/python-greenlet/greenlet/blob/master/src/greenlet/platform/switch_ppc64_linux.h

It is likely that r31 is reserved when the frame pointer is required.

Adding one of the powerpc toolchain developers to confirm.

tags: added: architecture-ppc64le
removed: architecture-all
Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2024-04-09 12:50 EDT-------
(In reply to comment #4)
> According to https://github.com/python-greenlet/greenlet/issues/395 this is
> the source with asm affected:
>
> https://github.com/python-greenlet/greenlet/blob/master/src/greenlet/
> platform/switch_ppc64_linux.h
>
> It is likely that r31 is reserved when the frame pointer is required.
>
> Adding one of the powerpc toolchain developers to confirm.

I've asked in the upstream issue for the preprocessed source file that I can recreate and debug with.

Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2024-04-09 13:07 EDT-------
(In reply to comment #5)
> I've asked in the upstream issue for the preprocessed source file that I can
> recreate and debug with.

I was able to create a small reproducer myself. I'll have a look.

Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2024-04-09 22:30 EDT-------
I opened an external GCC bug to track this.

https://gcc.gnu.org/PR114664

Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2024-04-10 10:18 EDT-------
The consensus in the GCC bugzilla is that the inline asm used in greenlet is itself buggy and this is not a compiler bug. A different solution to their inline asm will need to be used.

Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2024-04-10 10:36 EDT-------
May I ask why the distro build is forcing the use of -fno-omit-frame-pointer on ppc64le? It just leads to less efficient code on ppc64le.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.