简体   繁体   English

编译出问题了 kernel 我已经修改了

[英]Problems compiling a kernel I have modified

I took Linux kernel version 4.9.30, added a new directory /fsac whose files include headers from other directory (/include/fsac) and that is almost all I changed.我使用了 Linux kernel 版本 4.9.30,添加了一个新目录 /fsac,其文件包含来自其他目录 (/include/fsac) 的标头,这几乎是我更改的全部内容。 Trying to compile I get a lot of errors in /kernel/sched/core.c that look like this:尝试编译时,我在 /kernel/sched/core.c 中遇到很多错误,如下所示:

kernel/sched/core.c:2326:20: error: invalid storage class for function ‘set_schedstats’

kernel/sched/core.c:2342:19: error: invalid storage class for function ‘setup_schedstats’

(...)

Searching on-line I saw that the recommendation was to simply remove the 'static' from the functions.在线搜索我看到建议是简单地从函数中删除“静态”。 Doing that effectively avoided that errors, but instead I started getting a lot of warnings from objtool like "frame pointer state mismatch" for each of the functions whose static was removed.这样做有效地避免了这些错误,但我开始从 objtool 收到很多警告,例如对于每个删除了 static 的函数的“帧指针 state 不匹配”。

I discovered these warnings can be avoided by changing in the configuration file CONFIG_STACK_VALIDATION=n .我发现可以通过更改配置文件CONFIG_STACK_VALIDATION=n来避免这些警告。 That worked but even though there is no warning, compilation fails (Error 2).这行得通,但即使没有警告,编译也会失败(错误 2)。

Hence, I am wondering:因此,我想知道:

1 - Is the removal of "static" from the offended functions the proper solution? 1 - 从冒犯功能中删除“静态”是正确的解决方案吗?

2 - If so, how do I deal with the objtool warnings? 2 - 如果是这样,我该如何处理 objtool 警告? Can those warnings alone constitute a compilation error, or there must be something else?仅这些警告就可以构成编译错误,还是必须有其他原因?

3 - Do you think I should degrade GCC? 3 - 你认为我应该降级 GCC 吗?

This is the source code of the project: https://github.com/Zildj1an/FSAC_Kernel This is the compilation log w/o removing the statics: https://github.com/Zildj1an/FSAC_Kernel/blob/master/build_err这是项目的源代码: https://github.com/Zildj1an/FSAC_Kernel这是没有删除静态信息的编译日志: https://github.com/Zildj1an/FSAC_Kernel/blob/master/build_err

I will happily provide any other information you might need.我很乐意提供您可能需要的任何其他信息。

Cheers.干杯。

Problem found, I had a function inside a function... Probably was moved copying something else.发现问题,我在 function 中有一个 function... 可能被复制了其他东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM