public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] IA64 build broken... cond_syscall()... Fixes?
@ 2004-11-02  2:39 Peter Chubb
  2004-11-02 22:07 ` Luck, Tony
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Chubb @ 2004-11-02  2:39 UTC (permalink / raw)
  To: Andrew.Morton.akpm, Tony Luck; +Cc: linux-ia64, linux-kernel


Hi Folks,
   The kernel 2.6 IA64 build has been broken for several days (see
http://www.gelato.unsw.edu.au/kerncomp )

The reason is that cond_syscall() for IA64 is defined as:

  #define cond_syscall(x) asmlinkage long x (void) \
	__attribute__((weak,alias("sys_ni_syscall")))   

which of course doesn't work if there's a prototype in scope for x,
unless the type of x just happens to be the same as for sys_ni_syscall.

Changing to the type-safe version
   #define cond_syscall(x) __typeof__ (x) x \
	   __attribute__((weak,alias("sys_ni_syscall")));
gives an error, e.g., 
 error: `compat_sys_futex' defined both normally and as an alias

Most architectures use inline assembly language which avoids the
problem.  However, we don't want to do this for IA64, to allow
compilers other than gcc to be used (in general, gcc generated code
for IA64 is extremely poor).

There are several ways to fix this.  The simple way is to ensure that
there are no prototypes for any system calls included in kernel/sys.c
(the only place where cond_syscall is used).  That's what this patch
does:



=== kernel/sys.c 1.97 vs edited ==--- 1.97/kernel/sys.c	2004-10-28 07:35:17 +10:00
+++ edited/kernel/sys.c	2004-11-02 13:34:33 +11:00
@@ -5,7 +5,6 @@
  */
 
 #include <linux/config.h>
-#include <linux/compat.h>
 #include <linux/module.h>
 #include <linux/mm.h>
 #include <linux/utsname.h>
@@ -25,8 +24,9 @@
 #include <linux/dcookies.h>
 #include <linux/suspend.h>
 
-/* Don't include this - it breaks ia64's cond_syscall() implementation */
+/* Don't include these - they break ia64's cond_syscall() implementation */
 #if 0
+#include <linux/compat.h>
 #include <linux/syscalls.h>
 #endif
 



--
Dr Peter Chubb  http://www.gelato.unsw.edu.au  peterc AT gelato.unsw.edu.au
The technical we do immediately,  the political takes *forever*

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

end of thread, other threads:[~2004-11-02 22:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200411020239.iA22dsQl026520@mail23.syd.optusnet.com.au>
2004-11-02  3:28 ` [PATCH] IA64 build broken... cond_syscall()... Fixes? Andrew Morton
2004-11-02  4:01   ` Peter Chubb
2004-11-02  2:39 Peter Chubb
2004-11-02 22:07 ` Luck, Tony
2004-11-02 22:18   ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox