All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Kernel Module Compilation Error
  2004-08-31 12:39 Kernel Module Compilation Error Jeba Anandhan A
@ 2004-08-31 11:47 ` Alan Cox
  2004-08-31 12:49 ` Sam Ravnborg
  1 sibling, 0 replies; 7+ messages in thread
From: Alan Cox @ 2004-08-31 11:47 UTC (permalink / raw)
  To: Jeba Anandhan A; +Cc: Linux Kernel Mailing List

On Maw, 2004-08-31 at 13:39, Jeba Anandhan A wrote:
> # gcc -c -DMODULE -D__KERNEL__ currenttask.c
> the following error is shown.
> what should i do?.

You need to build against the kernel headers not the C library headers.
For FC1 see the kernel-source package and for 2.6 see /lib/modules/...
which now contains the right header set and is a more standardised way
of doing it


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Kernel Module Compilation Error
@ 2004-08-31 12:39 Jeba Anandhan A
  2004-08-31 11:47 ` Alan Cox
  2004-08-31 12:49 ` Sam Ravnborg
  0 siblings, 2 replies; 7+ messages in thread
From: Jeba Anandhan A @ 2004-08-31 12:39 UTC (permalink / raw)
  To: linux-kernel


hi,
i am working in Fedora .
Kernel =2.4.22-1.2115.nptl #1 Wed Oct 29 15:42:51 EST
2003 i686 i686 i386 GNU/Linux

my kernel module program is
#include<linux/kernel.h>
#include<linux/module.h>
#include<linux/mm.h>
                                                      
                        extern *current;
int init_module(void){
return 0;
}
void cleanup_module(void){
}
                                                      
                        
~
when i give 
# gcc -c -DMODULE -D__KERNEL__ currenttask.c
the following error is shown.
what should i do?.
how to compile the kernel module with some kernel
header files ?.

In file included from /usr/include/linux/module.h:25,
                 from currenttask.c:2:
/usr/include/asm/atomic.h:40:2: warning: #warning
Using kernel header in userland program. BAD!
In file included from /usr/include/linux/fs.h:26,
                 from
/usr/include/linux/capability.h:17,
                 from /usr/include/linux/binfmts.h:4,
                 from /usr/include/linux/sched.h:10,
                 from /usr/include/linux/mm.h:4,
                 from currenttask.c:3:
/usr/include/asm/bitops.h:327:2: warning: #warning
This includefile is not available on all
architectures.
/usr/include/asm/bitops.h:328:2: warning: #warning
Using kernel headers in userspace: atomicity not
guaranteed
In file included from /usr/include/linux/rwsem.h:21,
                 from
/usr/include/linux/ext3_fs_i.h:19,
                 from /usr/include/linux/fs.h:304,
                 from
/usr/include/linux/capability.h:17,
                 from /usr/include/linux/binfmts.h:4,
                 from /usr/include/linux/sched.h:10,
                 from /usr/include/linux/mm.h:4,
                 from currenttask.c:3:
/usr/include/asm/system.h: In function `__cmpxchg':
/usr/include/asm/system.h:126: error: `LOCK_PREFIX'
undeclared (first use in this function)
/usr/include/asm/system.h:126: error: (Each undeclared
identifier is reported only once
/usr/include/asm/system.h:126: error: for each
function it appears in.)
/usr/include/asm/system.h:126: error: syntax error
before string constant
/usr/include/asm/system.h:132: error: syntax error
before string constant
/usr/include/asm/system.h:138: error: syntax error
before string constant
In file included from /usr/include/linux/fs.h:304,
                 from
/usr/include/linux/capability.h:17,
                 from /usr/include/linux/binfmts.h:4,
                 from /usr/include/linux/sched.h:10,
                 from /usr/include/linux/mm.h:4,
                 from currenttask.c:3:
/usr/include/linux/ext3_fs_i.h: At top level:
/usr/include/linux/ext3_fs_i.h:75: error: field
`truncate_sem' has incomplete type
In file included from /usr/include/linux/fs.h:305,
                 from
/usr/include/linux/capability.h:17,
                 from /usr/include/linux/binfmts.h:4,
                 from /usr/include/linux/sched.h:10,
                 from /usr/include/linux/mm.h:4,
                 from currenttask.c:3:
/usr/include/linux/hpfs_fs_i.h:19: error: field
`i_sem' has incomplete type
In file included from
/usr/include/linux/affs_fs_i.h:7,
                 from /usr/include/linux/fs.h:312,
                 from
