2.6.29 not compiling

50 views
Skip to first unread message

Chirag Anand

unread,
Apr 7, 2009, 1:25:29 AM4/7/09
to gle...@googlegroups.com

Hey,

I was trying to compile the 2.6.29 kernel after patching it, as mentioned on quick start page. I am getting these errors:

plan9/syscalls.c: In function ‘sys_plan9_rfork’:
plan9/syscalls.c:362: error: incompatible type for argument 1 of ‘sys_clone’
plan9/syscalls.c:362: error: too few arguments to function ‘sys_clone’

Then I looked up at the clone manual and found this:

" Thus, sys_clone only requires the flags and child_stack arguments, which have the same meaning as for clone()." 

and,

"Since Linux 2.5.49 the system call (sys_clone) has five arguments. The two new arguments are parent_tidptr which points to the location (in parent and child memory) where the child thread ID will be written in case CLONE_PARENT_SETTID was specified, and child_tidptr which points to the location (in child memory) where the child thread ID will be written in case CLONE_CHILD_SETTID was specified."

The fifth argument is not specified (only 4), thus I'm confused now, I even tried passing 2 arguments (FLAGS, 0), but it was still showing this error.


--
Regards

Chirag Anand
4th Year, B.Tech
Computer Science Department, JUIT Solan

Blog :http://techfreaks4u.com/blog
Linux User: 476783

anything weird is worth a try...

J.R. Mauro

unread,
Apr 7, 2009, 1:34:15 AM4/7/09
to gle...@googlegroups.com
sys_clone seems to just take a pt_regs struct these days.

do_fork() still takes the good old fashioned parameters, we might have
to switch and use that, otherwise we'll have to mung the arguments
into registers.

This is all assuming that I actually read the code right, and since
it's 2 am right now, chances of that being true are in peril.

Henry Huang

