1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 19e51ac..e6157fa 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -538,7 +538,6 @@ target/arm/crt0.S
 #endif /* SIMULATOR */

 #elif defined(CPU_MIPS)
-#undef mips
 common/memset16.c
 target/mips/ffs-mips.S
 target/mips/memcpy-mips.S
diff --git a/firmware/target/mips/ingenic_jz47xx/app.lds b/firmware/target/mips/ingenic_jz47xx/app.lds
index bd924e4..9b45704 100644
--- a/firmware/target/mips/ingenic_jz47xx/app.lds
+++ b/firmware/target/mips/ingenic_jz47xx/app.lds
@@ -1,5 +1,4 @@
 #include "config.h"
-#undef mips

 OUTPUT_FORMAT("elf32-littlemips")
 OUTPUT_ARCH(MIPS)
diff --git a/firmware/target/mips/ingenic_jz47xx/boot.lds b/firmware/target/mips/ingenic_jz47xx/boot.lds
index 15d3e3d..a236a3f 100644
--- a/firmware/target/mips/ingenic_jz47xx/boot.lds
+++ b/firmware/target/mips/ingenic_jz47xx/boot.lds
@@ -1,5 +1,4 @@
 #include "config.h"
-#undef mips

 OUTPUT_FORMAT("elf32-littlemips")
 OUTPUT_ARCH(MIPS)
diff --git a/lib/libsetjmp/SOURCES b/lib/libsetjmp/SOURCES
index b2f4227..aa0ac46 100644
--- a/lib/libsetjmp/SOURCES
+++ b/lib/libsetjmp/SOURCES
@@ -13,8 +13,6 @@ sh/setjmp.S
 #endif

 #ifdef CPU_MIPS
-/* Strangely something seems to do '#define mips 1' */
-#undef mips
 mips/setjmp.S
 #endif

diff --git a/tools/configure b/tools/configure
index 7c61b09..7146ae1 100755
--- a/tools/configure
+++ b/tools/configure
@@ -442,7 +442,7 @@ arm1176jzscc () {

 mipselcc () {
  prefixtools mipsel-elf-
- GCCOPTS="$CCOPTS -march=mips32 -mtune=r4600 -mno-mips16 -mno-long-calls"
+ GCCOPTS="$CCOPTS -march=mips32 -mtune=r4600 -mno-mips16 -mno-long-calls -Umips"
  GCCOPTS="$GCCOPTS -ffunction-sections -msoft-float -G 0 -Wno-parentheses"
  GCCOPTIMIZE="-fomit-frame-pointer"
  endian="little"