Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: "missing asm/types.h during kernel compilation"
PostPosted: Fri Jan 28, 2011 11:36 pm 
Offline

Joined: Wed Jul 30, 2008 6:45 pm
Posts: 7
Re: linux-2.6.30
I have seen references to this problem on other forums, but not here. Following the exact instructions for acquiring and compiling the linux kernel from the linux4sam web page, following the "make" of the kernel, I get:

In file included from include/linux/page-flags.h:8:0,
from kernel/bounds.c:9:
include/linux/types.h:4:23: fatal error: asm/types.h: No such file or directory

After some checking, I discover that include/asm is a symlink to include/asm-arm. But include/asm-arm does not contain types.h (nor posix_types.h that is also needed). Copying types.h from linux-2.6.30/arch/arm/include/asm/types.h to linux/incude/asm_arm has no impact. For reasons I don't understand, the symlink is apparently not followed in the make, and the same error occurs.

I also tried putting types.h in a new folder /linux-2.6.30/include/linux/asm, and changing the #include <asm/types.h> in /linux-2.6.30/include/linux/types.h to #include <linux/asm/types.h>. This allows compilation of bounds.c without error, but then I get:

fixdep: No such file or directory

immediately following bounds.c compilation.

I presume this problem is not created by the toolchain?

_________________
Dave Mortara


Top
 Profile  
 
 Post subject: Re: "missing asm/types.h during kernel compilation"
PostPosted: Mon Jan 31, 2011 4:54 pm 
Offline

Joined: Wed Jul 30, 2008 6:45 pm
Posts: 7
All,

Ignore my previous post. Much has been learned over the weekend. Stay tuned.

_________________
Dave Mortara


Top
 Profile  
 
 Post subject: Re: "missing asm/types.h during kernel compilation"
PostPosted: Wed Feb 02, 2011 10:28 pm 
Offline

Joined: Wed Jul 30, 2008 6:45 pm
Posts: 7
OK, i now have succeeded in building the kernel under a CYGWIN system.

There are a number of issues, none of which I have seen addressed in all of the various forums.

Many of the problems occur because CYGWIN, while providing a Linux U/I, still interfaces to the Win32 API. This means:
1. The text lines created, for example, by "echo" have Windows-style line termination,
2. File path names cannot start with "/",
3. Generated path names may well have a ":" present,
4. /dev/null is not recognized
5. Symbolic links created by Linux syntax are not recognized.

I will gladly share the solutions to the above which I found, but as a novice to this kind of effort, I need help in creating the appropriate patch file. I have directories of Linux-2.6.30 without any changes (not even a make oldconfig or make menuconfig), and a new directory with the modifications and all of the output from building the kernel. How do I generate a patch file which ignores all the newly created files? (My effort created only one new file.)

_________________
Dave Mortara


Top
 Profile  
 
 Post subject: Re: "missing asm/types.h during kernel compilation"
PostPosted: Wed Mar 09, 2011 12:04 am 
Offline

Joined: Tue Mar 08, 2011 11:37 pm
Posts: 1
Can you tell me exactly what you did to to eliminate the asm/types.h file not found error? I am having the same problem.

Thanks,
Mike.


Top
 Profile  
 
 Post subject: Re: "missing asm/types.h during kernel compilation"
PostPosted: Wed Mar 09, 2011 12:15 am 
Offline

Joined: Wed Jul 30, 2008 6:45 pm
Posts: 7
There are 2 different changes relating to this issue. Both changes are made contingent on __CYGWIN__=1 being defined in the environment. The first modifies the "include" paths used for gcc, and is most directly relevant. The patches to accomplish this for the linux-2.6.30 makefile are shown below.

--- makefile 2011-02-08 15:11:22.409970300 -0600
+++ newmakefile 2011-02-08 14:17:13.298131700 -0600
@@ -343,8 +343,8 @@
# Use LINUXINCLUDE when you must reference the include/ directory.
# Needed to be compatible with the O= option
LINUXINCLUDE := -Iinclude \
- $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \
- -I$(srctree)/arch/$(hdr-arch)/include \
+ $(if $(KBUILD_SRC),-Iinclude2 -I$(CYGWIN_SRC_TO_KERNEL_RELPATH)$(srctree)/include) \
+ -I$(CYGWIN_SRC_TO_KERNEL_RELPATH)$(srctree)/arch/$(hdr-arch)/include \
-include include/linux/autoconf.h

KBUILD_CPPFLAGS := -D__KERNEL__


I also made the changes to check-symlink and create-symlink, defined in the root makefile shown below. The change replaces the use of a "link" with a copy of the asm directory from the appropriate source.


define check-symlink
set -e; \
if [ -L include/asm ]; then \
asmlink=`readlink include/asm | cut -d '-' -f 2`; \
if [ "$$asmlink" != "$(SRCARCH)" ]; then \
echo "ERROR: the symlink $@ points to asm-$$asmlink but asm-$(SRCARCH) was expected"; \
echo " set ARCH or save .config and run 'make mrproper' to fix it"; \
exit 1; \
fi; \
test -e $$asmlink || rm include/asm; \
elif [ -d include/asm ] && [ $(__CYGWIN__) != 1 ]; then \
echo "ERROR: $@ is a directory but a symlink was expected";\
exit 1; \
fi
endef

# We create the target directory of the symlink if it does
# not exist so the test in check-symlink works and we have a
# directory for generated filesas used by some architectures.
define create-symlink
if [ ! -L include/asm ]; then \
if [ $(__CYGWIN__) = 1 ]; then \
$ echo ' Copy include/asm-$(SRCARCH) to include/asm'; \
if [ ! -d include/asm-$(SRCARCH) ]; then \
mkdir -p include/asm-$(SRCARCH); \
fi; \
if [ ! -d include/asm ]; then \
mkdir -p include/asm; \
fi; \
$ cp include/asm-$(SRCARCH)/* include/asm; \
else \
$(kecho) ' SYMLINK $@ -> include/asm-$(SRCARCH)'; \
if [ ! -d include/asm-$(SRCARCH) ]; then \
mkdir -p include/asm-$(SRCARCH); \
fi; \
ln -fsn asm-$(SRCARCH) $@; \
fi; \
fi
endef

_________________
Dave Mortara


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: