Re: Bug#972202: python3.9: Please build with -O1 on sh4 to temporarily work around GCC bug

John Paul Adrian Glaubitz <[email protected]>
Newsgroups gmane.linux.debian.ports.superh
Message-ID <[email protected]>
Hello!

On 10/14/20 12:15 PM, John Paul Adrian Glaubitz wrote:
> I will try to track down which particular optimization flag causes the miscompilation
> and report the issue to GCC upstream.

Turns out the offending optimization flag is "-finline-small-functions", so this
workaround makes the package build.

diff -Nru old/python3.9-3.9.0/debian/rules new/python3.9-3.9.0/debian/rules
--- old/python3.9-3.9.0/debian/rules    2020-09-03 21:33:00.000000000 +0200
+++ new/python3.9-3.9.0/debian/rules    2020-10-14 22:45:31.423587080 +0200
@@ -170,6 +170,9 @@
 ifeq ($(DEB_HOST_ARCH),ia64)
     EXTRA_OPT_CFLAGS += -O2
 endif
+ifeq ($(DEB_HOST_ARCH),sh4)
+    EXTRA_OPT_CFLAGS += -fno-inline-small-functions
+endif
 ifneq (,$(filter $(DEB_HOST_ARCH), ppc64 ppc64el))
     OPT_CFLAGS += -fexceptions
     DEBUG_CFLAGS += -fexceptions

I will report the issue to gcc upstream.

Adrian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.