LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   error when compile kernel (https://www.linuxquestions.org/questions/linux-kernel-70/error-when-compile-kernel-878706/)

just.centos 05-04-2011 01:50 AM

error when compile kernel
 
hello
when i run "make oldconfig" or "make bzImage" or ...
to compile my newkernel after patch gresecurity,give me this error:
HOSTCC scripts/basic/fixdep
cc1: error: unrecognized command line option "-Wno-empty-body"
make[1]: *** [scripts/basic/fixdep] Error 1
make: *** [scripts_basic] Error 2

thanks for any ideas.

vdx 05-04-2011 03:16 AM

I appreciate If u post ur kernel ver & the patch u r applying.

just.centos 05-04-2011 06:45 AM

Quote:

Originally Posted by vdx (Post 4345943)
I appreciate If u post ur kernel ver & the patch u r applying.


kernel; linux-2.6.32.39.tar.bz2
patch: grsecurity-2.2.2-2.6.32.39-201104301754.patch

my cmd:

root@server [~]# cd /root
root@server [~]# wget http://www.kernel.org/pub/linux/kern....32.39.tar.bz2
root@server [~]# wget http://grsecurity.net/stable/grsecur...04301754.patch
root@server [~]# tar -vxjf linux-2.6.32.39.tar.bz2
root@server [~]# patch -p0 < grsecurity-2.2.2-2.6.32.39-201104301754.patch
root@server [~]# mv linux-2.6.32.39 linux-2.6.32.39-grsec
root@server [~]# ln -s linux-2.6.32.39-grsec/ linux
root@server [~/linux]# cd linux
root@server [~/linux]# cp /boot/config-`uname -r` .config
root@server [~/linux]# make oldconfig
HOSTCC scripts/basic/fixdep
cc1: error: unrecognized command line option "-Wno-empty-body"
make[1]: *** [scripts/basic/fixdep] Error 1
make: *** [scripts_basic] Error 2

just.centos 05-04-2011 12:31 PM

gcc version: gcc-4.1.2-50.el5.x86_64
kernel version: Linux 2.6.18-238.9.1.el5

new version that i want to install:
kernel: linux-2.6.32.39
patch: grsecurity-2.2.2-2.6.32.39-201104301754.patch
my OS version: centos 5.6 64bit

vdx 05-05-2011 01:39 AM

You having the gcc which does not support this switch(-Wno-empty-body)

I can successfully compile the same with the gcc-4.5.1

Either update ur gcc or simply remove the option from make file.


All times are GMT -5. The time now is 06:09 PM.