Bug 18240 - Cannot recompile 2.2.16-22 kernel from SRPM under RedHat 7.0
Cannot recompile 2.2.16-22 kernel from SRPM under RedHat 7.0
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: kernel (Show other bugs)
7.0
i686 Linux
medium Severity high
: ---
: ---
Assigned To: Ben LaHaise
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-10-03 12:25 EDT by You're kidding, right?
Modified: 2008-05-01 11:37 EDT (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-11-02 16:33:24 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description You're kidding, right? 2000-10-03 12:25:32 EDT
Any attempt to recompile the kernel from the SRPM or the kernel-source RPM
fails as follows:

make: Entering directory `/usr/src/redhat/BUILD/linux/ibcs/iBCSemul'
kgcc -D__KERNEL__=1 -DMODULE -D__NO_VERSION__ -I../include
-I/usr/src/redhat/BUILD/linux/include -Wall -Wstrict-prototypes -O2
-fomit-frame-pointer -m486 -DSOCKSYS_MAJOR=30  -DEMU_SCO -DEMU_ISC
-DEMU_SVR4 -DEMU_BSD -DEMU_WYSE -DEMU_WYSEMP -DEMU_SPX -DEMU_XTI
-DEMU_TLI_OPTMGMT -DEMU_BINFMT_AOUT -DEMU_BINFMT_COFF -DEMU_BINFMT_XOUT
-DEMU_BINFMT_OLDSCRIPT -DIBCS_TRACE -DVERBOSE_ERRORS -DCOFF_TRACE
-DELF_TRACE -DXOUT_DEBUG -DMODVERSIONS -include
/usr/src/redhat/BUILD/linux/include/linux/modversions.h -D__SMP__=1 -c
emulate.c
/usr/src/redhat/BUILD/linux/include/asm/smp.h: In function
`hard_smp_processor_id':
In file included from /usr/src/redhat/BUILD/linux/include/linux/smp.h:11,
                 from /usr/src/redhat/BUILD/linux/include/linux/sched.h:20,
                 from /usr/src/redhat/BUILD/linux/include/asm/uaccess.h:8,
                 from emulate.c:43:
/usr/src/redhat/BUILD/linux/include/asm/smp.h:209: warning: implicit
declaration of function `GET_APIC_ID'
/usr/src/redhat/BUILD/linux/include/asm/smp.h:209: `APIC_BASE' undeclared
(first use in this function)
/usr/src/redhat/BUILD/linux/include/asm/smp.h:209: (Each undeclared
identifier is reported only once
/usr/src/redhat/BUILD/linux/include/asm/smp.h:209: for each function it
appears in.)
/usr/src/redhat/BUILD/linux/include/asm/smp.h:209: `APIC_ID' undeclared
(first use in this function)
../include/ibcs/ibcs.h: At top level:
In file included from emulate.c:61:
../include/ibcs/ibcs.h:47: warning: function declaration isn't a prototype
make: *** [emulate.o] Error 1
make: Leaving directory `/usr/src/redhat/BUILD/linux/ibcs/iBCSemul'
Bad exit status from /var/tmp/rpm-tmp.943 (%build)
Comment 1 panu.matilainen 2000-10-04 04:20:08 EDT
Exactly same problem here, happens on both clean RH7 installation and an
upgraded box (from 6.2). And yes, using kgcc :)
Comment 2 Rob K 2000-10-06 02:04:20 EDT
Me Too, in exactly the same way, on several machines. 

Clean install and upgrades.
Comment 3 Rob K 2000-10-06 02:09:56 EDT
Oops - forgot my error messages. As you can see, it's not exactly the same as I
previously claimed - sorry about that.

[root@co3006264-a linux]# make install
kgcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2
-fomit-frame-pointer -fno-strict-aliasing -pipe -fno-strength-reduce -m386
-DCPU=386  -c -o init/main.o init/main.c
kgcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2
-fomit-frame-pointer -fno-strict-aliasing -pipe -fno-strength-reduce -m386
-DCPU=386 -DUTS_MACHINE='"i386"' -c -o init/version.o init/version.c
make -C  kernel
make[1]: Entering directory `/usr/src/linux-2.2.16/kernel'
make all_targets
make[2]: Entering directory `/usr/src/linux-2.2.16/kernel'
kgcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2
-fomit-frame-pointer -fno-strict-aliasing -pipe -fno-strength-reduce -m386
-DCPU=386   -DEXPORT_SYMTAB -c signal.c
In file included from /usr/src/linux/include/linux/modversions.h:50,
                 from /usr/src/linux/include/linux/module.h:19,
                 from signal.c:10:
