LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Compile of Kernel 4.16 fails (https://www.linuxquestions.org/questions/debian-26/compile-of-kernel-4-16-fails-4175628085/)

m_yates 04-20-2018 03:42 PM

Compile of Kernel 4.16 fails
 
I was trying to upgrade to kernel 4.16 to gain protection against Meltdown and Spectre. I downloaded the source from kernel.org, then I copied my old config file over. When running "make oldconfig", you see this error:

Code:

  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  YACC    scripts/kconfig/zconf.tab.c
/bin/sh: 1: bison: not found
scripts/Makefile.lib:217: recipe for target 'scripts/kconfig/zconf.tab.c' failed
make[1]: *** [scripts/kconfig/zconf.tab.c] Error 127
Makefile:514: recipe for target 'oldconfig' failed
make: *** [oldconfig] Error 2

This was fixed by:

Code:

apt-get install bison
After that, I ran "make distclean" and tried "make oldconfig" and I got this error:

Code:

  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  YACC    scripts/kconfig/zconf.tab.c
  LEX    scripts/kconfig/zconf.lex.c
/bin/sh: 1: flex: not found
scripts/Makefile.lib:202: recipe for target 'scripts/kconfig/zconf.lex.c' failed
make[1]: *** [scripts/kconfig/zconf.lex.c] Error 127
Makefile:514: recipe for target 'oldconfig' failed
make: *** [oldconfig] Error 2

This was fixed with:

Code:

apt-get install flex
Now "make oldconfig" executes properly. Note that I did not see this problem with kernel 4.15. Therefore, anyone trying to upgrade to kernel 4.16 should install bison and flex first.

It appears that I've fixed the problem. I'm just posting the solution in case someone else runs across the same thing.

coralfang 04-21-2018 03:37 PM

Yes, it seems you were missing some packages. If you want to compile software on Debian/Ubuntu derivatives, the best practice is to install the meta package named "build-essential", this will pull in all related tools such as bison, flex, automake, gcc etc (basically everything required to compile software).

m_yates 04-23-2018 08:53 AM

Quote:

Originally Posted by coralfang (Post 5846011)
Yes, it seems you were missing some packages. If you want to compile software on Debian/Ubuntu derivatives, the best practice is to install the meta package named "build-essential", this will pull in all related tools such as bison, flex, automake, gcc etc (basically everything required to compile software).

The build-essential package in Debian Stretch does not include bison and flex. That is the problem.

If you read:

Code:

/usr/share/doc/build-essential/list
The list is:

Code:

libc-dev
gcc
g++
make
gpkg-dev

The "Essential: yes" list can be viewed by running:

Code:

apt-get install dctrl-tools
grep-status -FEssential -sPackage -ni yes

That list is:

Code:

yes
perl-base
grep
base-passwd
debianutils
bash
hostname
gzip
bsdutils
dash
mount
coreutils
e2fsprogs
tar
base-files
init-system-helpers
ncurses-base
libc-bin

The bison and flex packages are not there. I had already installed build-essential before I started compiling the kernel.

coralfang 04-24-2018 12:00 AM

Quote:

Originally Posted by m_yates (Post 5846577)
The build-essential package in Debian Stretch does not include bison and flex. That is the problem.

Ah, it's been many years since i've used Debian, i could have sworn those two packages were part of the build-essential, i guess not!


All times are GMT -5. The time now is 08:44 AM.