title: Problems compiling a kernel I have modified
body: <p>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. Trying to compile I get a lot of errors in /kernel/sched/core.c that look like this:</p>
  
  <pre><code>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’
  
  (...)
  </code></pre>
  
  <p>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.</p>
  
  <p>I discovered these warnings can be avoided by changing in the configuration file <code>CONFIG_STACK_VALIDATION=n</code>. That worked but even though there is no warning, compilation fails (Error 2).</p>
  
  <p>Hence, I am wondering:</p>
  
  <p>1 - Is the removal of "static" from the offended functions the proper solution?</p>
  
  <p>2 - If so, how do I deal with the objtool warnings? Can those warnings alone constitute a compilation error, or there must be something else?</p>
  
  <p>3 - Do you think I should degrade GCC?</p>
  
  <p>This is the source code of the project: <a href="https://github.com/Zildj1an/FSAC_Kernel" rel="nofollow noreferrer">https://github.com/Zildj1an/FSAC_Kernel</a>
  This is the compilation log w/o removing the statics: <a href="https://github.com/Zildj1an/FSAC_Kernel/blob/master/build_err" rel="nofollow noreferrer">https://github.com/Zildj1an/FSAC_Kernel/blob/master/build_err</a></p>
  
  <p>I will happily provide any other information you might need.</p>
  
  <p>Cheers.</p>