Bug 132161 - POWER5: default target arch is ppc64series yet no -m64
Summary: POWER5: default target arch is ppc64series yet no -m64
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: rpm   
(Show other bugs)
Version: 3.0
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact: Mike McLean
Depends On:
TreeView+ depends on / blocked
Reported: 2004-09-09 14:06 UTC by Joe Orton
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-12-08 03:50:58 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
rpm --showrc output (20.31 KB, text/plain)
2004-09-09 19:52 UTC, Joe Orton
no flags Details

Description Joe Orton 2004-09-09 14:06:32 UTC
[root@powerv2 root]# cat /etc/rpm/platform

Comment 1 Joe Orton 2004-09-09 14:09:02 UTC
Gee, good bug report wot?  RPM_OPT_FLAGS does not contain -m64 so
.ppc64pseries. RPMs are built which actually contain 32-bit binaries.



rpmbuild --rebuild foo.spec:

+ umask 022
+ cd /usr/src/redhat/BUILD
+ export LANG
+ unset DISPLAY
+ echo -O2
+ exit 0

actually the same is true if using --target ppc64.

Comment 2 Joe Orton 2004-09-09 14:09:53 UTC
I'll go home now. rpm-4.2.3-10

Comment 3 Jeff Johnson 2004-09-09 15:37:33 UTC
Do you have redhat-rpm-config installed?

Invocation from the CLI with --target ppc64 may have problems
bootstrapping through config files, certain macros need to
be set so that the correct files are found.

Comment 4 Joe Orton 2004-09-09 15:42:00 UTC

$ rpm -q redhat-rpm-config

Comment 6 Jeff Johnson 2004-09-09 17:53:41 UTC
Can you supply a specific reproducer? What ends up
being configured is quite complex because of the
config inheiritance.

And the core issue is that rpm -- by design -- implicitly
assumes one arch per build system, which is a very very
different model than what is now in gcc tool chains with
the addition of -m64 to gcc.

Read: --target is no longer close to being correct any more,
because config bootstrapping has a %{_target} evaluation
in file paths during configuration.

Comment 7 Joe Orton 2004-09-09 18:34:10 UTC
# cd /var/spool/up2date
# up2date --get-source gawk
# rpmbuild --rebuild gawk*.src.rpm
Requires: /bin/mktemp /bin/sh libc.so.6 libc.so.6(GLIBC_2.0)
libc.so.6(GLIBC_2.1) libc.so.6(GLIBC_2.2) libc.so.6(GLIBC_2.3)
libdl.so.2 libdl.so.2(GLIBC_2.0) libdl.so.2(GLIBC_2.1) libm.so.6

... i.e. not a 64-bit build

Processing files: gawk-debuginfo-3.1.1-9
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Checking for unpackaged file(s): /usr/lib/rpm/check-files
Wrote: /usr/src/redhat/RPMS/ppc64pseries/gawk-3.1.1-9.ppc64pseries.rpm

... but still marked as such.

Comment 8 Jeff Johnson 2004-09-09 19:21:30 UTC
rpm --showrc output please.

Comment 9 Joe Orton 2004-09-09 19:52:48 UTC
Created attachment 103649 [details]
rpm --showrc output

Comment 10 Jeff Johnson 2004-09-17 16:03:35 UTC
OK, here's a reproducer for what is happening:
  echo "ppc64pseries-redhat-linux" > /etc/rpm/platform
  echo "ppc64pseries-redhat-linux"
  rpm --showrc | grep '^optflags'
  echo "ppc64-redhat-linux" > /etc/rpm/platform
  echo "ppc64-redhat-linux"
  rpm --showrc | grep '^optflags'

which produces the following output:
  bash$ sudo sh /tmp/22
  optflags              : -O2
  optflags              : %{__global_cflags} -fsigned-char -mminimal-toc

So redhat-rpm-config is choosing to embed -m64 in a macro
  optflags              : %{__global_cflags} -fsigned-char -mminimal-toc
  -14: __global_cflags    -O2 -g -pipe

And the macro is being loaded from a macrofiles: directive (from

that includes %{_target} in the path to pick up per-arch configuration
(should be from /usr/lib/rpm/redhat/ppc64pseries-redhat-linux/macros
but perhaps does not exist)

    rpm --predefine '_target_cpu ppc64' --showrc | grep '^optflags'
display the same output as (run on ppc64 or equivalently, with
ppc64-redhat-linux in /etc/rpm/platform)
    rpm --showrc | grep '^optflags'

No matter what, since the macrofiles: directive that is used to define
the path from which %__global_cflags is read and set resides in
/usr/lib/rpm/redhat/rpmrc which is contained in the redhat-rpm-config
package, I'm reassigning this problem there.

But yes, the above mechanism is horrendously complicated goo
that is way too complicated to maintain and debug for a simple
operation like adding -m64 to CFLAGS. That is a deeply complicated
rpm roadmap issue, and perhaps different than this bug.

Comment 11 Elliot Lee 2004-11-24 17:36:58 UTC
So there are two issues here:

redhat-rpm-config doesn't contain entries for some of the less common

rpmbuild is defaulting to ppc64pseries as a build arch, when it should
probably be 'ppc64' or 'ppc' even on a ppc64pseries system.

Comment 12 Elliot Lee 2004-12-03 19:41:45 UTC
redhat-rpm-config is fixed for future releases.

Comment 13 Jeff Johnson 2004-12-08 03:50:58 UTC
"Should be" is not consistent with "stable rpm", rpm
does exactly what it has always done wrto arch, and will
continue to do so in the interest of "stable".


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