/usr/include/linux/capability.h:17,
                 from /usr/include/linux/binfmts.h:4,
                 from /usr/include/linux/sched.h:10,
                 from /usr/include/linux/mm.h:4,
                 from currenttask.c:3:
/usr/include/linux/time.h: In function
`timespec_to_jiffies':
/usr/include/linux/time.h:37: error: `_SC_CLK_TCK'
undeclared (first use in this function)
/usr/include/linux/time.h: In function
`jiffies_to_timespec':
/usr/include/linux/time.h:47: error: `_SC_CLK_TCK'
undeclared (first use in this function)
In file included from /usr/include/linux/fs.h:312,
                 from
/usr/include/linux/capability.h:17,
                 from /usr/include/linux/binfmts.h:4,
                 from /usr/include/linux/sched.h:10,
                 from /usr/include/linux/mm.h:4,
                 from currenttask.c:3:
/usr/include/linux/affs_fs_i.h: At top level:
/usr/include/linux/affs_fs_i.h:27: error: field
`i_link_lock' has incomplete type
/usr/include/linux/affs_fs_i.h:28: error: field
`i_ext_lock' has incomplete type
In file included from /usr/include/linux/fs.h:325,
                 from
/usr/include/linux/capability.h:17,
                 from /usr/include/linux/binfmts.h:4,
                 from /usr/include/linux/sched.h:10,
                 from /usr/include/linux/mm.h:4,
                 from currenttask.c:3:
/usr/include/linux/ncp_fs_i.h:22: error: field
`open_sem' has incomplete type
In file included from /usr/include/linux/fs.h:328,
                 from
/usr/include/linux/capability.h:17,
                 from /usr/include/linux/binfmts.h:4,
                 from /usr/include/linux/sched.h:10,
                 from /usr/include/linux/mm.h:4,
                 from currenttask.c:3:
/usr/include/linux/jffs2_fs_i.h:26: error: field `sem'
has incomplete type
In file included from /usr/include/linux/fs.h:380,
                 from
/usr/include/linux/capability.h:17,
                 from /usr/include/linux/binfmts.h:4,
                 from /usr/include/linux/sched.h:10,
                 from /usr/include/linux/mm.h:4,
                 from currenttask.c:3:
/usr/include/linux/quota.h:284: error: field
`dqio_sem' has incomplete type
/usr/include/linux/quota.h:285: error: field
`dqoff_sem' has incomplete type
In file included from
/usr/include/linux/capability.h:17,
                 from /usr/include/linux/binfmts.h:4,
                 from /usr/include/linux/sched.h:10,
                 from /usr/include/linux/mm.h:4,
                 from currenttask.c:3:
/usr/include/linux/fs.h:429: error: field `sem' has
incomplete type
/usr/include/linux/fs.h:439: error: field `bd_sem' has
incomplete type
/usr/include/linux/fs.h:468: error: field `i_sem' has
incomplete type
/usr/include/linux/fs.h:469: error: field
`i_alloc_sem' has incomplete type
/usr/include/linux/fs.h:470: error: field `i_zombie'
has incomplete type
In file included from /usr/include/linux/fs.h:720,
                 from
/usr/include/linux/capability.h:17,
                 from /usr/include/linux/binfmts.h:4,
                 from /usr/include/linux/sched.h:10,
                 from /usr/include/linux/mm.h:4,
                 from currenttask.c:3:
/usr/include/linux/msdos_fs_sb.h:44: error: field
`fat_lock' has incomplete type
In file included from /usr/include/linux/fs.h:724,
                 from
/usr/include/linux/capability.h:17,
                 from /usr/include/linux/binfmts.h:4,
                 from /usr/include/linux/sched.h:10,
                 from /usr/include/linux/mm.h:4,
                 from currenttask.c:3:
/usr/include/linux/affs_fs_sb.h:28: error: field
`s_bmlock' has incomplete typeIn file included from
/usr/include/linux/fs.h:728,
                 from
/usr/include/linux/capability.h:17,
                 from /usr/include/linux/binfmts.h:4,
                 from /usr/include/linux/sched.h:10,
                 from /usr/include/linux/mm.h:4,
                 from currenttask.c:3:
/usr/include/linux/smb_fs_sb.h:37: error: field `sem'
has incomplete type
In file included from /usr/include/linux/fs.h:735,
                 from
/usr/include/linux/capability.h:17,
                 from /usr/include/linux/binfmts.h:4,
                 from /usr/include/linux/sched.h:10,
                 from /usr/include/linux/mm.h:4,
                 from currenttask.c:3:
/usr/include/linux/ncp_fs_sb.h:46: error: field `sem'
has incomplete type
In file included from /usr/include/linux/fs.h:738,
                 from
/usr/include/linux/capability.h:17,
                 from /usr/include/linux/binfmts.h:4,
                 from /usr/include/linux/sched.h:10,
                 from /usr/include/linux/mm.h:4,
                 from currenttask.c:3:
/usr/include/linux/jffs2_fs_sb.h:30: error: field
`gc_thread_start' has incomplete type
/usr/include/linux/jffs2_fs_sb.h:35: error: field
`alloc_sem' has incomplete type
In file included from
/usr/include/linux/capability.h:17,
                 from /usr/include/linux/binfmts.h:4,
                 from /usr/include/linux/sched.h:10,
                 from /usr/include/linux/mm.h:4,
                 from currenttask.c:3:
/usr/include/linux/fs.h:759: error: field `s_umount'
has incomplete type
/usr/include/linux/fs.h:760: error: field `s_lock' has
incomplete type
/usr/include/linux/fs.h:804: error: field
`s_vfs_rename_sem' has incomplete type
/usr/include/linux/fs.h:813: error: field
`s_nfsd_free_path_sem' has incomplete type
In file included from /usr/include/linux/sched.h:15,
                 from /usr/include/linux/mm.h:4,
                 from currenttask.c:3:
/usr/include/linux/timex.h:63:5: missing binary
operator before token "("
/usr/include/linux/timex.h:65:7: missing binary
operator before token "("
/usr/include/linux/timex.h:67:7: missing binary
operator before token "("
/usr/include/linux/timex.h:69:7: missing binary
operator before token "("
/usr/include/linux/timex.h:71:7: missing binary
operator before token "("
/usr/include/linux/timex.h:73:7: missing binary
operator before token "("
/usr/include/linux/timex.h:75:7: missing binary
operator before token "("
/usr/include/linux/timex.h:78:3: #error You lose.
In file included from /usr/include/linux/sched.h:26,
                 from /usr/include/linux/mm.h:4,
                 from currenttask.c:3:
/usr/include/linux/tty.h:141: error: field `pty_sem'
has incomplete type
/usr/include/linux/tty.h:307: error: field
`atomic_read' has incomplete type
/usr/include/linux/tty.h:308: error: field
`atomic_write' has incomplete type
In file included from /usr/include/linux/signal.h:4,
                 from /usr/include/linux/sched.h:28,
                 from /usr/include/linux/mm.h:4,
                 from currenttask.c:3:
/usr/include/asm/signal.h:107: error: syntax error
before "sigset_t"
/usr/include/asm/signal.h:110: error: syntax error
before '}' token
In file included from /usr/include/linux/sched.h:28,
                 from /usr/include/linux/mm.h:4,
                 from currenttask.c:3:
