Bug 661510

Summary: Building fails on powerpc
Product: [Fedora] Fedora Reporter: Adrian Reber <adrian>
Component: python3Assignee: Dave Malcolm <dmalcolm>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: amcnabb, dmalcolm, tomspur
Target Milestone: ---   
Target Release: ---   
Hardware: powerpc   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-05 23:39:10 UTC Type: ---
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: 121179    

Description Adrian Reber 2010-12-08 21:40:59 UTC
Description of problem:
I am trying to build python3 on a powerpc machine and it failes with:

#error "Don't know how to implement timestamp counter for this architecture"

Version-Release number of selected component (if applicable):
python3-3.2-0.5.a1.fc15

Following in the python3.spec fixes it for me:
sed -i -e "s,__ppc__,__powerpc__,g" Python/ceval.c

In the code there if following comment:

#if defined(__ppc__) /* <- Don't know if this is the correct symbol; this
                           section should work for GCC on any PowerPC
                           platform, irrespective of OS.
                           POWER?  Who knows :-) */

and it seems that is wrong. Looking at the output of the compiler __powerpc__ is defined:

$ gcc -dM -E -x c /tmp/foo.c  | grep powerpc
#define __powerpc__ 1
#define __powerpc 1
#define powerpc 1

Comment 1 Dave Malcolm 2010-12-08 22:11:48 UTC
Thanks for filing this bug report.

What version of gcc is this with?

Comment 2 Adrian Reber 2010-12-08 22:18:10 UTC
This is with the version from rawhide

gcc                    ppc    4.5.1-6.fc12              local             11 M

built in a f12 mock chroot.

Comment 3 Adrian Reber 2010-12-09 12:50:37 UTC
See upstream bug tracker for a patch I had to include in the python 2.7 and 3.2 package to make it build.

Comment 4 Adrian Reber 2010-12-26 08:50:05 UTC
Can the patch I posted on the upstream bug tracker be included?

Comment 6 Adrian Reber 2011-01-06 10:50:09 UTC
Thanks!

python3 build was also successful on ppc:

http://ppc.koji.fedoraproject.org/koji/taskinfo?taskID=115655

Could you also apply the same patch to python-2.7?

http://ppc.koji.fedoraproject.org/koji/taskinfo?taskID=115657

Or should I open a new bug?

Comment 7 Dave Malcolm 2011-01-06 16:34:25 UTC
(In reply to comment #6)
> python3 build was also successful on ppc:
> 
> http://ppc.koji.fedoraproject.org/koji/taskinfo?taskID=115655

Thanks for the feedback.

> Could you also apply the same patch to python-2.7?
> 
> http://ppc.koji.fedoraproject.org/koji/taskinfo?taskID=115657

Sure.

> Or should I open a new bug?
No need; I've applied it to the "python" package:

 Building python-2.7.1-2.fc15 for dist-rawhide
 Task info: http://koji.fedoraproject.org/koji/taskinfo?taskID=2705263