This patch supports ORC JIT for mips/mips64 architecture. We have changed in common code $static to __ORCstatic because on MIPS architecture "$" is a reserved character.
Sorry for the delay. I am reading through this now, but the first thing I notice is that we cannot change from uint64_t to uintptr_t. ORC is meant to work across platforms, and that includes compiling (and holding addresses of) 64-bit code on 32-bit platforms where the a uintptr_t would only be 32-bits.
What endianness bugs are you seeing?
The rest of this looks great. All that remains is to sort out the uintptr_t issue and provide testing. I think you will want to enable mips32/mips64 in test/ExecutionEngine/OrcLazy/lit.local.cfg to allow those regression tests to run on mips.
I fixed the issue with endianness without changing uintptr_t and also enabled tests for Mips. The issue was related to return values for mips32. On mips32 if the return value size is 64 bit we are using register pair (32bit) v0 and v1 for it. For big endian, since return type is uint64_t, return value was put into v1, and for little endian was put into v0 and it was needed we to set the proper return value in resolver code.