/usr/src/linux/include/linux/modules/i386_ksyms.ver:6: warning: `cpu_data'
redefined
/usr/src/linux/include/asm/processor.h:96: warning: this is the location of the
previous definition
/usr/src/linux/include/linux/modules/i386_ksyms.ver:28: warning: `smp_num_cpus'
redefined
/usr/src/linux/include/linux/smp.h:77: warning: this is the location of the
previous definition
/usr/src/linux/include/linux/modules/i386_ksyms.ver:118: warning:
`smp_call_function' redefined
/usr/src/linux/include/linux/smp.h:83: warning: this is the location of the
previous definition
kgcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2
-fomit-frame-pointer -fno-strict-aliasing -pipe -fno-strength-reduce -m386
-DCPU=386   -DEXPORT_SYMTAB -c ksyms.c
In file included from /usr/src/linux/include/linux/modversions.h:50,
                 from /usr/src/linux/include/linux/module.h:19,
                 from ksyms.c:14:
/usr/src/linux/include/linux/modules/i386_ksyms.ver:6: warning: `cpu_data'
redefined
/usr/src/linux/include/asm/processor.h:96: warning: this is the location of the
previous definition
/usr/src/linux/include/linux/modules/i386_ksyms.ver:28: warning: `smp_num_cpus'
redefined
/usr/src/linux/include/linux/smp.h:77: warning: this is the location of the
previous definition
/usr/src/linux/include/linux/modules/i386_ksyms.ver:118: warning:
`smp_call_function' redefined
/usr/src/linux/include/linux/smp.h:83: warning: this is the location of the
previous definition
In file included from /usr/src/linux/include/linux/interrupt.h:51,
                 from ksyms.c:21:
/usr/src/linux/include/asm/hardirq.h:23: warning: `synchronize_irq' redefined
/usr/src/linux/include/linux/modules/i386_ksyms.ver:138: warning: this is the
location of the previous definition
In file included from /usr/src/linux/include/linux/interrupt.h:52,
                 from ksyms.c:21:
/usr/src/linux/include/asm/softirq.h:75: warning: `synchronize_bh' redefined
/usr/src/linux/include/linux/modules/i386_ksyms.ver:142: warning: this is the
location of the previous definition
/usr/src/linux/include/linux/kernel_stat.h: In function `kstat_irqs':
In file included from ksyms.c:17:
/usr/src/linux/include/linux/kernel_stat.h:47: `smp_num_cpus' undeclared (first
use in this function)
/usr/src/linux/include/linux/kernel_stat.h:47: (Each undeclared identifier is
reported only once
/usr/src/linux/include/linux/kernel_stat.h:47: for each function it appears in.)
make[2]: *** [ksyms.o] Error 1
make[2]: Leaving directory `/usr/src/linux-2.2.16/kernel'
make[1]: *** [first_rule] Error 2
make[1]: Leaving directory `/usr/src/linux-2.2.16/kernel'
make: *** [_dir_kernel] Error 2
[root@co3006264-a linux]#
Comment 4 Guardn 2000-10-06 04:21:51 EDT
Same for me EVEN if I use kgcc :

# make CC=kgcc -D__KERNEL__ -I$(HPATH) bzImage
kgcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe -fno-strength-reduce -m486 
-malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=686 -DUTS_MACHINE='"i386"' -c -o init/version.o init/version.c
make -C  kernel
make[1]: Entering directory `/usr/src/linux-2.2.16/kernel'
make all_targets
make[2]: Entering directory `/usr/src/linux-2.2.16/kernel'
kgcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe -fno-strength-reduce -m486 
-malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=686   -DEXPORT_SYMTAB -c ksyms.c
In file included from /usr/src/linux/include/linux/modversions.h:49,
                 from /usr/src/linux/include/linux/module.h:19,
                 from ksyms.c:14:
/usr/src/linux/include/linux/modules/i386_ksyms.ver:6: warning: `cpu_data' redefined
/usr/src/linux/include/asm/processor.h:96: warning: this is the location of the previous definition
/usr/src/linux/include/linux/modules/i386_ksyms.ver:28: warning: `smp_num_cpus' redefined
/usr/src/linux/include/linux/smp.h:77: warning: this is the location of the previous definition
/usr/src/linux/include/linux/modules/i386_ksyms.ver:118: warning: `smp_call_function' redefined
/usr/src/linux/include/linux/smp.h:83: warning: this is the location of the previous definition
In file included from /usr/src/linux/include/linux/interrupt.h:51,
                 from ksyms.c:21:
/usr/src/linux/include/asm/hardirq.h:23: warning: `synchronize_irq' redefined
/usr/src/linux/include/linux/modules/i386_ksyms.ver:138: warning: this is the location of the previous definition
In file included from /usr/src/linux/include/linux/interrupt.h:52,
                 from ksyms.c:21:
