RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 649023 - python-devel on ppc64 requires "-m64" on gcc command line
Summary: python-devel on ppc64 requires "-m64" on gcc command line
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python
Version: 6.0
Hardware: ppc64
OS: Unspecified
low
medium
Target Milestone: rc
: ---
Assignee: Dave Malcolm
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-02 19:02 UTC by Dave Malcolm
Modified: 2010-11-04 18:57 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-11-02 21:24:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Dave Malcolm 2010-11-02 19:02:50 UTC
Description of problem:
  $ rpm -q python python-libs python-devel gcc
  python-2.6.5-3.el6.ppc64
  python-libs-2.6.5-3.el6.ppc64
  python-libs-2.6.5-3.el6.ppc
  python-devel-2.6.5-3.el6.ppc64
  gcc-4.4.4-13.el6.ppc64

  $ cat test.c
  #include <Python.h>
  int main() {  return 0; }

Compiles OK on ppc64 with "-m64":
  $ gcc -m64 -I/usr/include/python2.6 test.c
  $ echo $?
  0

Fails without "-m64":
  $ gcc -I/usr/include/python2.6 test.c
  In file included from /usr/include/python2.6/Python.h:8,
                   from test.c:1:
  /usr/include/python2.6/pyconfig.h:4:25: error: pyconfig-32.h: No such file or directory

Version-Release number of selected component (if applicable):
  python-2.6.5-3.el6.ppc64
  python-libs-2.6.5-3.el6.ppc64
  python-libs-2.6.5-3.el6.ppc
  python-devel-2.6.5-3.el6.ppc64
  gcc-4.4.4-13.el6.ppc64
  glibc-headers-2.12-1.7.el6_0.3.ppc64

How reproducible:
100%

Steps to Reproduce:
As above
  
Additional info:
pyconfig.h is a downstream-modified copy in our RPMs:

#include <bits/wordsize.h>

#if __WORDSIZE == 32
#include "pyconfig-32.h"
#elif __WORDSIZE == 64
#include "pyconfig-64.h"
#else
#error "Unknown word size"
#endif


glibc-headers-2.12-1.7.el6_0.3.ppc64's /usr/include/bits/wordsize.h begins:
/* Determine the wordsize from the preprocessor defines.  */

#if defined __powerpc64__
# define __WORDSIZE	64
# define __WORDSIZE_COMPAT32	1
#else
# define __WORDSIZE	32
#endif

and this is coming out as "32" on ppc64 without -m64

Comment 2 Dave Malcolm 2010-11-02 19:29:09 UTC
$ rpm -qf /usr/lib/python2.6/config/Makefile
python-2.6.5-3.el6.ppc

/usr/lib/python2.6/config/Makefile has:
OPT=            -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -D_GNU_SOURCE -fPIC -fwrapv
BASECFLAGS=      -fno-strict-aliasing
CFLAGS=         $(BASECFLAGS) $(OPT) $(EXTRA_CFLAGS)

$ rpm -qf /usr/lib64/python2.6/config/Makefile
python-2.6.5-3.el6.ppc64

whereas /usr/lib64/python2.6/config/Makefile has:

OPT=            -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mminimal-toc -D_GNU_SOURCE -fPIC -fwrapv
BASECFLAGS=      -fno-strict-aliasing
CFLAGS=         $(BASECFLAGS) $(OPT) $(EXTRA_CFLAGS)

So a module using:
  distutils.sysconfig.get_config_vars("CFLAGS")
will work, but one using "BASECFLAGS" will fail on ppc64, unless "-m64" also is used (e.g. by setting CFLAGS).

It looks like rpmbuild on pp64 sets CFLAGS to a value that includes "-m64", so in theory this shouldn't be a problem.

Comment 4 Dave Malcolm 2010-11-02 19:40:26 UTC
Looks similar to bug 647413 (though that's python26.x86_64 on EPEL5)

Comment 7 Dave Malcolm 2010-11-02 21:22:22 UTC
We split pyconfig.h into pyconfig-32.h and pyconfig-64.h in order to allow both to be installed on 64-bit boxes (see bug 139911 and bug 192747).

We are relying on #include <bits/wordsize.h> setting __WORDSIZE to 32 or 64 as appropriate.  On ppc64 it appears that gcc requires -m64 to be passed on the command line, but I don't see a workaround for that without breaking the fix for bug 139911).

If there's a specific build scenario in which this fails, please open a bug.

Comment 8 RHEL Program Management 2010-11-02 21:24:58 UTC
Development Management has reviewed and declined this request.  You may appeal
this decision by reopening this request.


Note You need to log in before you can comment on or make changes to this bug.