small fix for mips

Jamal Hadi Salim jhs at mojatatu.com
Tue Jul 2 23:47:57 CEST 2013


Compile issue with openwrt against libev 4.15 for openwrt.

---
mips-openwrt-linux-uclibc-gcc     -c forces-libev.c
In file included from forces-libev.c:3:0:
ev.c:1531:31: warning: 'ev_default_loop_ptr' initialized and declared 
'extern'
/tmp/cciqCfzf.s: Assembler messages:
/tmp/cciqCfzf.s:2903: Error: opcode not supported on this processor: 
mips1 (mips1) `sync'
/tmp/cciqCfzf.s:2918: Error: opcode not supported on this processor: 
mips1 (mips1) `sync'
/tmp/cciqCfzf.s:2926: Error: opcode not supported on this processor: 
mips1 (mips1) `sync'
/tmp/cciqCfzf.s:2939: Error: opcode not supported on this processor: 
mips1 (mips1) `sync'
/tmp/cciqCfzf.s:3008: Error: opcode not supported on this processor: 
mips1 (mips1) `sync'
/tmp/cciqCfzf.s:3021: Error: opcode not supported on this processor: 
mips1 (mips1) `sync'
/tmp/cciqCfzf.s:3067: Error: opcode not supported on this processor: 
mips1 (mips1) `sync'
/tmp/cciqCfzf.s:3101: Error: opcode not supported on this processor: 
mips1 (mips1) `sync'
/tmp/cciqCfzf.s:3150: Error: opcode not supported on this processor: 
mips1 (mips1) `sync'
/tmp/cciqCfzf.s:3283: Error: opcode not supported on this processor: 
mips1 (mips1) `sync'
/tmp/cciqCfzf.s:9409: Error: opcode not supported on this processor: 
mips1 (mips1) `sync'
/tmp/cciqCfzf.s:9690: Error: opcode not supported on this processor: 
mips1 (mips1) `sync'
/tmp/cciqCfzf.s:11786: Error: opcode not supported on this processor: 
mips1 (mips1) `sync'
make: *** [base] Error 1
----------

attached patchlet to set to mips2 before issuing sync. Might be very
Linuxish and not the best fix.

cheers,
jamal
-------------- next part --------------
diff --git a/ev.c b/ev.c
index 26aa585..11d5420 100644
--- a/ev.c
+++ b/ev.c
@@ -629,7 +629,7 @@ struct signalfd_siginfo
     #elif defined __s390__ || defined __s390x__
       #define ECB_MEMORY_FENCE         __asm__ __volatile__ ("bcr 15,0" : : : "memory")
     #elif defined __mips__
-      #define ECB_MEMORY_FENCE         __asm__ __volatile__ ("sync"     : : : "memory")
+      #define ECB_MEMORY_FENCE         __asm__ __volatile__ (".set mips2; sync; .set mips0" ::: "memory")
     #elif defined __alpha__
       #define ECB_MEMORY_FENCE         __asm__ __volatile__ ("mb"       : : : "memory")
     #elif defined __hppa__


More information about the libev mailing list