# [Solved]Can't compile kernel after GCC-7.3 update

## ShanaXXII

After updating to gcc-7.3.0-r3 from gcc-6.4.0-r1, I couldn't compile vanilla-sources-4.17.1.

```
~ # make -j5

  CHK     include/config/kernel.release

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

  DESCEND  objtool

make[4]: *** No rule to make target '/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/include/stddef.h', needed by '/usr/src/linux-4.17.1/tools/objtool/fixdep.o'.  Stop.

make[3]: *** [Makefile:43: /usr/src/linux-4.17.1/tools/objtool/fixdep-in.o] Error 2

make[2]: *** [/usr/src/linux-4.17.1/tools/build/Makefile.include:4: fixdep] Error 2

make[1]: *** [Makefile:63: objtool] Error 2

make: *** [Makefile:1699: tools/objtool] Error 2

make: *** Waiting for unfinished jobs....

```

```
[ebuild   R    ] sys-devel/gcc-7.3.0-r3:7.3.0::gentoo  USE="cxx fortran (multilib) nls nptl openmp pch (pie) sanitize ssp (-altivec) -cilk -debug -doc (-fixed-point) -go -graphite (-hardened) (-jit) (-libssp) -mpx -objc -objc++ -objc-gc -pgo -regression-test -vanilla -vtv" 0 KiB

```

Last edited by ShanaXXII on Tue Jul 03, 2018 3:08 am; edited 1 time in total

----------

## bunder

yeah I had problems at first too...  hopefully this should work though

```
cp /usr/src/linux/.config /root/kernel-config

cd /usr/src/linux

make clean

mv /root/kernel-config .config

make oldconfig (optional)

make

```

i would also check with gcc-config -l to make sure gcc7 is the selected gcc.

----------

## Marcih

 *ShanaXXII wrote:*   

> 
> 
> ```
> make[4]: *** No rule to make target '/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/include/stddef.h', needed by '/usr/src/linux-4.17.1/tools/objtool/fixdep.o'.  Stop.
> ```
> ...

 

Have you followed the Upgrading GCC Wiki article? That line makes me think you've either not re-compiled libtool (it has hard links against the current GGC when compiled, needs to be rebuilt after every GCC update) or you've already compiled some objects with GCC 6.4.0 and it's looking for headers in the folder of the old GCC to continue(?).

To clean the cached objects, do what bunder said (It's not strictly necessary to back up the config when doing make clean, it's good practice to do so nevertheless. To "make sure there are no stale .o files and dependencies lying around", to quote from the Linux README file, follow bunder's instructions, replacing clean with mrproper), both cleaning your sources folder from old .o files and checking whether you have 7.3.0 selected; it almost certainly is, the newest GCC gets selected automagically when you unmerge an older version, not to mention that you probably wouldn't be getting this error if 6.4.0 was still installed and selected.

If that fails, try rebuiling sys-devel/libtool, like it says in the Wiki article linked at the start:

```
# emerge --ask --verbose --oneshot sys-devel/libtool
```

----------

## ShanaXXII

 *bunder wrote:*   

> yeah I had problems at first too...  hopefully this should work though
> 
> ```
> cp /usr/src/linux/.config /root/kernel-config
> 
> ...

 

Thanks that worker  :Smile: 

Sorry for long reply. Laptop died.

----------

## papandreoos

 *bunder wrote:*   

> yeah I had problems at first too...  hopefully this should work though
> 
> ```
> cp /usr/src/linux/.config /root/kernel-config
> 
> ...

 

thank you very much!

----------

