Bug 197743 - Kernel rpm fails to build on s390X
Kernel rpm fails to build on s390X
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
s390x Linux
medium Severity medium
: ---
: 4.9
Assigned To: Jan Glauber
Red Hat Kernel QE team
Depends On:
Blocks: 229565 231464
  Show dependency treegraph
Reported: 2006-07-05 17:49 EDT by Mike Gahagan
Modified: 2009-12-10 17:03 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-12-10 17:03:49 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Mike Gahagan 2006-07-05 17:49:06 EDT
Description of problem:

Kernel build fails on both 2.6.9-34 and 2.6.9-34.0.2.

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

How reproducible:

Steps to Reproduce:
1.Install kernel .src.rpm
2.try and build with rpmbuild --target=s390x -bb kernel2.6.spec
Actual results:

Build fails due to missing arch/s390x/Makefile. arch/s390x does not exist in the
source tree.
+ make -s mrproper
/usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9/arch/s390x/Makefile: No such file
or directory
make: *** No rule to make target
`/usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9/arch/s390x/Makefile'.  Stop.
error: Bad exit status from /var/tmp/rpm-tmp.61319 (%build)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.61319 (%build)

Expected results:

Kernel rpm builds sucessfully as it does on s390.

Additional info:
Comment 1 James Laska 2006-07-06 09:43:19 EDT
Build logs from beehive show that it works:


Now we just need to find what special sauce it's using to perform the build:

Building target platforms: s390x
Building for target s390x

The build log doesn't show the exact invocation, but the build log suggests that
it is executing something of the form ...

$ s390x rpmbuild --rebuild --target s390x kernel.src.rpm
Comment 2 Mike McLean 2006-07-06 11:57:46 EDT
If I try the submitter's commands in a beehive s390x buildroot, the error does
not repeat.

This could be a problem with the build host. Is it possible that the host was
running the s390 product instead of s390x?

Is is possible that there was a non-matching copy of kernel-2.6.spec in the
user's CWD that rpm picked up instead of the one installed under SPECS?
Comment 3 Pete Zaitcev 2006-07-06 13:44:48 EDT
Yeah, --target does not work. I used to support it back on 2.4 kernel,
but with Beehive there really wasn't a need to do it, so it wasn't
carried forward. If you look into the RHEL-3 branch, you can find the
file "linux-2.4.20-s390-make390x.patch", for your entertainment.

The bottom line is, you have to build on the same architecture.
Comment 4 Jason Baron 2006-07-07 13:28:46 EDT
Mike Gahagan, can you comfirm that the build on on s390? i'd like to close this
as notabug.
Comment 5 Jeff Burke 2006-07-07 13:55:38 EDT
Jason see below email thread:

Jeff Burke Wrote:
 Not sure if I am missing something but I assumed that because the
errata machine name was s390x-4as.z900.redhat.com and it was running
this kernel - uname -a "Linux s390x-4as.z900.redhat.com 2.6.9-34.0.2.EL
#1 SMP Fri Jun 30 10:24:28 EDT 2006 s390x s390x s390x GNU/Linux"
That I would be able to build the s390x kernel on that system.

Pete Zaitcev Wrote:
 This seems like a bug with explicit --target. I wanted to have a look,
but s390x-4as.z900.redhat.com does not seem to accept ssh connections.
Do we have a public access guest anywhere?

Jay Turner Wrote:
 That host should be up and running again.

Pete can you please see if you can get into that system again.
Comment 6 Mike Gahagan 2006-07-10 13:32:18 EDT
Setting to needinfo while I await availability of another 64-bit guest to
replicate the problem on.
Comment 7 Pete Zaitcev 2006-07-11 23:21:52 EDT
The culprit is .bashrc on s390x-4as.z900. It contains:


This must be a part of QA setup. If export is commented, rpmbuild -bb
--target=s390x proceeds as expected.

Why does this happen? Well, the kernel Makefile normalizes SUBARCH, not ARCH.
Once that is done, it assignes SUBARCH to ARCH, but only if ARCH was not set.
This is done for those who want to override ARCH, e.g. users of UML.

Writers of the spec (e.g. Arjan) apparently believed that setting the
architecture in the .config is sufficient for every make that follows,
this is why spec does "make ARCH=`foo|sed -e s/s390x/s390/` nonint_oldconfig".
This is false. "make mrproper" ignores existing .config.

I suppose we could throw a few ARCH=something into make invocations in
the spec... if we are dying to fix this bug.
Comment 8 Mike Gahagan 2006-07-27 15:28:54 EDT
I just sucessfully rebuilt the kernel on an s390x using the 0720.5 RHEL 4 U4 tree.

Checking for unpackaged file(s): /usr/lib/rpm/check-files
Wrote: /usr/src/redhat/RPMS/s390x/kernel-2.6.9-42.EL.s390x.rpm
Wrote: /usr/src/redhat/RPMS/s390x/kernel-devel-2.6.9-42.EL.s390x.rpm
Wrote: /usr/src/redhat/RPMS/s390x/kernel-debuginfo-2.6.9-42.EL.s390x.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.10417
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd kernel-2.6.9
+ rm -rf /var/tmp/kernel-2.6.9-42.EL-root
+ exit 0
[root@kryten SPECS]# echo $ARCH

[root@kryten SPECS]# uname -a
Linux kryten.z900.redhat.com 2.6.9-42.EL #1 SMP Wed Jul 12 23:21:43 EDT 2006
s390x s390x s390x GNU/Linux

I'm still seeing srpm compile failures in the tps logs.
Comment 9 Mike Gahagan 2006-07-27 15:31:27 EDT
Setting $ARCH to s390x definately breaks the build.

+ perl -p -i -e 's/^EXTRAVERSION.*/EXTRAVERSION = -42.EL/' Makefile
+ make -s mrproper
/usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9/arch/s390x/Makefile: No such file
or directory
make: *** No rule to make target
`/usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9/arch/s390x/Makefile'.  Stop.
error: Bad exit status from /var/tmp/rpm-tmp.48128 (%build)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.48128 (%build)
[root@kryten SPECS]# echo $ARCH
Comment 10 Jason Baron 2006-10-04 16:06:23 EDT
requesting an exception for 4.5 since QA is getting hung up on this when we do
rhel4 kernel erratum.
Comment 16 RHEL Product and Program Management 2007-09-07 15:44:29 EDT
This request was previously evaluated by Red Hat Product Management
for inclusion in the current Red Hat Enterprise Linux release, but
Red Hat was unable to resolve it in time.  This request will be
reviewed for a future Red Hat Enterprise Linux release.
Comment 18 Mike Gahagan 2009-12-10 17:03:49 EST
Since this was caused by the configuration in our automated test environment and is worked around by setting ARCH to the appropriate value, I think we can go ahead and just close this.

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