unread,
Apr 7, 2009, 4:04:28 AM4/7/09
to gle...@googlegroups.com
i do not have that kind of errors but these as follows:(
---------------------------------------------------------------------
  CHK     include/linux/version.h
  CHK     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-x86
  CALL    scripts/checksyscalls.sh
  CHK     include/linux/compile.h
dnsdomainname: Unknown host
  GEN     .version
  CHK     include/linux/compile.h
dnsdomainname: Unknown host
  UPD     include/linux/compile.h
  CC      init/version.o
  LD      init/built-in.o
  LD      .tmp_vmlinux1
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x544): undefined reference to `sys_plan9_unimplemented'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x548): undefined reference to `sys_plan9_deprecated'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x54c): undefined reference to `sys_plan9_unimplemented'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x550): undefined reference to `sys_plan9_chdir'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x554): undefined reference to `sys_plan9_close'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x558): undefined reference to `sys_plan9_dup'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x55c): undefined reference to `sys_plan9_unimplemented'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x560): undefined reference to `sys_plan9_unimplemented'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x564): undefined reference to `sys_plan9_exits'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x568): undefined reference to `sys_plan9_deprecated'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x56c): undefined reference to `sys_plan9_unimplemented'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x570): undefined reference to `sys_plan9_deprecated'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x574): undefined reference to `sys_plan9_unimplemented'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x578): undefined reference to `sys_plan9_deprecated'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x57c): undefined reference to `sys_plan9_open'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x580): undefined reference to `sys_plan9_deprecated'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x584): undefined reference to `sys_plan9_unimplemented'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x588): undefined reference to `sys_plan9_sleep'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x58c): undefined reference to `sys_plan9_deprecated'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x590): undefined reference to `sys_plan9_unimplemented'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x594): undefined reference to `sys_plan9_deprecated'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x598): undefined reference to `sys_plan9_unimplemented'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x59c): undefined reference to `sys_plan9_create'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x5a0): undefined reference to `sys_plan9_fd2path'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x5a4): undefined reference to `sys_plan9_brk'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x5a8): undefined reference to `sys_plan9_remove'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x5ac): undefined reference to `sys_plan9_deprecated'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x5b0): undefined reference to `sys_plan9_deprecated'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x5b4): undefined reference to `sys_plan9_unimplemented'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x5b8): undefined reference to `sys_plan9_unimplemented'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x5bc): undefined reference to `sys_plan9_unimplemented'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x5c0): undefined reference to `sys_plan9_unimplemented'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x5c4): undefined reference to `sys_plan9_unimplemented'
arch/x86/kernel/built-in.o:(.rodata+0x5c8): more undefined references to `sys_plan9_unimplemented' follow
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x5d4): undefined reference to `sys_plan9_deprecated'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x5d8): undefined reference to `sys_plan9_unimplemented'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x5dc): undefined reference to `sys_plan9_unimplemented'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x5e0): undefined reference to `sys_plan9_seek'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x5e4): undefined reference to `sys_plan9_unimplemented'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x5e8): undefined reference to `sys_plan9_unimplemented'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x5ec): undefined reference to `sys_plan9_unimplemented'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x5f0): undefined reference to `sys_plan9_unimplemented'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x5f4): undefined reference to `sys_plan9_unimplemented'
arch/x86/kernel/built-in.o:(.rodata+0x5f8): more undefined references to `sys_plan9_unimplemented' follow
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x60c): undefined reference to `sys_plan9_pread'
arch/x86/kernel/built-in.o: In function `plan9_syscall_table':
(.rodata+0x610): undefined reference to `sys_plan9_pwrite'
make: *** [.tmp_vmlinux1] Error 1
-----------------------------------------------------

Henry Huang

unread,
Apr 7, 2009, 4:13:55 AM4/7/09
to gle...@googlegroups.com
Sorry for such a long paste!
these errors happen while i try to compile **Plan9 binary** as a module.
If i choose to build it in the kernel, no errors again! :)

Anant Narayanan

unread,
Apr 7, 2009, 4:32:16 AM4/7/09
to gle...@googlegroups.com
On 07-Apr-09, at 10:13 AM, Henry Huang wrote:
> Sorry for such a long paste!
> these errors happen while i try to compile **Plan9 binary** as a
> module.
> If i choose to build it in the kernel, no errors again! :)

The system call patches are meant to be built into the kernel, there
is no way to define plan9_syscall_table in a module. As for building
the loader as a module, I'm not quite sure if building it as a module
currently works, but in principle it should.

I'm building everything into the kernel in my tests :)

--
Anant

Chirag Anand

unread,
Apr 7, 2009, 5:57:04 PM4/7/09
to gle...@googlegroups.com

I still cant understand, why its giving me errors with rfork() (sys_clone)?  (I'm building everything into the kernel itself.)

Daniel Cordero

unread,
Apr 7, 2009, 6:07:20 PM4/7/09
to Chirag Anand, gle...@googlegroups.com
On Wed, Apr 08, 2009 at 03:26:40AM +0530, Chirag Anand wrote:
> I still cant understand, why its giving me errors with rfork() (sys_clone)?
> (I'm building everything into the kernel itself.)
>
Change plan9/syscalls.c:362 to:
ret = sys_clone(&regs);

sys_clone() wants a pointer to a pt_regs struct.

J.R. Mauro

unread,
Apr 7, 2009, 6:09:04 PM4/7/09
to gle...@googlegroups.com, Chirag Anand
Are we sure the values in pt_regs are what we want to pass to
sys_clone here? We're trying to translate Plan 9 flags to Linux
flags---I would think that we have to call do_fork() explicitly, since
we can't pass the flags we want to sys_clone() anymore.

>
> >
>

Chirag Anand

unread,
Apr 7, 2009, 6:14:57 PM4/7/09
to gle...@googlegroups.com

Are we sure the values in pt_regs are what we want to pass to
sys_clone here? We're trying to translate Plan 9 flags to Linux
flags---I would think that we have to call do_fork() explicitly, since
we can't pass the flags we want to sys_clone() anymore.

Well, do_fork() will be our final candidate, but even this should work. The latest clone() manual says that sys_clone needs 5 arguments, but the function definition says only one. Things are kinda unclear.

J.R. Mauro

unread,
Apr 7, 2009, 6:26:12 PM4/7/09
to gle...@googlegroups.com
On Tue, Apr 7, 2009 at 6:14 PM, Chirag Anand <anand....@gmail.com> wrote:
>
>> Are we sure the values in pt_regs are what we want to pass to
>> sys_clone here? We're trying to translate Plan 9 flags to Linux
>> flags---I would think that we have to call do_fork() explicitly, since
>> we can't pass the flags we want to sys_clone() anymore.
>>
> Well, do_fork() will be our final candidate, but even this should work. The
> latest clone() manual says that sys_clone needs 5 arguments, but the
> function definition says only one. Things are kinda unclear.

The manpages refer to userspace wrappers around the kernel calls,
which are different and take different arguments. Since we're in
kernel space, the userspace wrapper taking 5 arguments means nothing
to us. Plus, the manpages aren't necessarily up to date, anyway.

Chirag Anand

unread,
Apr 7, 2009, 6:31:29 PM4/7/09
to gle...@googlegroups.com, theap...@gmail.com, jrm...@gmail.com
The manpages refer to userspace wrappers around the kernel calls,
which are different and take different arguments. Since we're in
kernel space, the userspace wrapper taking 5 arguments means nothing
to us. Plus, the manpages aren't necessarily up to date, anyway.

 The clone() man page describes sys_clone() as well. I checked the latest manpages from kernel.org, but quite possible they aren't up to date.
Change plan9/syscalls.c:362 to:
               ret = sys_clone(&regs);

sys_clone() wants a pointer to a pt_regs struct.

Even this is not working.

J.R. Mauro

unread,
Apr 7, 2009, 6:50:27 PM4/7/09
to Chirag Anand, gle...@googlegroups.com, theap...@gmail.com
On Tue, Apr 7, 2009 at 6:31 PM, Chirag Anand <anand....@gmail.com> wrote:
>
>> The manpages refer to userspace wrappers around the kernel calls,
>> which are different and take different arguments. Since we're in
>> kernel space, the userspace wrapper taking 5 arguments means nothing
>> to us. Plus, the manpages aren't necessarily up to date, anyway.
>>
>  The clone() man page describes sys_clone() as well. I checked the latest
> manpages from kernel.org, but quite possible they aren't up to date.

Mine says: "sys_clone only requires the flags and child_stack arguments"

>>
>> Change plan9/syscalls.c:362 to:
>>                ret = sys_clone(&regs);
>>
>> sys_clone() wants a pointer to a pt_regs struct.
>>
> Even this is not working.

I think we should just be using do_fork()

Anant Narayanan

unread,
Apr 7, 2009, 6:55:29 PM4/7/09
to gle...@googlegroups.com
On 07-Apr-09, at 11:57 PM, Chirag Anand wrote:
> I still cant understand, why its giving me errors with rfork()
> (sys_clone)? (I'm building everything into the kernel itself.)
>

The code compiled just fine before I committed it. In any case, as
others have suggested, we should really be using do_fork() instead.

--
Anant

Chirag Anand

unread,
Apr 7, 2009, 6:56:59 PM4/7/09
to J.R. Mauro, gle...@googlegroups.com, theap...@gmail.com

>Mine says: "sys_clone only requires the flags and child_stack arguments"
That was the reason, I used 2 arguments with sys_clone in the initial rfork() patch i submitted. 
>I think we should just be using do_fork()
Yeah right. I'll start with this. 
But how can other people compile the kernel?

Henry Huang

unread,
Apr 7, 2009, 10:02:32 PM4/7/09
to gle...@googlegroups.com
On Wed, Apr 8, 2009 at 6:56 AM, Chirag Anand <anand....@gmail.com> wrote:
>
>>Mine says: "sys_clone only requires the flags and child_stack arguments"
> That was the reason, I used 2 arguments with sys_clone in the initial
> rfork() patch i submitted.
>>I think we should just be using do_fork()
> Yeah right. I'll start with this.
> But how can other people compile the kernel?

How could i get through compiling the patched kernel without any errors?
i am quite confused :(
Reply all
Reply to author
Forward
0 new messages