/usr/include/linux/signal.h:19: error: syntax error
before "sigset_t"
/usr/include/linux/signal.h:31: error: syntax error
before '*' token
/usr/include/linux/signal.h: In function `sigaddset':
/usr/include/linux/signal.h:33: error: `_sig'
undeclared (first use in this function)
/usr/include/linux/signal.h:34: error: `_NSIG_WORDS'
undeclared (first use in this function)
/usr/include/linux/signal.h:35: error: `set'
undeclared (first use in this function)
/usr/include/linux/signal.h:37: error: `_NSIG_BPW'
undeclared (first use in this function)
/usr/include/linux/signal.h: At top level:
/usr/include/linux/signal.h:40: error: syntax error
before '*' token
/usr/include/linux/signal.h: In function `sigdelset':
/usr/include/linux/signal.h:42: error: `_sig'
undeclared (first use in this function)
/usr/include/linux/signal.h:43: error: `_NSIG_WORDS'
undeclared (first use in this function)
/usr/include/linux/signal.h:44: error: `set'
undeclared (first use in this function)
/usr/include/linux/signal.h:46: error: `_NSIG_BPW'
undeclared (first use in this function)
/usr/include/linux/signal.h: At top level:
/usr/include/linux/signal.h:49: error: syntax error
before '*' token
/usr/include/linux/signal.h: In function
`sigismember':
/usr/include/linux/signal.h:51: error: `_sig'
undeclared (first use in this function)
/usr/include/linux/signal.h:52: error: `_NSIG_WORDS'
undeclared (first use in this function)
/usr/include/linux/signal.h:53: error: `set'
undeclared (first use in this function)
/usr/include/linux/signal.h:55: error: `_NSIG_BPW'
undeclared (first use in this function)
/usr/include/linux/signal.h: At top level:
/usr/include/linux/signal.h:108: error: syntax error
before '*' token
/usr/include/linux/signal.h: In function `sigorsets':
/usr/include/linux/signal.h:108: error: `_NSIG_WORDS'
undeclared (first use in this function)
/usr/include/linux/signal.h:108: error: `a' undeclared
(first use in this function)
/usr/include/linux/signal.h:108: error: `b' undeclared
(first use in this function)
/usr/include/linux/signal.h:108: error: `r' undeclared
(first use in this function)
/usr/include/linux/signal.h: At top level:
/usr/include/linux/signal.h:111: error: syntax error
before '*' token
/usr/include/linux/signal.h: In function `sigandsets':
/usr/include/linux/signal.h:111: error: `_NSIG_WORDS'
undeclared (first use in this function)
/usr/include/linux/signal.h:111: error: `a' undeclared
(first use in this function)
/usr/include/linux/signal.h:111: error: `b' undeclared
(first use in this function)
/usr/include/linux/signal.h:111: error: `r' undeclared
(first use in this function)
/usr/include/linux/signal.h: At top level:
/usr/include/linux/signal.h:114: error: syntax error
before '*' token
/usr/include/linux/signal.h: In function
`signandsets':
/usr/include/linux/signal.h:114: error: `_NSIG_WORDS'
undeclared (first use in this function)
/usr/include/linux/signal.h:114: error: `a' undeclared
(first use in this function)
/usr/include/linux/signal.h:114: error: `b' undeclared
(first use in this function)
/usr/include/linux/signal.h:114: error: `r' undeclared
(first use in this function)
/usr/include/linux/signal.h: At top level:
/usr/include/linux/signal.h:140: error: syntax error
before '*' token
/usr/include/linux/signal.h: In function `signotset':
/usr/include/linux/signal.h:140: error: `_NSIG_WORDS'
undeclared (first use in this function)
/usr/include/linux/signal.h:140: error: `set'
undeclared (first use in this function)
/usr/include/linux/signal.h: At top level:
/usr/include/linux/signal.h:145: error: syntax error
before '*' token
/usr/include/linux/signal.h: In function
`sigemptyset':
/usr/include/linux/signal.h:147: error: `_NSIG_WORDS'
undeclared (first use in this function)
/usr/include/linux/signal.h:149: error: `set'
undeclared (first use in this function)
/usr/include/linux/signal.h:149: error: `sigset_t'
undeclared (first use in this function)
/usr/include/linux/signal.h: At top level:
/usr/include/linux/signal.h:157: error: syntax error
before '*' token
/usr/include/linux/signal.h: In function `sigfillset':
/usr/include/linux/signal.h:159: error: `_NSIG_WORDS'
undeclared (first use in this function)
/usr/include/linux/signal.h:161: error: `set'
undeclared (first use in this function)
/usr/include/linux/signal.h:161: error: `sigset_t'
undeclared (first use in this function)
/usr/include/linux/signal.h: At top level:
/usr/include/linux/signal.h:169: error: syntax error
before '*' token
/usr/include/linux/signal.h:173: error: syntax error
before '*' token
/usr/include/linux/signal.h: In function
`sigaddsetmask':
/usr/include/linux/signal.h:175: error: `set'
undeclared (first use in this function)
/usr/include/linux/signal.h:175: error: `mask'
undeclared (first use in this function)
/usr/include/linux/signal.h: At top level:
/usr/include/linux/signal.h:178: error: syntax error
before '*' token
/usr/include/linux/signal.h: In function
`sigdelsetmask':
/usr/include/linux/signal.h:180: error: `set'
undeclared (first use in this function)
/usr/include/linux/signal.h:180: error: `mask'
undeclared (first use in this function)
/usr/include/linux/signal.h: At top level:
/usr/include/linux/signal.h:183: error: syntax error
before '*' token
/usr/include/linux/signal.h: In function
`sigtestsetmask':
/usr/include/linux/signal.h:185: error: `set'
undeclared (first use in this function)
/usr/include/linux/signal.h:185: error: `mask'
undeclared (first use in this function)
/usr/include/linux/signal.h: At top level:
/usr/include/linux/signal.h:188: error: syntax error
before '*' token
/usr/include/linux/signal.h: In function `siginitset':
/usr/include/linux/signal.h:190: error: `set'
undeclared (first use in this function)
/usr/include/linux/signal.h:190: error: `mask'
undeclared (first use in this function)
/usr/include/linux/signal.h:191: error: `_NSIG_WORDS'
undeclared (first use in this function)
/usr/include/linux/signal.h: At top level:
/usr/include/linux/signal.h:200: error: syntax error
before '*' token
/usr/include/linux/signal.h: In function
`siginitsetinv':
/usr/include/linux/signal.h:202: error: `set'
undeclared (first use in this function)
/usr/include/linux/signal.h:202: error: `mask'
undeclared (first use in this function)
/usr/include/linux/signal.h:203: error: `_NSIG_WORDS'
undeclared (first use in this function)
/usr/include/linux/signal.h: In function
`init_sigpending':
/usr/include/linux/signal.h:216: error: dereferencing
pointer to incomplete type
/usr/include/linux/signal.h:217: error: dereferencing
pointer to incomplete type
/usr/include/linux/signal.h:218: error: dereferencing
pointer to incomplete type
/usr/include/linux/signal.h:218: error: dereferencing
pointer to incomplete type
In file included from /usr/include/linux/mm.h:4,
                 from currenttask.c:3:
/usr/include/linux/sched.h: At top level:
/usr/include/linux/sched.h:273: error: syntax error
before "pgd_t"
/usr/include/linux/sched.h:293: error: syntax error
before ':' token
/usr/include/linux/sched.h:301: error: syntax error
before '}' token
/usr/include/linux/sched.h:325: error: `_NSIG'
undeclared here (not in a function)
/usr/include/linux/sched.h:343: error: field
`shared_pending' has incomplete type
/usr/include/linux/sched.h:513: error: syntax error
before "sigset_t"
/usr/include/linux/sched.h:520: error: syntax error
before '*' token
/usr/include/linux/sched.h:535: error: syntax error
before '}' token
/usr/include/linux/sched.h:728: error: field `task'
has incomplete type
In file included from /usr/include/linux/mm.h:4,
                 from currenttask.c:3:
/usr/include/linux/sched.h:742:25: asm/current.h: No
such file or directory
/usr/include/linux/sched.h:782: error: syntax error
before '*' token
/usr/include/linux/sched.h:784: error: syntax error
before "sigset_t"
/usr/include/linux/sched.h: In function
`signal_pending':
/usr/include/linux/sched.h:806: error: dereferencing
pointer to incomplete type/usr/include/linux/sched.h:
In function `on_sig_stack':
/usr/include/linux/sched.h:813: error: `current'
undeclared (first use in this function)
/usr/include/linux/sched.h: In function
`sas_ss_flags':
/usr/include/linux/sched.h:818: error: `current'
undeclared (first use in this function)
/usr/include/linux/sched.h: In function `suser':
/usr/include/linux/sched.h:843: error: `current'
undeclared (first use in this function)
/usr/include/linux/sched.h: In function `fsuser':
/usr/include/linux/sched.h:852: error: `current'
undeclared (first use in this function)
/usr/include/linux/sched.h: In function `capable':
/usr/include/linux/sched.h:868: error: `current'
undeclared (first use in this function)
/usr/include/linux/sched.h: In function `mmdrop':
/usr/include/linux/sched.h:891: error: dereferencing
pointer to incomplete type/usr/include/linux/sched.h:
At top level:
/usr/include/linux/sched.h:948: error: conflicting
types for `kernel_thread'
/usr/include/asm/processor.h:435: error: previous
declaration of `kernel_thread'
/usr/include/linux/sched.h: In function
`thread_group_empty':
/usr/include/linux/sched.h:1076: error: dereferencing
pointer to incomplete type
/usr/include/linux/sched.h: In function `task_lock':
/usr/include/linux/sched.h:1089: error: dereferencing
pointer to incomplete type
/usr/include/linux/sched.h: In function `get_task_mm':
/usr/include/linux/sched.h:1108: error: dereferencing
pointer to incomplete type
/usr/include/linux/sched.h:1110: error: dereferencing
pointer to incomplete type
/usr/include/linux/sched.h: In function `d_path':
/usr/include/linux/sched.h:1123: error: `current'
undeclared (first use in this function)
/usr/include/linux/sched.h: In function
`set_need_resched':
/usr/include/linux/sched.h:1137: error: `current'
undeclared (first use in this function)
/usr/include/linux/sched.h: In function
`clear_need_resched':
/usr/include/linux/sched.h:1142: error: `current'
undeclared (first use in this function)
/usr/include/linux/sched.h: In function
`set_tsk_need_resched':
/usr/include/linux/sched.h:1147: error: dereferencing
pointer to incomplete type
/usr/include/linux/sched.h: In function
`clear_tsk_need_resched':
/usr/include/linux/sched.h:1152: error: dereferencing
pointer to incomplete type
/usr/include/linux/sched.h: In function
`need_resched':
/usr/include/linux/sched.h:1157: error: `current'
undeclared (first use in this function)
In file included from currenttask.c:3:
/usr/include/linux/mm.h:26:25: asm/pgtable.h: No such
file or directory
In file included from currenttask.c:3:
/usr/include/linux/mm.h: At top level:
/usr/include/linux/mm.h:53: error: syntax error before
"pgprot_t"
/usr/include/linux/mm.h:75: error: syntax error before
'}' token
/usr/include/linux/mm.h:129: error: syntax error
before "protection_map"
/usr/include/linux/mm.h:495: error: syntax error
before "pgprot_t"
/usr/include/linux/mm.h:496: error: syntax error
before "pgprot_t"
/usr/include/linux/mm.h:499: error: syntax error
before '*' token
/usr/include/linux/mm.h:499: error: syntax error
before "pgd_t"
/usr/include/linux/mm.h:500: error: syntax error
before '*' token
/usr/include/linux/mm.h:500: error: syntax error
before "pmd_t"
/usr/include/linux/mm.h:514: error: syntax error
before '*' token
/usr/include/linux/mm.h:514: error: syntax error
before "pgd_t"
/usr/include/linux/mm.h: In function `pmd_alloc':
/usr/include/linux/mm.h:516: error: `pgd' undeclared
(first use in this function)
/usr/include/linux/mm.h:517: error: `mm' undeclared
(first use in this function)
/usr/include/linux/mm.h:517: error: `address'
undeclared (first use in this function)
/usr/include/linux/mm.h: In function `__vma_unlink':
/usr/include/linux/mm.h:581: error: dereferencing
pointer to incomplete type
/usr/include/linux/mm.h:581: error: dereferencing
pointer to incomplete type
/usr/include/linux/mm.h:582: error: dereferencing
pointer to incomplete type
/usr/include/linux/mm.h:582: error: dereferencing
pointer to incomplete type
/usr/include/linux/mm.h:583: error: dereferencing
pointer to incomplete type
/usr/include/linux/mm.h:584: error: dereferencing
pointer to incomplete type
/usr/include/linux/mm.h:585: error: dereferencing
pointer to incomplete type
/usr/include/linux/mm.h: In function `can_vma_merge':
/usr/include/linux/mm.h:590: error: dereferencing
pointer to incomplete type
/usr/include/linux/mm.h:590: error: dereferencing
pointer to incomplete type
/usr/include/linux/mm.h: In function `pf_gfp_mask':
/usr/include/linux/mm.h:638: error: `current'
undeclared (first use in this function)
/usr/include/linux/mm.h: In function
`find_vma_intersection':
/usr/include/linux/mm.h:658: error: dereferencing
pointer to incomplete type
currenttask.c: At top level:
/usr/include/linux/sched.h:277: error: storage size of
`mmap_sem' isn't known
/usr/include/linux/sched.h:514: error: storage size of
`pending' isn't known


		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Kernel Module Compilation Error
  2004-08-31 12:39 Kernel Module Compilation Error Jeba Anandhan A
  2004-08-31 11:47 ` Alan Cox
@ 2004-08-31 12:49 ` Sam Ravnborg
  1 sibling, 0 replies; 7+ messages in thread
From: Sam Ravnborg @ 2004-08-31 12:49 UTC (permalink / raw)
  To: Jeba Anandhan A; +Cc: linux-kernel

>
> hi,
> i am working in Fedora .
> Kernel =2.4.22-1.2115.nptl #1 Wed Oct 29 15:42:51 EST
> 2003 i686 i686 i386 GNU/Linux
>
> my kernel module program is
> #include<linux/kernel.h>
> #include<linux/module.h>
> #include<linux/mm.h>
>
>                         extern *current;
> int init_module(void){
> return 0;
> }
> void cleanup_module(void){
> }

Use a kbuld makefile:
obj-m := myfile.o

and compile using:
make -C path/to/kernel/src SUBDIRS=`pwd` modules

   Sam




^ permalink raw reply	[flat|nested] 7+ messages in thread

* kernel module compilation error
@ 2009-05-15 11:51 Vijay Nikam
  0 siblings, 0 replies; 7+ messages in thread
From: Vijay Nikam @ 2009-05-15 11:51 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Scott Wood, Ron Madrid

Hello All,

I upgraded the Linux kernel version from 2.6.20 to 2.6.23 on eval
board mpc8313erdb. Then I wrote a simple hello_world kernel module for
testing but when I do make it gives following compilation error.
Whereas I did not had this problem with kernel 2.6.20 !!!

It says; 'include/asm/current.h:35: error: invalid register name for =91cur=
rent=92'

Following is complete error log

################################
make -C /usr/local/mpc8313/linux-2.6.23 M=3D/opt/test/module/hello_world mo=
dules
make[1]: Entering directory `/usr/local/mpc8313/linux-2.6.23'
CC [M] /opt/test/module/hello_world/hello.o
In file included from include/linux/capability.h:48,
from include/linux/sched.h:50,
from include/asm/elf.h:6,
from include/linux/elf.h:8,
from include/linux/module.h:15,
from /opt/test/module/hello_world/hello.c:5:
include/asm/current.h:35: error: invalid register name for =91current=92
make[2]: *** [/opt/test/module/hello_world/hello.o] Error 1
make[1]: *** [_module_/opt/test/module/hello_world] Error 2
make[1]: Leaving directory `/usr/local/mpc8313/linux-2.6.23'
make: *** [all] Error 2
############################################

Could anyone please let me know the way to proceed or a way to think
to resolve this issue ? ? ?

Kindly please acknowledge ... thank you.

Kind Regards,
Vijay Nikam

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Kernel Module Compilation error
  2014-04-14 21:56 Kernel Module Compilation error Arun M Kumar
@ 2014-04-14 16:32 ` Pranay Kr. Srivastava
  2014-04-14 16:58 ` Valdis.Kletnieks at vt.edu
  1 sibling, 0 replies; 7+ messages in thread
From: Pranay Kr. Srivastava @ 2014-04-14 16:32 UTC (permalink / raw)
  To: kernelnewbies



On April 15, 2014 3:26:14 AM GMT+05:30, Arun M Kumar <arunkr.linux@gmail.com> wrote:
>Hi,
>
>     I get the following error while compiling my very basic kernel 
>Module (a hello world module)
>
>*
>//--------------------------------------------------------------------------------------------------------------*
>make -C /home/arun/Dev/linux-stable M=/home/arun/Dev/practice/Kmodules 
>modules
>make[1]: Entering directory `/home/arun/Dev/linux-stable'
>
>WARNING: Symbol version dump /home/arun/Dev/linux-stable/Module.symvers
>         is missing; modules will have no dependencies and modversions.
>
Your linux-stable is build right? If not try to build it first then compile your module.

>   CC [M]  /home/arun/Dev/practice/Kmodules/Hello_world.o
>/home/arun/Dev/practice/Kmodules/Hello_world.c:1:0: error: code model 
>'kernel' not supported in the 32 bit mode
>/home/arun/Dev/practice/Kmodules/Hello_world.c:1:0: sorry, 
>unimplemented: 64-bit mode not compiled in
>make[2]: *** [/home/arun/Dev/practice/Kmodules/Hello_world.o] Error 1
>make[1]: *** [_module_/home/arun/Dev/practice/Kmodules] Error 2
>make[1]: Leaving directory `/home/arun/Dev/linux-stable'
>make: *** [all] Error 2
>*//-----------------------------------------------------------------------------------------------------------------*
>
>what could be the possible cause of this error?
>
>on my system
>
>*$uname -a*
>
This is your running /installed kernel not the one you are building it against.

>returns the following..
>
>*Linux linux-xh55.site 3.4.6-2.10-desktop #1 SMP PREEMPT Thu Jul 26 
>09:36:26 UTC 2012 (641c197) i686 i686 i386 GNU/Linux*
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Kernelnewbies mailing list
>Kernelnewbies at kernelnewbies.org
>http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Kernel Module Compilation error
  2014-04-14 21:56 Kernel Module Compilation error Arun M Kumar
  2014-04-14 16:32 ` Pranay Kr. Srivastava
@ 2014-04-14 16:58 ` Valdis.Kletnieks at vt.edu
  1 sibling, 0 replies; 7+ messages in thread
From: Valdis.Kletnieks at vt.edu @ 2014-04-14 16:58 UTC (permalink / raw)
  To: kernelnewbies

On Tue, 15 Apr 2014 03:26:14 +0530, Arun M Kumar said:

> /home/arun/Dev/practice/Kmodules/Hello_world.c:1:0: error: code model 'kernel' not supported in the 32 bit mode
> /home/arun/Dev/practice/Kmodules/Hello_world.c:1:0: sorry, unimplemented: 64-bit mode not compiled in

> what could be the possible cause of this error?

Based on the error messages, I'd say you're trying to compile in 64-bit mode
with a compiler build to support only 32-bit, or similar.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140414/5d0137d3/attachment.bin 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Kernel Module Compilation error
@ 2014-04-14 21:56 Arun M Kumar
  2014-04-14 16:32 ` Pranay Kr. Srivastava
  2014-04-14 16:58 ` Valdis.Kletnieks at vt.edu
  0 siblings, 2 replies; 7+ messages in thread
From: Arun M Kumar @ 2014-04-14 21:56 UTC (permalink / raw)
  To: kernelnewbies

Hi,

     I get the following error while compiling my very basic kernel 
Module (a hello world module)

*
//--------------------------------------------------------------------------------------------------------------*
make -C /home/arun/Dev/linux-stable M=/home/arun/Dev/practice/Kmodules 
modules
make[1]: Entering directory `/home/arun/Dev/linux-stable'

   WARNING: Symbol version dump /home/arun/Dev/linux-stable/Module.symvers
            is missing; modules will have no dependencies and modversions.

   CC [M]  /home/arun/Dev/practice/Kmodules/Hello_world.o
/home/arun/Dev/practice/Kmodules/Hello_world.c:1:0: error: code model 
'kernel' not supported in the 32 bit mode
/home/arun/Dev/practice/Kmodules/Hello_world.c:1:0: sorry, 
unimplemented: 64-bit mode not compiled in
make[2]: *** [/home/arun/Dev/practice/Kmodules/Hello_world.o] Error 1
make[1]: *** [_module_/home/arun/Dev/practice/Kmodules] Error 2
make[1]: Leaving directory `/home/arun/Dev/linux-stable'
make: *** [all] Error 2
*//-----------------------------------------------------------------------------------------------------------------*

what could be the possible cause of this error?

on my system

*$uname -a*

returns the following..

*Linux linux-xh55.site 3.4.6-2.10-desktop #1 SMP PREEMPT Thu Jul 26 
09:36:26 UTC 2012 (641c197) i686 i686 i386 GNU/Linux*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140415/824dc2a5/attachment.html 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-04-14 21:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-14 21:56 Kernel Module Compilation error Arun M Kumar
2014-04-14 16:32 ` Pranay Kr. Srivastava
2014-04-14 16:58 ` Valdis.Kletnieks at vt.edu
  -- strict thread matches above, loose matches on Subject: below --
2009-05-15 11:51 kernel module compilation error Vijay Nikam
2004-08-31 12:39 Kernel Module Compilation Error Jeba Anandhan A
2004-08-31 11:47 ` Alan Cox
2004-08-31 12:49 ` Sam Ravnborg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.