compiling 64 bit linux kernel with gcc

南笙酒味 提交于 2019-12-24 01:55:26

问题


While trying to compile a 64 bit linux kernel using gcc, I see the following error :

kernel/bounds.c:1: error: code model ‘kernel’ not supported in the 32 bit mode
kernel/bounds.c:1: sorry, unimplemented: 64-bit mode not compiled in

This is what gcc -v reports :
Using built-in specs.
Target: i586-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man -- infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/ bugzilla --enable-bootstrap --enable-shared --enable-threads=posix -- enable-checking=release --with-system-zlib --enable-__cxa_atexit -- disable-libunwind-exceptions --enable-languages=c,c++,objc,obj-c+ +,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable- plugin --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre -- enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/ usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl -- with-cloog --with-tune=generic --with-arch=i586 --build=i586-redhat- linux
Thread model: posix
gcc version 4.4.1 20090725 (Red Hat 4.4.1-2) (GCC)

Am i missing something on my kernel make command line ? Or is it the gcc present on the system does not support 64 bit compilation ?


回答1:


Your compiler is 32-bit.




回答2:


What system are you running on?

If you host system is running in 32 bit mode you'll have to build a cross-compiler targeting x86_64. If your system is a 64bit system then your vendor should be providing you with a system compiler capable off building 64bit executables.

What does "uname -a" say on your system?



来源:https://stackoverflow.com/questions/1370803/compiling-64-bit-linux-kernel-with-gcc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!