/usr/src/linux/include/asm/softirq.h:75: warning: `synchronize_bh' redefined
/usr/src/linux/include/linux/modules/i386_ksyms.ver:142: warning: this is the location of the previous definition
/usr/src/linux/include/linux/kernel_stat.h: In function `kstat_irqs':
In file included from ksyms.c:17:
/usr/src/linux/include/linux/kernel_stat.h:47: `smp_num_cpus' undeclared (first use in this function)
/usr/src/linux/include/linux/kernel_stat.h:47: (Each undeclared identifier is reported only once
/usr/src/linux/include/linux/kernel_stat.h:47: for each function it appears in.)
make[2]: *** [ksyms.o] Error 1
make[2]: Leaving directory `/usr/src/linux-2.2.16/kernel'
make[1]: *** [first_rule] Error 2
make[1]: Leaving directory `/usr/src/linux-2.2.16/kernel'
make: *** [_dir_kernel] Error 2
Comment 5 Need Real Name 2000-10-06 11:44:36 EDT
I had the second error type from mammal@optushome.com.au
there problems with smp_*something* occured.
I included SMP support during the kernel configuration (although
I only have 1 CPU) and it worked...
Comment 6 Andreas Stollar 2000-10-06 15:10:31 EDT
I tried compiling the 2.2.17 from the tar ball, and it failed as well. Seems
RH-7.0 can't compile any kernel.

[root@twit linux]# make bzlilo

--snip--

make[1]: Entering directory `/usr/src/linux-2.2.17/arch/i386/lib'
make all_targets
make[2]: Entering directory `/usr/src/linux-2.2.17/arch/i386/lib'
cc -D__KERNEL__ -I/usr/src/linux/include -D__ASSEMBLY__ -D__SMP__ -traditional
-c checksum.S -o checksum.o
checksum.S:231: badly punctuated parameter list in #define
checksum.S:237: badly punctuated parameter list in #define
make[2]: *** [checksum.o] Error 1
make[2]: Leaving directory `/usr/src/linux-2.2.17/arch/i386/lib'
make[1]: *** [first_rule] Error 2
make[1]: Leaving directory `/usr/src/linux-2.2.17/arch/i386/lib'
make: *** [_dir_arch/i386/lib] Error 2
Comment 7 Harvey Modlin 2000-10-07 05:15:00 EDT
Try 'make mrproper' before all your makes.
That means, even before 'make menuconfig'.
This solved the problem for me on RH7.0.
Good luck.
Comment 8 Need Real Name 2000-10-08 09:24:08 EDT
I have the same problem on 2 systems, both with a K6-2 processor. On a third
system with a Pentium processor I had no problems.
Comment 9 You're kidding, right? 2000-10-08 18:32:17 EDT
The "make mrproper" trick described above seems to work for building in
/usr/src/linux, but does
not work for building from SRPM.  The complex scripting of the spec file would
have to be significantly re-arranged to allow the "make mrproper" to be run
before each kernel compilation.
Comment 10 Need Real Name 2000-10-09 08:31:22 EDT
I'm also getting the checksum.o error.  I've been unsuccessful at compiling the 
stock 2.2.16-22 from both RPM, SRPM, and the 2.2.16 tarball from us.kernel.org. 
I also cannot compile 2.2.17 at all.  I get the same checksum.o error.  
I tried "make mrproper" without success.  I'm running on an AMD k6-2 processor.
Comment 11 Need Real Name 2000-10-09 22:15:16 EDT
I'm also getting the checksum.o error.  I've been unsuccessful at compiling the 
stock 2.2.16-22 from both RPM, SRPM, and the 2.2.16 tarball from us.kernel.org. 
I also cannot compile 2.2.17 at all.  I get the same checksum.o error.  
I tried "make mrproper" without success.  I'm running on a Pentium III 
processor.

Comment 12 Need Real Name 2000-10-09 22:26:41 EDT
I've finally had some success thanks to a tip from a friend from Mission 
Critical Linux.  I did these three steps and compiled without a hitch.
1. I made sure the compat*rpm's (found on disc 1) were installed
2. Do 'export CC=/usr/bin/kgcc' - before I started building anything.
3. Then do "make mrproper; make menuconfig; make dep; make clean; make bzImage; 
make modules; make modules_install"

Worked for me. I can't say if the 1st step is really necessary or not - but I 
guess it couldn't have hurt any.
Comment 13 panu.matilainen 2000-10-10 02:51:11 EDT
Well yes but that doesn't help building from SRPM.
Comment 14 Christian Hechelmann 2000-10-19 17:58:02 EDT
Thjat one bit me too. Just remove /boot/kernel.h or back out
linux-2.2.16-rhconfig.patch.

The patch alters scripts/Configure to get the defaults for make *config from the
information in /boot/kernel.h instead of getting them from
arch/<architecture>/defconfig.

So when the RPM build process comes to build the SMP Kernel and you are
currently *running* a non-SMP kernel, it will barf.

Another fix would be to put the various RH kernel  configs in a different
directory during RPM build and renaming the directory while in %install phase
(the configs are now in linux/configs/kernel-x.y.z-*.config, during build we
might put them in linux/rpm-build-configs/kernel-x.y.z-*.config).

While we're at fixing the spec file: Changing BuildRoot from
/var/tmp/kernel-%{KVERREL}-root to %{_tmppath}/kernel-%{KVERREL}-root would be a
GoodThing(TM)
Comment 15 Derek Anderson 2000-10-21 01:20:36 EDT
I've been unsuccessful at compiling the stock 2.2.16-22 from both RPM, SRPM, 
and the 2.2.16 tarball from us.kernel.org. UNTIL I tried make mrproper on the 
SRPM from the CD 2.2.16-22 and was able to get some success.
Comment 16 You're kidding, right? 2000-10-22 20:26:49 EDT
I just tried installing the smp kernel on my RedHat 7.0 single CPU system, and
re-installing the kernel24-header RPM that I had tried un-installing as part of
my quest to be able to compile the !@#$ SRPM for this system.

***SUCCESS***

I've turned on the kernel-headers option and turned on some IDESCSI options I
needed for using xcdroast, and the NTFS_FS option I needed for my Win2K
dual-boot setup.  I'll let folks know in a few days if the fix is complete.

I'm still irritated that the default installation has the kernel24-headers
instead of a more standard kernel-headers RPM for the specific kernel. Why did
RedHat move the kernel-headers into the kernel RPM, but leave in the
dependencies elsewhere *AND* fail to use an "Obsoletes" entry for kernel-headers
in  the .spec file to get rid of unnecessary complaints?
Comment 17 cognety 2000-10-24 13:44:49 EDT
Hi
I got the same problem, just take RH7 out of the box and has it installed, then 
try make oldconfig, make dep clean bzImage and you get the strange SMP error.
Comment 18 Need Real Name 2000-10-30 07:29:50 EST
I have also had this problem but found a quick and nasty fix.  The error shows 
the following mistake:
kernel_stat.h:47: `smp_num_cpus' undeclared (first use in this function)
this is a for loop that will asaign the irq's for each CPU so if you know you 
only have 1 then hard code (Bad prctice I know) and the kernel will compile.  
Then wait for someone to come up with a patch.
Comment 19 DPLuS 2000-11-02 03:50:09 EST
When I tried to compile kernel 2.2.17 on RedHat 7 with GCC 2.95 I got the 
following error:

