Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 146155 - rpmbuild --target ppc64 builds ppc32 binaries
Summary: rpmbuild --target ppc64 builds ppc32 binaries
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: rpm
Version: 3.0
Hardware: powerpc
OS: Linux
Target Milestone: ---
Assignee: Panu Matilainen
QA Contact:
Depends On:
Blocks: FC6Target
TreeView+ depends on / blocked
Reported: 2005-01-25 18:33 UTC by David Lehman
Modified: 2007-11-30 22:07 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2007-10-19 19:08:47 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description David Lehman 2005-01-25 18:33:28 UTC
Description of problem:
Running rpmbuild --target ppc64 builds ppc32 objects but puts them in /lib64 and
calls the rpm a .ppc64.rpm. I seems CFLAGS and/or RPM_OPT_FLAGS are not being
set correctly.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Grab any SRPM for which we ship a ppc64 package (eg: zlib)
2. run rpmbuild --target ppc64 -bb zlib.spec
Actual results:
rpmbuild creates a .ppc64.rpm containing 32-bit libraries in /usr/lib64

Expected results:
If it builds a ppc64 package the package should contain 64-bit objects

Additional info:
'CC="gcc -m64" rpmbuild --target ppc64 -bb zlib.spec' seems to work.

Comment 1 Jeff Johnson 2005-01-25 22:46:32 UTC

Edit /etc/rpm/platform, substitute s/ppc/ppc64/, as
work around.

NEEDINFO until feature is prioritized, as rpmbuild has
never promised the ability for multi-arch builds by
(original, but now creaky) design.

Comment 2 David Lehman 2005-01-27 16:08:56 UTC
That doesn't do it for me. My /etc/rpm/platform already had something
like ppc64pseries-redhat-linux in it, so rpm more or less knew it was
a 64-bit platform. The problem is that even
/usr/lib/rpm/ppc64-redhat-linux/macros doesn't include -m64 in
optflags, which AFAICT is absolutely needed to get 64-bit binaries on
ppc64 RHEL.

Adding it fixes most packages, but not all. Certainly in some of those
cases it's because the package blindly does things like 'gcc -shared ...'

Comment 3 David Lehman 2005-01-27 16:11:59 UTC
THe first sentence of the last paragraph from Comment 2 should read:
  "Adding -m64 to optflags fixes most packages, but not all"

Comment 4 Jeff Johnson 2005-01-28 17:14:50 UTC
Do you have the redhat-rpm-config package installed?

Comment 5 David Lehman 2005-01-28 17:28:06 UTC
Yes, I reinstalled the box when I started on this issue and made sure
to include all the architecture compatibility comps. At some point I
got curious and verified the install included redhat-rpm-config-8.0.28-2.

Comment 6 Florian La Roche 2005-01-30 17:15:34 UTC
Using "setarch" might also help to get the right target setup?

Comment 9 David Woodhouse 2005-10-05 16:12:18 UTC
This is still not working right -- and it means that RHEL and Fedora aren't

We should at least put -m64 into ppc64 optflags, I think -- {how,} does this
work for i386 vs. x86_64? 

Comment 10 Paul Nasrat 2006-02-21 17:56:50 UTC
I just tried on rawhide

cat /etc/rpm/platform
rpm -E '%optflags'
rpm -ivh /mnt/redhat/rawhide-ppc/SRPMS/bc-1.06-19.2.1.src.rpm
rpmbuild --target ppc64 bc.spec
cd ../BUILD/bc-1.06/bc
bc: ELF 64-bit MSB executable, cisco 7500, version 1 (SYSV), for GNU/Linux
2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped

Comment 11 Manoj Iyer 2006-03-01 22:15:52 UTC
I tried on rawhide 
[root@dhcp78-22 SPECS]# cat /etc/issue
Fedora Core release 4.92 (Pre-FC5)
Kernel \r on an \m
[root@dhcp78-22 SPECS]#

[root@dhcp78-22 SPECS]# rpmbuild  -bb --target ppc64 ./bc.spec

[root@dhcp78-22 SPECS]# file ../BUILD/bc-1.06/bc/bc
../BUILD/bc-1.06/bc/bc: ELF 64-bit MSB executable, cisco 7500, version 1 (SYSV),
for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9,
not stripped
[root@dhcp78-22 SPECS]#

Also, tried with --target ppc to build 32bit binaries...

[root@dhcp78-22 SPECS]# rpmbuild  -bb --target ppc ./tar.spec

[root@dhcp78-22 SPECS]# file ../BUILD/tar-1.15.1/src/tar
../BUILD/tar-1.15.1/src/tar: ELF 32-bit MSB executable, PowerPC or cisco 4500,
version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs),
for GNU/Linux 2.6.9, not stripped
[root@dhcp78-22 SPECS]#

Comment 12 Paul Nasrat 2006-03-03 23:24:36 UTC
OK %_libdir is still busted CFLAGS are correct.

Comment 13 Jeff Johnson 2006-08-06 21:52:29 UTC
This problem is likely fixed (by setting arch from --tqarget) in rpm-4.4.7-0.15


Comment 14 RHEL Product and Program Management 2007-10-19 19:08:47 UTC
This bug is filed against RHEL 3, which is in maintenance phase.
During the maintenance phase, only security errata and select mission
critical bug fixes will be released for enterprise products. Since
this bug does not meet that criteria, it is now being closed.
For more information of the RHEL errata support policy, please visit:
If you feel this bug is indeed mission critical, please contact your
support representative. You may be asked to provide detailed
information on how this bug is affecting you.

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