Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 197743 - Kernel rpm fails to build on s390X
Summary: Kernel rpm fails to build on s390X
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel
Version: 4.0
Hardware: s390x
OS: Linux
Target Milestone: ---
: 4.9
Assignee: Jan Glauber
QA Contact: Red Hat Kernel QE team
Depends On:
Blocks: 229565
TreeView+ depends on / blocked
Reported: 2006-07-05 21:49 UTC by Mike Gahagan
Modified: 2009-12-10 22:03 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2009-12-10 22:03:49 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description Mike Gahagan 2006-07-05 21:49:06 UTC
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 13:43:19 UTC
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 15:57:46 UTC
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 17:44:48 UTC
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 17:28:46 UTC
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 17:55:38 UTC
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 and it was running
this kernel - uname -a "Linux 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 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 17:32:18 UTC
Setting to needinfo while I await availability of another 64-bit guest to
replicate the problem on.

Comment 7 Pete Zaitcev 2006-07-12 03:21:52 UTC
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 19:28:54 UTC
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 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 19:31:27 UTC
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 20:06:23 UTC
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 19:44:29 UTC
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 22:03:49 UTC
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.