Bug 132161 - POWER5: default target arch is ppc64series yet no -m64
POWER5: default target arch is ppc64series yet no -m64
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: rpm (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-09-09 10:06 EDT by Joe Orton
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-12-07 22:50:58 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


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

  None (edit)
Description Joe Orton 2004-09-09 10:06:32 EDT
[root@powerv2 root]# cat /etc/rpm/platform
ppc64pseries-redhat-linux
Comment 1 Joe Orton 2004-09-09 10:09:02 EDT
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 10:09:53 EDT
I'll go home now. rpm-4.2.3-10
Comment 3 Jeff Johnson 2004-09-09 11:37:33 EDT
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 11:42:00 EDT
Yup.

$ rpm -q redhat-rpm-config
redhat-rpm-config-8.0.28-2.noarch
Comment 6 Jeff Johnson 2004-09-09 13:53:41 EDT
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 14:34:10 EDT
# 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 15:21:30 EDT
rpm --showrc output please.
Comment 9 Joe Orton 2004-09-09 15:52:48 EDT
Created attachment 103649 [details]
rpm --showrc output
Comment 10 Jeff Johnson 2004-09-17 12:03:35 EDT
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 12:36:58 EST
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 14:41:45 EST
redhat-rpm-config is fixed for future releases.
Comment 13 Jeff Johnson 2004-12-07 22:50:58 EST
"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.

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