Issue 10655: Wrong powerpc define in Python/ceval.c (original) (raw)

Created on 2010-12-08 21:50 by adrian, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (11)
msg123652 - (view) Author: Adrian Reber (adrian) Date: 2010-12-08 21:50
In Python/ceval.c is following line: #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 :-) */ which seems wrong and aborts the build on powerpc. Changing it to __powerpc__ fixes it for me. The following output of gcc confirms it: $ gcc -dM -E -x c /tmp/foo.c | grep powerpc #define __powerpc__ 1 #define __powerpc 1 #define powerpc 1 Whereas there are no defines containing "ppc"
msg123653 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-12-08 21:57
How about accepting either of these symbols? Do you want to provide a patch?
msg123656 - (view) Author: Dave Malcolm (dmalcolm) (Python committer) Date: 2010-12-08 22:13
What version of the compiler was this with? (For reference, I see that you also filed this downstream in Fedora's bug tracker as: https://bugzilla.redhat.com/show_bug.cgi?id=661510 )
msg123660 - (view) Author: Dave Malcolm (dmalcolm) (Python committer) Date: 2010-12-08 23:06
One of RH's gcc gurus told me in IRC that: __ppc__ is not a standard powerpc*-linux macro __PPC__ or __powerpc__ is
msg123661 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-12-08 23:23
Le mercredi 08 décembre 2010 à 23:06 +0000, Dave Malcolm a écrit : > Dave Malcolm <dmalcolm@redhat.com> added the comment: > > One of RH's gcc gurus told me in IRC that: > __ppc__ is not a standard powerpc*-linux macro > __PPC__ or __powerpc__ is Keep in mind that we have currently working PPC buildbots (under OS X).
msg123679 - (view) Author: Adrian Reber (adrian) Date: 2010-12-09 12:48
Here is a patch that I had to include in my Linux PowerPC build of 2.7 and 3.2 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -31,10 +31,12 @@ typedef unsigned long long uint64; -#if defined(__ppc__) /* <- Don't know if this is the correct symbol; this +#if defined(__ppc__) | defined (__powerpc__) /* <- 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 :-) */ + POWER? Who knows :-) + __powerpc__ is necessary for Linux */ #define READ_TIMESTAMP(var) ppc_getcounter(&var)
msg125479 - (view) Author: Dave Malcolm (dmalcolm) (Python committer) Date: 2011-01-05 23:40
FWIW, I just added this patch downstream to Fedora's python 3 builds: http://pkgs.fedoraproject.org/gitweb/?p=python3.git;a=blob_plain;f=python-3.2b2-fix-ppc-debug-build.patch;hb=5659c63442be2e91eb42e60284d7a9a9ab0b80dd
msg125480 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-01-05 23:41
> FWIW, I just added this patch downstream to Fedora's python 3 builds: > http://pkgs.fedoraproject.org/gitweb/?p=python3.git;a=blob_plain;f=python-3.2b2-fix-ppc-debug-build.patch;hb=5659c63442be2e91eb42e60284d7a9a9ab0b80dd Any reason not to commit it here?
msg125565 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-01-06 16:49
Issue5369 is a duplicate with the same patch. Dave, can you apply?
msg125567 - (view) Author: Dave Malcolm (dmalcolm) (Python committer) Date: 2011-01-06 17:04
Adrian verified in the downstream bug tracker that this fixed the build for him (and the logs show it successfully ran the test suite), so I committed my patch to py3k as r87796.
msg125572 - (view) Author: Dave Malcolm (dmalcolm) (Python committer) Date: 2011-01-06 17:39
Merged back to 3.1 as r87800 and to 2.7-maint as r87801
History
Date User Action Args
2022-04-11 14:57:10 admin set github: 54864
2011-01-06 17:39:58 dmalcolm set status: open -> closednosy:pitrou, dmalcolm, adrianmessages: + resolution: fixedstage: resolved
2011-01-06 17:04:09 dmalcolm set nosy:pitrou, dmalcolm, adrianmessages: +
2011-01-06 16:49:23 pitrou set assignee: dmalcolmmessages: + nosy:pitrou, dmalcolm, adrian
2011-01-06 16:48:34 pitrou link issue5369 superseder
2011-01-05 23:41:22 pitrou set nosy:pitrou, dmalcolm, adrianmessages: +
2011-01-05 23:40:25 dmalcolm set nosy:pitrou, dmalcolm, adrianmessages: +
2010-12-09 12:48:33 adrian set messages: +
2010-12-08 23:23:54 pitrou set messages: +
2010-12-08 23:06:55 dmalcolm set messages: +
2010-12-08 22:13:22 dmalcolm set nosy: + dmalcolmmessages: +
2010-12-08 21:57:41 pitrou set nosy: + pitroumessages: + versions: + Python 2.7, Python 3.2
2010-12-08 21:50:25 adrian create