Patch to fix building with pthread
Hi all,
I was unable to build inferno for SYSHOST=Linux and OBJTYPE=spim.
Compiler complained about duplicate definition of getup(). Apparently
this was caused by the latest move of adopting pthread, and I've made
a quick fix to Linux/mips/include/emu.h, as attached. Very likely
there are other targets affected, but I didn't bother to fix them all.
--
Regards,
Cheer Xiao aka. xiaq
diff -r 22ef83c0dd82 Linux/spim/include/emu.h
--- a/Linux/spim/include/emu.h Fri Dec 30 18:56:40 2011 +0000
+++ b/Linux/spim/include/emu.h Sat Dec 31 12:07:04 2011 +0800
@@ -20,6 +20,7 @@
*/
#define KSTACK (16 * 1024)
+#ifndef USE_PTHREADS
static __inline Proc *getup(void) {
Proc *p;
__asm__( "move %0, $29\n\t"
@@ -27,6 +28,9 @@
);
return *(Proc **)((unsigned long)p & ~(KSTACK - 1));
};
+#else
+extern Proc* getup(void);
+#endif
#define up (getup())