Help - 'make' errors dealing with Kernel Source - all my kernel source code, old and new

Erik Christiansen erik at dd.nec.com.au
Thu Jun 22 10:16:10 UTC 2006


On Thu, Jun 22, 2006 at 01:24:03AM -0700, Adam D wrote (much
abbreviated):
> 
> This is what I have been doing for some years, I do hope it is correct.  When 
> compiling my own source and I have a link in /usr/include/linux pointing 
> 
> lrwxrwxrwx 1 root root 26 Jun  2 13:21 /usr/include/linux -> 
> ../src/linux/include/linux/

If it has been working, then it has been good enough, ... until now. ;-)
(It's very common for new source edistributions to break non-standard
build set-ups.)

> Within /usr/src/linux/include/linux I find a link asm -> asm-x86_64
> 
>  ../include/asm # cat errno.h
> #ifndef _X8664_ERRNO_H
> #define _X8664_ERRNO_H
> 
> #include <asm-generic/errno.h>

We don't yet know whether gcc is using asm-generic/errno.h, but we will.

> #endif
> 
> (I do not find an asm-amd64 and I think the asm-x86_64 is the proper 
> directory.)  My working kernel I am using now was my first AMD kernel compiled 
> and before that it has been PPC all these years with some intel kernels of late 
> working on some servers.
> 
> scripts/kconfig/mconf.c does have errno.h in the file.
> 
>  ../src/linux # grep errno.h scripts/kconfig/mconf.c
> #include <errno.h>
> 

Please run gcc with the additional option:  -v
You can do this globally by adding it to the "CFLAGS=..." line that
should be in the early part of the relevant makefile. (The kernel's big,
nd I fear that it might use recursive make. So:

$ egrep -nr mcconf.o scripts       # To find the makefile dependency entry.

Hopefully, that'll list a "makefile" near kconfig. Add -v to CFLAGS in
only this makefile. Note:  It may be called "Makefile". )

Before running make, record output to a file, with:

$ script /tmp/fred  

Run make. The verbose output should now include the path used for
include files. Control-D ends recording to /tmp/fred, where it's easier
to search than in the xterm.

> grepping EINTR I found this:
>                                 if (errno == EINTR || errno == EAGAIN)

Nope, you're looking in the source code, which _uses_ the #defines. You
need to look in the header which defines them. :-)

> Ummmm, I am showing my lack of programing knowledge here, what is EAGAIN? 

They are just standard numeric values for common run-time error
conditions.

> > 
> > Can you post the #includes at the top of scripts/kconfig/mconf.c?
> > If the include is there, then your include path probably needs tweaking.
> 
> #include <sys/ioctl.h>
> #include <sys/wait.h>
> #include <ctype.h>
> #include <errno.h>
> #include <fcntl.h>
> #include <limits.h>
> #include <signal.h>
> #include <stdarg.h>
> #include <stdlib.h>
> #include <string.h>
> #include <termios.h>
> #include <unistd.h>
> #include <locale.h>
> 
> #define LKC_DIRECT_LINK
> #include "lkc.h"
> 

OK, what had to be (for others to build the kernel) is confirmed. The
requisite header is included. Your include path is bung.

Now, before we go further, there's not an earlier error is there, saying
------------------------------------------------------------------------
something remotely like ".../.../errno.h: File not found" ??
------------------------------------------------------------

Because EINTR should not be undefined if any flavour of errno.h is
actually included when gcc compiles mconf.c. This  means that there
should have been an earlier error message in the compiler output. (Maybe
a thousand lines earlier, if you're building the whole kernel? Search for
errno.h from the top of our "script" output.)

> So, it does look like the new 2.6.17.1 code has a bit minor issue with me. 

Nah, if that humungous kernel mostly builds, just complaining about one
measly header file, then it likes you, and is only teasing. ;-)

> I do hope that helps...and thank you very much :).

No worries. :-)

A last hint. The start of output from 
"gcc -v scripts/kconfig/mconf.c ..." should roughly be along the lines of:

ignoring nonexistent directory "/usr/local/include/i486-linux-gnu"
ignoring nonexistent directory "/usr/include/i486-linux-gnu"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc/i486-linux-gnu/4.0.2/include
 /usr/include
End of search list.

If any  errno.h was really used to compile mcconf.c, it will be in a
path in the <...> part of the list.

OK, as you said, let's keep it simple. Let's try that. :-)

Good luck,

Erik




More information about the ubuntu-users mailing list