Warning: Pasting would not give a preprocessing token...

I ended up with several errors...

Too bad

Patrick
Comment 20 Ronny Bremer 2000-11-02 16:33:18 EST
It seems like it is not only effecting the kernel itself, I tried to compile the latest pcmcia package from Dave (pcmcia-2.2.21) and it doesn't compile 
correctly. Of course, Murphy's law hit me ... the one driver I am interested in (wireless/airo.c) is one of three which is broken. Compilation works fine, 
however, depmod does show an unresoved reference to "memcpy" ... interesting enough.
I did an objdump on the airo.o file and indeed, it did show a reference to memcpy. I scanned thru the code and from my understanding, every reference to 
memcpy is replaced by an internally supplied asm function called __memcpy, but four. The four calls to the *real* memcpy are generated by the 
compiler itself during the following statement: *xx = yy; where xx is a pointer to a structure. So might it just be a faulty egcs used in RH 7??

Ronny
Comment 21 Bill Nottingham 2000-11-04 02:15:44 EST
a) you need to run 'make mrproper' if you're rebuilding the kernel.
   'make oldconfig ; make clean', etc. will not work.
b) you need to use kgcc, not gcc, to build the kernel.
Comment 22 panu.matilainen 2000-11-06 02:29:57 EST
Hmm.. there IS a bug in the kernel SRPM: 'rpm -bb kernel-2.2.spec' fails on an
UP box as described earlier:



 ------- Additional comments from drdisk@tc-gruppe.de 2000-10-19 05:58 -------

 Thjat one bit me too. Just remove /boot/kernel.h or back out
 linux-2.2.16-rhconfig.patch.

 The patch alters scripts/Configure to get the defaults for make *config from
the
 information in /boot/kernel.h instead of getting them from
 arch/<architecture>/defconfig.

 So when the RPM build process comes to build the SMP Kernel and you are
 currently *running* a non-SMP kernel, it will barf.

 Another fix would be to put the various RH kernel  configs in a different
 directory during RPM build and renaming the directory while in %install phase
 (the configs are now in linux/configs/kernel-x.y.z-*.config, during build we
 might put them in linux/rpm-build-configs/kernel-x.y.z-*.config).

 While we're at fixing the spec file: Changing BuildRoot from
 /var/tmp/kernel-%{KVERREL}-root to %{_tmppath}/kernel-%{KVERREL}-root would be
a
 GoodThing(TM)

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