[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

RE: RHL 7.0 Kernel compile workaround



Hi,

I have RH7.0 and Kernel 2.2.16. I have problems compiling the kernel with
gcc 2.96.
I tried the work around vivek has mentioned, but it doesn't seem to work.
Here is the error message I got:

make[1]: Entering directory `/usr/src/linux-2.2.16/arch/i386/lib'
make all_targets
make[2]: Entering directory `/usr/src/linux-2.2.16/arch/i386/lib'
gcc -D__KERNEL__ -I/usr/src/linux/include -D__ASSEMBLY__ -D__SMP__ -traditio
nal -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.16/arch/i386/lib'
make[1]: *** [first_rule] Error 2
make[1]: Leaving directory `/usr/src/linux-2.2.16/arch/i386/lib'
make: *** [_dir_arch/i386/lib] Error 2

I also keep getting the warning which says:
" warning: pasting would not give a valid preprocessing token" in many
places.

The same kernel compiles under RH6.2, which has gcc 2.91.

can anybody suggest a way out?

TIA,
Vikram

-----Original Message-----
From: linux-india-programmers-owner@xxxxxxxxxxxxxxxxxxxxx
[mailto:linux-india-programmers-owner@xxxxxxxxxxxxxxxxxxxxx]On Behalf Of
Vivek Singhal
Sent: Saturday, March 03, 2001 9:46 AM
To: linux-india-programmers@xxxxxxxxxxxxxxxxxxxxx
Cc: linux-india-general@xxxxxxxxxxxxxxxxxxxxx
Subject: [LIP] RHL 7.0 Kernel compile workaround


RHL 7.0 kernel 2.2.16 had troubles compiling coz of some bug in kgcc ( gcc
in general ), but recently it compiled with a small work around. My previous
posting on the list did not have the exact work around. well here it is .

Errors would occur while compiling ksyms.c complaining of usage of an
undeclared variable which has actually been declared in one of the included
files ( bug lies here ). ksyms.c includes a huge number of headers one of
them is kernel_stat.h which in turn includes irq.h , smp.h and tasks.h . A
variable ( actually a macro ) declared in smp.h called smp_num_cpus was not
visible in kernel_stat.h which had actually included it in the first place.
When I removed the include gaurd of smp.h ..

include gaurd :

#ifndef __LINUX_SMP_H
#idefine __LINUX_SMP_H

//..... ( lines of declarations )

it finally compiled. ( making what lies after it visible hence smp_num_cpus
was visible ). This is when I made the posting on the list. Later I tried
several things to find out the possible cause of this. Instead of deleting
the include gaurd I changed it to ....

#ifndef _LINUX_SMP_H
#idefine _LINUX_SMP_H

//..... ( lines of declarations )

( notice that I have removed an underscore.. thats it ! )

and the kernel compiled !! So we have some possible causes of this anomoly :

a > bug in kgcc ( as reported by redhat )
b > definition of __LINUX_SMP_H prior to smp.h
c > some other bug

No other included file in kernel_stat.h or even ksyms.c had defined
__LINUX_SMP_H pror to smp.h ( as it should be ). So we are left with most
probable cause ... bug in kgcc. But a bug can have a work around too so the
code given above actually lets the kernel compile !! I have got a kernel
small kernel now 300K . I have removed all loadable modules to keep my
modules dir small amd whatever I need I have included in kernel itself. I
did this coz there was some trouble compiling some of the modules ( probably
same bug ).


vivek


---------------------------------------------
An alpha version of a web based tool to manage
your subscription with this mailing list is at
http://lists.linux-india.org/cgi-bin/mj_wwwusr