[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#397139: ftbfs alpha + ia64



On Mon, Nov 06, 2006 at 11:37:23PM -0800, Steve Langasek wrote:
> It gets better -- after fixing up the first bit of assembly in the source,
> I've found that there's also embedded assembly in sys_titan.c which is
> specific to ev6.  So even emitting ".arch ev56" is going to give a build
> failure.

> Which convinces me even more that the right answer is to fix the kernel
> instead of disabling gcc's ability to sanity-check the insns used.

> Patch available as soon as I get to the end of the build.

And here is the patch which adds explicit .arch specifiers to the inline
assembly.  I'll commit this to the kernel svn repo shortly.

Thanks,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
vorlon@debian.org                                   http://www.debian.org/
--- source/include/asm-alpha/compiler.h.orig	2006-09-19 20:42:06.000000000 -0700
+++ source/include/asm-alpha/compiler.h	2006-11-06 17:10:00.000000000 -0800
@@ -78,16 +78,20 @@
 #else
 #define __kernel_ldbu(mem)				\
   ({ unsigned char __kir;				\
-     __asm__("ldbu %0,%1" : "=r"(__kir) : "m"(mem));	\
+     __asm__(".arch ev56;				\
+             ldbu %0,%1" : "=r"(__kir) : "m"(mem));	\
      __kir; })
 #define __kernel_ldwu(mem)				\
   ({ unsigned short __kir;				\
-     __asm__("ldwu %0,%1" : "=r"(__kir) : "m"(mem));	\
+     __asm__(".arch ev56;				\
+             ldwu %0,%1" : "=r"(__kir) : "m"(mem));	\
      __kir; })
-#define __kernel_stb(val,mem) \
-  __asm__("stb %1,%0" : "=m"(mem) : "r"(val))
-#define __kernel_stw(val,mem) \
-  __asm__("stw %1,%0" : "=m"(mem) : "r"(val))
+#define __kernel_stb(val,mem)				\
+  __asm__(".arch ev56;					\
+          stb %1,%0" : "=m"(mem) : "r"(val))
+#define __kernel_stw(val,mem)				\
+  __asm__(".arch ev56;					\
+          stw %1,%0" : "=m"(mem) : "r"(val))
 #endif
 
 #ifdef __KERNEL__
--- source/arch/alpha/kernel/sys_titan.c.orig	2006-11-06 23:17:50.000000000 -0800
+++ source/arch/alpha/kernel/sys_titan.c	2006-11-06 23:17:04.000000000 -0800
@@ -257,7 +257,7 @@
 	 */
 	while (mask) {
 		/* convert to SRM vector... priority is <63> -> <0> */
-		__asm__("ctlz %1, %0" : "=r"(vector) : "r"(mask));
+		__asm__(".arch ev6; ctlz %1, %0" : "=r"(vector) : "r"(mask));
 		vector = 63 - vector;
 		mask &= ~(1UL << vector);	/* clear it out 	 */
 		vector = 0x900 + (vector << 4);	/* convert to SRM vector */

Reply to: