Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debian 9.5编译linux3.9.4时GCC报错 #9

Open
zyq5428 opened this issue Mar 1, 2019 · 3 comments
Open

debian 9.5编译linux3.9.4时GCC报错 #9

zyq5428 opened this issue Mar 1, 2019 · 3 comments

Comments

@zyq5428
Copy link

zyq5428 commented Mar 1, 2019

make时出现已下错误信息 :
In file included from include/linux/compiler.h:54:0,
from include/uapi/linux/stddef.h:1,
from include/linux/stddef.h:4,
from /home/hero/kernel_analysis/linux-3.9.4/include/uapi/linux/posix_types.h:4,
from include/uapi/linux/types.h:13,
from include/linux/types.h:5,
from include/linux/page-flags.h:8,
from kernel/bounds.c:9:
include/linux/compiler-gcc.h:103:30: fatal error: linux/compiler-gcc6.h: No such file or directory
#include gcc_header(GNUC)
^
compilation terminated.
/home/hero/kernel_analysis/linux-3.9.4/./Kbuild:35: recipe for target 'kernel/bounds.s' failed
make[1]: *** [kernel/bounds.s] Error 1
Makefile:833: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2

@mengning
Copy link
Owner

mengning commented Mar 3, 2019

应该是需要安装对应内核版本的头文件

@LittleSec
Copy link

refer to http://blog.chinaunix.net/uid-20680966-id-5322921.html
or you can:
(in linux-3.9.4 folder)cp include/linux/compiler-gcc4.h include/linux/compiler-gcc5.h
(test in Ubuntu 16.04.05 LTS)

@shift4
Copy link

shift4 commented Dec 23, 2019

ubuntu 18.04也碰到类似问题,应该是gcc的版本太高导致的,系统默认是gcc 7.4了,报错找不到include/linux/compiler-gcc7.h,可以ln -s include/linux/compiler-gcc4.h include/linux/compiler-gcc7.h解决。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants