Bug 146155 - rpmbuild --target ppc64 builds ppc32 binaries
rpmbuild --target ppc64 builds ppc32 binaries
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: rpm (Show other bugs)
3.0
powerpc Linux
medium Severity medium
: ---
: ---
Assigned To: Panu Matilainen
:
Depends On:
Blocks: FC6Target
  Show dependency treegraph
 
Reported: 2005-01-25 13:33 EST by David Lehman
Modified: 2007-11-30 17:07 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-10-19 15:08:47 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description David Lehman 2005-01-25 13:33:28 EST
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):
rpm-4.2.3-13

How reproducible:
Always

Steps to Reproduce:
1. Grab any SRPM for which we ship a ppc64 package (eg: zlib)
2. run rpmbuild --target ppc64 -bb zlib.spec
3.
  
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 17:46:32 EST
Yep.

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 11:08:56 EST
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 11:11:59 EST
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 12:14:50 EST
Do you have the redhat-rpm-config package installed?
Comment 5 David Lehman 2005-01-28 12:28:06 EST
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 12:15:34 EST
Using "setarch" might also help to get the right target setup?
Comment 9 David Woodhouse 2005-10-05 12:12:18 EDT
This is still not working right -- and it means that RHEL and Fedora aren't
self-hosting.

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 12:56:50 EST
I just tried on rawhide

cat /etc/rpm/platform
ppc64pseries-redhat-linux
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 17:15:52 EST
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 18:24:36 EST
OK %_libdir is still busted CFLAGS are correct.
Comment 13 Jeff Johnson 2006-08-06 17:52:29 EDT
This problem is likely fixed (by setting arch from --tqarget) in rpm-4.4.7-0.15

UPSTREAM
Comment 14 RHEL Product and Program Management 2007-10-19 15:08:47 EDT
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:
http://www.redhat.com/security/updates/errata/
 
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.