Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1795575

Summary: GCC 10 regression: Python 3 fails to build in rawhide ppc64le/armv7hl: Assembler messages: Error: redefined symbol cannot be used on reloc
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 32CC: aoliva, avi.kivity, cstratak, dan, dmalcolm, fweimer, hannsj_uhl, jakub, jwakely, law, m.cyprian, mhroncok, mpolacek, msebor, nickc, pbrobinson, pviktori, rkuska, shcherbina.iryna, sipoyare, slavek.kabrda, tomspur, torsava, vstinner
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://koschei.fedoraproject.org/package/python3
Whiteboard:
Fixed In Version: 10.0.1-0.7.fc32 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-02-28 17:19:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 245418, 1071880, 1779341, 1792464    

Description Miro Hrončok 2020-01-28 11:04:10 UTC
Description of problem:
Packages python3 and python39 fail to build from source in Fedora rawhide on ppc64le and armv7hl:

/builddir/build/BUILD/Python-3.8.1/Python/initconfig.c: In function 'PyConfig_InitPythonConfig':
/builddir/build/BUILD/Python-3.8.1/Python/initconfig.c:636:1: note: the layout of aggregates containing vectors with 8-byte alignment has changed in GCC 5
  636 | PyConfig_InitPythonConfig(PyConfig *config)
      | ^
/tmp/ccJWzJqd.s: Assembler messages:
/tmp/ccJWzJqd.s:79948: Error: redefined symbol cannot be used on reloc
/tmp/ccJWzJqd.s:267764: Error: redefined symbol cannot be used on reloc
lto-wrapper: fatal error: gcc returned 1 exit status

Versions:
3.8.1, 3.9.0a2, 3.9.0a3


The packages are tracked by Koschei. See:
https://koschei.fedoraproject.org/package/python3
https://koschei.fedoraproject.org/package/python39

But note that armv7hl is not tracked there.


This blocks any changes to Python we need to ship. It started to happen after the update of gcc to 10.

Comment 1 Victor Stinner 2020-01-28 12:22:04 UTC
I reported the issue to GCC upstream: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93384

I have been requested for the assembler files, but I failed to reproduce the issue manually on ppc64le.

I created https://src.fedoraproject.org/rpms/python39/pull-request/16 yesterday to check if the bug is still there: yes it is, and not only ppc64le is affected, armv7hl is also affected.

For my manual build, I only copied the configure command. I should retry with the compiler and linker flags used by the specfile.

I also suspect that the bug only occurs on PGO+LTO build.

Comment 2 Dan Horák 2020-01-28 12:24:12 UTC
Could it be related to the new -fno-common default? Does it build with -fcommon added to compiler flags?

Comment 3 Miro Hrončok 2020-01-28 12:35:11 UTC
(In reply to Dan Horák from comment #2)
> Could it be related to the new -fno-common default? Does it build with
> -fcommon added to compiler flags?

Testing...

Comment 4 Miro Hrončok 2020-01-28 12:42:52 UTC
[python39 (390a3 *%)]$ git diff
...
+%global _legacy_common_support 1
+

[python39 (390a3 *%)]$ fedpkg --release master build --nowait --scratch --srpm
...
Building python39-3.9.0~a3-1.fc32.src.rpm for rawhide
Created task: 41132972
Task info: https://koji.fedoraproject.org/koji/taskinfo?taskID=41132972





[python39 (390a3 %)]$ git diff
...
-%bcond_without optimizations
+%bcond_with optimizations

[python39 (390a3 *%)]$ fedpkg --release master build --nowait --scratch --srpm
...
Building python39-3.9.0~a3-1.fc32.src.rpm for rawhide
Created task: 41133107
Task info: https://koji.fedoraproject.org/koji/taskinfo?taskID=41133107

Comment 5 Miro Hrončok 2020-01-28 13:26:24 UTC
(In reply to Miro Hrončok from comment #4)
> [python39 (390a3 *%)]$ git diff
> ...
> +%global _legacy_common_support 1
> +
> 
> [python39 (390a3 *%)]$ fedpkg --release master build --nowait --scratch
> --srpm
> ...
> Building python39-3.9.0~a3-1.fc32.src.rpm for rawhide
> Created task: 41132972
> Task info: https://koji.fedoraproject.org/koji/taskinfo?taskID=41132972

No difference.


> [python39 (390a3 %)]$ git diff
> ...
> -%bcond_without optimizations
> +%bcond_with optimizations
> 
> [python39 (390a3 *%)]$ fedpkg --release master build --nowait --scratch
> --srpm
> ...
> Building python39-3.9.0~a3-1.fc32.src.rpm for rawhide
> Created task: 41133107
> Task info: https://koji.fedoraproject.org/koji/taskinfo?taskID=41133107

Builds fine. As a lost resort, we can temporarily disable optimizations on the affected architectures to unblock ourselves.

Comment 6 Dan Horák 2020-01-28 15:16:17 UTC
I have asked IBM to help with this one. Victor, please attach the temporary files to the upstream bug, so they can look. If you need a ppc64le machine first, let me know.

Comment 7 Victor Stinner 2020-01-28 23:57:01 UTC
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93384 title is now "[10 Regression] Python 3.9.0a3 fails to build on ppc64le with GCC 10.0.1: redefined symbol cannot be used on reloc", so I don't think that it's a Python bug, but it's a GCC regression instead.

I'm discussing the issue at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93384 but you can keep this issue to coordinate the effort in Fedora / at Red Hat if you prefer.

Comment 8 Ben Cotton 2020-02-11 16:37:38 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle.
Changing version to 32.

Comment 9 Miro Hrončok 2020-02-11 20:11:27 UTC
We have a deadline on 25 February to deliver bz1779341. Could you please backport the upstream fix?

Comment 10 Miro Hrončok 2020-02-28 17:12:26 UTC
The deadline is technically over, but we'd still like to ship this for Fedora 32. Please, could you fix this?

Comment 11 Jakub Jelinek 2020-02-28 17:19:50 UTC
It is fixed for almost a month.

Comment 12 Miro Hrončok 2020-02-28 17:31:49 UTC
Excellent. Thanks for letting me know so fast :(