?
Solved

How to add a debug flag while compiling the kernel

Posted on 2003-02-24
6
Medium Priority
?
697 Views
Last Modified: 2008-03-17
Hi all,

I tried adding the -DDEBUG flag in the top level make file
but I get this error when I do "make bzImage"

In file included from init/do_mounts.c:913:
init/../lib/inflate.c: In function `inflate':
init/../lib/inflate.c:999: warning: implicit declaration of function `fprintf'
init/../lib/inflate.c:999: `stderr' undeclared (first use in this function)
init/../lib/inflate.c:999: (Each undeclared identifier is reported only once
init/../lib/inflate.c:999: for each function it appears in.)
make: *** [init/do_mounts.o] Error 1                          


How do I set the Debug flag while compiling the linux kernel.

Also I wonder if I have to edit the toplevel Makefile
can I do it using "make menuconfig" .Please let me know


Thanks
0
Comment
Question by:sanjay_thakur
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 5

Accepted Solution

by:
bryanh earned 100 total points
ID: 8030982
Don't know what you man by the "Debug flag," but you're probably interested in the kernel debug configuration option.  You can set that with make menuconfig by choosing "kernel hacking" from the first menu and "kernel debugging" from the next.

By setting -DDEBUG, you found somewhat of a bug in a piece of code that was designed for user space and ported to the kernel.  But no one expects you to define DEBUG.
0
 
LVL 5

Assisted Solution

by:garboua
garboua earned 100 total points
ID: 8061817
function fprintf is a "user space function" and should not exist in a kernel module.  check out the file inflate.c and remove the fprintf. You should submit a correction, or a bug report :-)
0
 
LVL 5

Expert Comment

by:garboua
ID: 8061819
ps what kernel are you trying to build?
0
 
LVL 4

Author Comment

by:sanjay_thakur
ID: 8112752
I am trying to build linux kernel version 2.4 for Power PC
440.
0
 
LVL 20

Expert Comment

by:jmcg
ID: 9983494
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Split: bryanh {http:#8030982} & garboua {http:#8061817}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
0

Featured Post

How To Install Bash on Windows 10

Windows’ budding partnership with Canonical has certainly led to some great improvements. One of them being the ability to use Bash on your Windows machine without third party applications! This might be one of the greatest things a cloud engineer in a Windows environment can do!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question