Skip to content

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

Open

Description

@zyq5428

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

Activity

  1. mengning commented on Mar 3, 2019

    @mengning
    Owner

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

  2. LittleSec commented on Aug 11, 2019

    @LittleSec

    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)

  3. shift4 commented on Dec 23, 2019

    @shift4

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions