sem has incomplete type error in building the filesystem image

Nov 26, 2004 1 Replies

Hi all,



I am using snapgear3.1.1v for porting 2.6.2 on to my target board with ELANSc520 processor.i have build the kernel image and when building hte filesystem jffs2.img image i am encountouring the below error.



**************************************************************************** /home/sudheer/snapgear3.1.1/linux-2.6.x/include/linux/bitmap.h: In function `bitmap_clear': /home/sudheer/snapgear3.1.1/linux-2.6.x/include/linux/bitmap.h:21: warning: implicit declaration of function `CLEAR_BITMAP' /home/sudheer/snapgear3.1.1/linux-2.6.x/include/linux/bitmap.h: In function `bitmap_fill': /home/sudheer/snapgear3.1.1/linux-2.6.x/include/linux/bitmap.h:26: warning: implicit declaration of function `BITS_TO_LONGS'

In file included from /home/sudheer/snapgear3.1.1/linux-2.6.x/include/linux/sched.h:21, from /home/sudheer/snapgear3.1.1/linux-2.6.x/include/linux/mm.h:4, from /home/sudheer/snapgear3.1.1/linux-2.6.x/include/linux/mman.h:5, from mem.c:36: /home/sudheer/snapgear3.1.1/linux-2.6.x/include/asm/mmu.h: At top level: /home/sudheer/snapgear3.1.1/linux-2.6.x/include/asm/mmu.h:13: field `sem' has incomplete type /home/sudheer/snapgear3.1.1/linux-2.6.x/include/asm/mmu.h:15: confused by earlier errors, bailing out make[2]: *** [mem.o] Error 1 make[1]: *** [all] Error 2 make: *** [subdirs] Error 1


******************************************************************************

What could be the problem ,i came to see that the sem has incomplete type in mmu.h file in asm directory.It was declared as struct semaphore.Does it was an incomplete data type for the sem variable.Please help me to resolve this problem.Do i require any packages,i have downloaded the snapgear 3.1.1 and tool chain i386-linux -tools for i386 based arch.



With best Regards, Sudheervemana.


you will see in mmu.h #include in linux-2.6.x/include/asm-i386/semaphore.h, you should be able to see:

struct semaphore { atomic_t count; int sleepers; wait_queue_head_t wait; #ifdef WAITQUEUE_DEBUG long __magic; #endif };

however, this is inside a #ifdef __KERNEL__ which means if you're not building the kernel itself, it won't be defined. I'm not sure at exactly which stage your jffs2 build is trying to use this (perhaps the mtd utilities?) but copying the 'struct semaphore' declaration into the bottom section may work.

--- /tmp/semaphore.h 2004-11-29 10:16:01.000000000 +1000

+++ linux-2.6.x/include/asm-i386/semaphore.h 2004-11-29 10:16:04.000000000 +1000 @@ -214,4 +214,12 @@ }

#endif

+struct semaphore {
  • atomic_t count;
  • int sleepers;
  • wait_queue_head_t wait;
+#ifdef WAITQUEUE_DEBUG
  • long __magic;
+#endif +}; #endif

good luck.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Damion de Soto - Software Engineer email: damion@snapgear.com SnapGear - A CyberGuard Company --- ph: +61 7 3435 2809 | Custom Embedded Solutions fax: +61 7 3891 3630 | and Security Appliances web: http://www.snapgear.com~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- Free Embedded Linux Distro at http://www.snapgear.org ---

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required