# [SOLVED] GCC-error compiling kernel

## Martux

Guys, just trying to change somethin in my kernel, getting this error message, what does it mean? Seems gcc related, just recently updated to 5.4.0, did a fix_libtool_files.sh afterwards...

```

scripts/kconfig/conf  --oldconfig Kconfig

#

# configuration written to .config

#

scripts/kconfig/conf  --silentoldconfig Kconfig

  CHK     include/config/kernel.release

  CHK     include/generated/uapi/linux/version.h

  DESCEND  objtool

make[4]: *** Keine Regel vorhanden, um das Ziel „/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/include/stddef.h“, 

  benötigt von „/usr/src/linux-4.6.2-gentoo/tools/objtool/fixdep.o“, zu erstellen.  Schluss.

make[3]: *** [Makefile:36: /usr/src/linux-4.6.2-gentoo/tools/objtool/fixdep-in.o] Fehler 2

make[2]: *** [/usr/src/linux-4.6.2-gentoo/tools/build/Makefile.include:7: fixdep] Fehler 2

make[1]: *** [Makefile:59: objtool] Fehler 2

make: *** [Makefile:1551: tools/objtool] Fehler 2

make: *** Es wird auf noch nicht beendete Prozesse gewartet....

```

----------

## eccerr0r

Seems like the makefile is somewhat confused trying to build an include file, perhaps it's due to gcc5...  I'm not sure if the kernel was gcc5-ized yet, but anecdotal evidence seems like it should work...

In any case, did you do a make clean in your kernel?  Is this a fresh kernel tree?

----------

## Martux

Naa, I used make menuconfig to implement some changes, then some script I use to install kernels, calling make oldconfig && make && make_modules

----------

## Martux

Just checked, doesn't work either if I only call make.

What confuses me is this „/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/include/stddef.h“

I am using gcc-5.4.0, not 5.3.0

----------

## gerard27

Did you run gcc-config -l?

Gerard.

----------

## Martux

Yes, after a gcc update I always check the version and depclean old ones. It only gives this:

```

gcc-config -l

 [1] x86_64-pc-linux-gnu-5.4.0 *

```

----------

## Hu

 *Martux wrote:*   

> Just checked, doesn't work either if I only call make.
> 
> What confuses me is this „/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/include/stddef.h“
> 
> I am using gcc-5.4.0, not 5.3.0

 I suspect that you are using a build tree that recorded the 5.3.0 version of stddef.h as a dependency of some file.  When you upgraded to 5.4.0, the 5.3.0 version was removed.  Now Make needs 5.3.0 stddef.h (because the build tree requested it), that file does not exist, and there is no way to build it.  You could try to modify the build tree to request the 5.4.0 version, but the simplest thing to do would be to clean out all generated files and start over.  This will also protect against any oddities from building some files with 5.3.0 and some with 5.4.0.  Mixing minor versions should be safe, but do you want to use a production kernel build to test it?  :Wink: 

If you decide to clean out the build tree, set aside a copy of your .config, since a full clean will delete it.

----------

## Martux

What exactly do you mean by cleaning out the build tree?

Removing /usr/src/linux/ and building it again with the old config file?

Or start with a new default kernel from scratch (I would rather like to avoid that)?

----------

## Jaglover

```
cd /usr/src/linux

make clean
```

----------

## Hu

I was thinking of make mrproper, rather than make clean, since the Makefile comments state:

```
# make clean     Delete most generated files

#                Leave enough to build external modules

# make mrproper  Delete the current configuration, and all generated files

# make distclean Remove editor backup files, patch leftover files and the like
```

Deleting "most" generated files might or might not be enough to solve OP's problem, since it is a problem in the generated dependencies, rather than just a stale object file.  Using make clean is fine as a first attempt.  It should not cause any new problems, but I am not sure that it will solve the OP's reported problem.  Regarding mrproper, I stated this above, but I should reiterate, since losing the last copy of a configuration is very annoying: make mrproper will delete .config, so the user must explicitly save that file aside first.

----------

## Martux

"make clean" just worked fine  :Smile:  I think in all my years with Gentoo, this was the first time I ever used it. With the lost config files, it's always good to have one or two being in /boot as well (make install does that).

----------

## eccerr0r

I need to write my posts differently, solution was found 2 days ago :-(

----------

## Hu

I make it a point to use BBcode to bold commands that I want someone to run, both to make it easier for them to know what to execute and to call attention to the presence of a command.  In some cases, it may also help to use an imperative rather than a question: Please run command foo.  If that does not help, post the output of bar. rather than Have you tried running foo?  Some readers interpret the question form as a speculative suggestion rather than a polite directive.

----------

