LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 04-20-2018, 03:42 PM   #1
m_yates
Senior Member
 
Registered: Aug 2003
Location: Upstate
Distribution: Debian, Mint, Mythbuntu
Posts: 1,249

Rep: Reputation: 101Reputation: 101
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.
 
Old 04-21-2018, 03:37 PM   #2
coralfang
Member
 
Registered: Nov 2010
Location: Bristol, UK
Distribution: Slackware, FreeBSD
Posts: 836
Blog Entries: 3

Rep: Reputation: 297Reputation: 297Reputation: 297
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).
 
Old 04-23-2018, 08:53 AM   #3
m_yates
Senior Member
 
Registered: Aug 2003
Location: Upstate
Distribution: Debian, Mint, Mythbuntu
Posts: 1,249

Original Poster
Rep: Reputation: 101Reputation: 101
Quote:
Originally Posted by coralfang View Post
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.
 
Old 04-24-2018, 12:00 AM   #4
coralfang
Member
 
Registered: Nov 2010
Location: Bristol, UK
Distribution: Slackware, FreeBSD
Posts: 836
Blog Entries: 3

Rep: Reputation: 297Reputation: 297Reputation: 297
Quote:
Originally Posted by m_yates View Post
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!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
kernel-package fails to compile kernel headers on (*)Ubuntu 16.04.2 donald3.heckel Linux - Software 2 05-26-2017 08:44 PM
How to restore out-of-box kernel settings if my kernel compile fails? brgr88 Slackware 8 04-18-2006 06:51 AM
kernel compile on x86_64 fails acidjuice Linux - Software 1 05-06-2005 04:30 PM
Mandrake 10 off. 2.6.3 kernel fails to compile... why???? Samppa72 Mandriva 1 07-23-2004 08:55 PM
New Debian kernel fails to compile rickenbacherus Linux - Software 1 07-19-2003 08:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 03:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration