2011年5月9日 星期一

error: asm/bitsperlong.h: No such file

linux/include/asm-generic/int-ll64.h:11:29: error: asm/bitsperlong.h: No such file
make[8]: *** [wlanconfig] Error 1



diff --git a/kernels/linux-2.6.35.12-cavm1/include/asm-generic/int-ll64.h b/kernels/linux-2.6.35.12-cavm1/include/asm-generic/int-ll64.h
index f394147..f0a6e55 100644
--- a/kernels/linux-2.6.35.12-cavm1/include/asm-generic/int-ll64.h
+++ b/kernels/linux-2.6.35.12-cavm1/include/asm-generic/int-ll64.h
@@ -8,7 +8,8 @@
#ifndef _ASM_GENERIC_INT_LL64_H
#define _ASM_GENERIC_INT_LL64_H

-#include <asm/bitsperlong.h>
+//#include <asm/bitsperlong.h>
+#include <asm-generic/bitsperlong.h>

#ifndef __ASSEMBLY__
/*


This seems not the best solution.
1. user space application shouldn't include kernel header file from kernel, but from the installed kernel header
2. if installed kernel header is too old, one should install a new kernel header and REBUILD C LIBRARY...



KernelHeaders
http://kernelnewbies.org/KernelHeaders
User space programs

In general, user space programs are built against the header files provided by the distribution, typically from a package named glibc-devel, glibc-kernheaders or linux-libc-dev. These header files are often from an older kernel version, and they cannot safely be replaced without rebuilding glibc as well. In particular, installing /usr/include/linux as a symbolic link to /usr/src/linux/include or /lib/modules/*/build/include/linux is highly discouraged as it frequently breaks rebuilding applications. For instance, older kernels had the architecture specific header files in include/asm-${arch} instead of arch/${arch}/include/asm and had on a symlink to the architecture specific directory.

The correct way to package the header files for a distribution is to run 'make headers_install' from the kernel source directory to install the headers into /usr/include and then rebuild the C library package, with a dependency on the specific version of the just installed kernel headers.


Re: 2.6.31.1 BUG #include <asm/bitsperlong.h>
http://linux.derkeiler.com/Mailing-Lists/Kernel/2009-09/msg10738.html

asm-generic: introduce asm/bitsperlong.h
http://www.kerneltrap.com/mailarchive/git-commits-head/2009/6/13/5958143

沒有留言: