On Tuesday 22 March 2005 21:04, Ian McDonald wrote:
> Yes it is GCC specific but if you remove the double up of the enum
> define in sys_call_table.c it will work for ALL versions....
Correct, just that 2.6.11 almost works for almost everyone. Actually the bug 
you hit is not compilation-only, sadly... ASAP I'll submit the cleaned-up 
patch.
>
> I presume you have read both things... e-mail below in case you haven't

> ----
> OK after much further investigation, redownloading of source
> (2.6.11.4) and looking at what you have said I know why it is
> breaking....
>
> I had assumed (wrongly of course) that ARCH_SYSCALLS was a one line
> symbol definition but it is much more than this.
>
> The problem occurs because in both
> arch/um/include/sysdep-i386/syscalls.h and in
> arch/um/kernel/sys_call_table.c a number of the elements are defined
> in BOTH files.
>
> I presume the reason why this doesn't break others systems is that
> they are not using the same version of gcc as me (2.95.4). I would
> guess that with a later gcc in an enum you can redefine an element and
> it doesn't complain...
It seems so, and it's maybe a GCC bug... I'd like to investigate this but 
maybe I've not the time.
> Anyway I believe the proper fix is to delete the lines from
> arch/um/kernel/sys_call_table.c and here is a patch to do that:
>
> 255d254
> <       [ __NR_statfs64 ] = (syscall_handler_t *) sys_statfs64,
> 258,260d256
> <       [ __NR_utimes ] = (syscall_handler_t *) sys_utimes,
> <       [ __NR_fadvise64_64 ] = (syscall_handler_t *) sys_fadvise64_64,
> <       [ __NR_vserver ] = (syscall_handler_t *) sys_vserver,
>
> Can somebody verify that and if correct submit to whoever (this is my
> first ever attempt at fixing something in the kernel so not quite sure
> what to do next!!)
With the patch above, I don't think it can compile (fstatfs64 is still 
duplicated).

Also, there are a bit of other problems (some not compilation related) and 
some order issues because generic syscalls should be in sys_call_table.c and 
arch-specific ones (for instance existing on some arch and not on others) 
should be in the ARCH_SYSCALLS macros.

So, try and report about the attached patch.
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>
---

 linux-2.6.11-paolo/arch/um/include/sysdep-i386/syscalls.h   |    9 ++-------
 linux-2.6.11-paolo/arch/um/include/sysdep-x86_64/syscalls.h |    4 ----
 linux-2.6.11-paolo/arch/um/kernel/sys_call_table.c          |    6 ++----
 3 files changed, 4 insertions(+), 15 deletions(-)

diff -puN arch/um/include/sysdep-i386/syscalls.h~uml-quick-fix-syscall-table arch/um/include/sysdep-i386/syscalls.h
--- linux-2.6.11/arch/um/include/sysdep-i386/syscalls.h~uml-quick-fix-syscall-table	2005-03-22 21:15:08.000000000 +0100
+++ linux-2.6.11-paolo/arch/um/include/sysdep-i386/syscalls.h	2005-03-22 21:21:45.000000000 +0100
@@ -69,8 +69,6 @@ extern long sys_mmap2(unsigned long addr
 	[ __NR_fstat64 ] = (syscall_handler_t *) sys_fstat64, \
 	[ __NR_fcntl64 ] = (syscall_handler_t *) sys_fcntl64, \
 	[ __NR_sendfile64 ] = (syscall_handler_t *) sys_sendfile64, \
-	[ __NR_statfs64 ] = (syscall_handler_t *) sys_statfs64, \
-	[ __NR_fstatfs64 ] = (syscall_handler_t *) sys_fstatfs64, \
 	[ __NR_fadvise64_64 ] = (syscall_handler_t *) sys_fadvise64_64, \
 	[ __NR_select ] = (syscall_handler_t *) old_select, \
 	[ __NR_vm86old ] = (syscall_handler_t *) sys_ni_syscall, \
@@ -101,15 +99,12 @@ extern long sys_mmap2(unsigned long addr
 	[ 223 ] = (syscall_handler_t *) sys_ni_syscall, \
 	[ __NR_set_thread_area ] = (syscall_handler_t *) sys_ni_syscall, \
 	[ __NR_get_thread_area ] = (syscall_handler_t *) sys_ni_syscall, \
-	[ __NR_fadvise64 ] = (syscall_handler_t *) sys_fadvise64, \
 	[ 251 ] = (syscall_handler_t *) sys_ni_syscall, \
-        [ __NR_remap_file_pages ] = (syscall_handler_t *) sys_remap_file_pages, \
-	[ __NR_utimes ] = (syscall_handler_t *) sys_utimes, \
-	[ __NR_vserver ] = (syscall_handler_t *) sys_ni_syscall,
+        [ __NR_remap_file_pages ] = (syscall_handler_t *) sys_remap_file_pages,
         
 /* 222 doesn't yet have a name in include/asm-i386/unistd.h */
 
-#define LAST_ARCH_SYSCALL __NR_vserver
+#define LAST_ARCH_SYSCALL __NR_remap_file_pages
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
diff -puN arch/um/kernel/sys_call_table.c~uml-quick-fix-syscall-table arch/um/kernel/sys_call_table.c
--- linux-2.6.11/arch/um/kernel/sys_call_table.c~uml-quick-fix-syscall-table	2005-03-22 21:15:08.000000000 +0100
+++ linux-2.6.11-paolo/arch/um/kernel/sys_call_table.c	2005-03-22 21:21:45.000000000 +0100
@@ -251,12 +251,10 @@ syscall_handler_t *sys_call_table[] = {
 	[ __NR_clock_gettime ] = (syscall_handler_t *) sys_clock_gettime,
 	[ __NR_clock_getres ] = (syscall_handler_t *) sys_clock_getres,
 	[ __NR_clock_nanosleep ] = (syscall_handler_t *) sys_clock_nanosleep,
-	[ __NR_statfs64 ] = (syscall_handler_t *) sys_statfs64,
-	[ __NR_fstatfs64 ] = (syscall_handler_t *) sys_fstatfs64,
 	[ __NR_tgkill ] = (syscall_handler_t *) sys_tgkill,
 	[ __NR_utimes ] = (syscall_handler_t *) sys_utimes,
-	[ __NR_fadvise64_64 ] = (syscall_handler_t *) sys_fadvise64_64,
-	[ __NR_vserver ] = (syscall_handler_t *) sys_vserver,
+	[ __NR_fadvise64 ] = (syscall_handler_t *) sys_fadvise64,
+	[ __NR_vserver ] = (syscall_handler_t *) sys_ni_syscall,
 	[ __NR_mbind ] = (syscall_handler_t *) sys_mbind,
 	[ __NR_get_mempolicy ] = (syscall_handler_t *) sys_get_mempolicy,
 	[ __NR_set_mempolicy ] = (syscall_handler_t *) sys_set_mempolicy,
diff -puN arch/um/include/sysdep-x86_64/syscalls.h~uml-quick-fix-syscall-table arch/um/include/sysdep-x86_64/syscalls.h
--- linux-2.6.11/arch/um/include/sysdep-x86_64/syscalls.h~uml-quick-fix-syscall-table	2005-03-22 21:15:08.000000000 +0100
+++ linux-2.6.11-paolo/arch/um/include/sysdep-x86_64/syscalls.h	2005-03-22 21:21:45.000000000 +0100
@@ -73,10 +73,6 @@ extern syscall_handler_t sys_arch_prctl;
 	[ __NR_get_thread_area ] = (syscall_handler_t *) sys_ni_syscall, \
         [ __NR_remap_file_pages ] = (syscall_handler_t *) sys_remap_file_pages, \
 	[ __NR_semtimedop ] = (syscall_handler_t *) sys_semtimedop, \
-	[ __NR_fadvise64 ] = (syscall_handler_t *) sys_fadvise64, \
-	[ 223 ] = (syscall_handler_t *) sys_ni_syscall, \
-	[ __NR_utimes ] = (syscall_handler_t *) sys_utimes, \
-	[ __NR_vserver ] = (syscall_handler_t *) sys_ni_syscall, \
 	[ 251 ] = (syscall_handler_t *) sys_ni_syscall,
 
 #define LAST_ARCH_SYSCALL 251
_

Reply via email to