Bug 132161

Summary: POWER5: default target arch is ppc64series yet no -m64
Product: Red Hat Enterprise Linux 3 Reporter: Joe Orton <jorton>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED WONTFIX QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0CC: nobody+pnasrat
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-12-08 03:50:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
rpm --showrc output none

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

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.

e.g.

%prep
echo $RPM_OPT_FLAGS

rpmbuild --rebuild foo.spec:

+ umask 022
+ cd /usr/src/redhat/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ echo -O2
-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
Yup.

$ rpm -q redhat-rpm-config
redhat-rpm-config-8.0.28-2.noarch


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
libm.so.6(GLIBC_2.0)

... 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
/var/tmp/gawk-root
Wrote: /usr/src/redhat/RPMS/ppc64pseries/gawk-3.1.1-9.ppc64pseries.rpm
Wrote:
/usr/src/redhat/RPMS/ppc64pseries/gawk-debuginfo-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:
  #!/bin/sh
 
  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
  ppc64pseries-redhat-linux
  optflags              : -O2
  ppc64-redhat-linux
  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
/usr/lib/rpm/redhat/rpmrc)

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)

Does
    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
arches.

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".

Hence, WONTFIX.