Support building on Android arm aarch64 x86 x86_64
1. Add cmake support in CMakeLists.txt according to https://developer.android.com/ndk/guides/other_build_systems
2. Resolve symbols errors
3. Backport fixes from 438ed42311
> QEMU relies on two optimization for ppc64 and arm:
>
> 1. if(0) /* optimized code */
> 2. assert(0); /* optimized code */
>
> But the assert on mingw32 doesn't have noreturn attribute which prevents
> the second optimization and some code is reverted to the original code
> to fit in the first optimization.
>
> The assert implementation is copied from glib as qemu did.
Unfortunately, NDK also doesn't have an assert implementation qemu prefers.
This commit is contained in:
@@ -82,10 +82,8 @@ typedef enum {
|
||||
|
||||
#define TCG_TARGET_NB_REGS 16
|
||||
|
||||
#ifdef __ARM_ARCH_EXT_IDIV__
|
||||
#define use_idiv_instructions 1
|
||||
#else
|
||||
extern bool use_idiv_instructions;
|
||||
#ifndef __ARM_ARCH_EXT_IDIV__
|
||||
extern bool use_idiv_instructions; // Unicorn: Don't have the same name with macro
|
||||
#endif
|
||||
|
||||
|
||||
@@ -122,7 +120,11 @@ extern bool use_idiv_instructions;
|
||||
#define TCG_TARGET_HAS_muls2_i32 1
|
||||
#define TCG_TARGET_HAS_muluh_i32 0
|
||||
#define TCG_TARGET_HAS_mulsh_i32 0
|
||||
#ifdef __ARM_ARCH_EXT_IDIV__
|
||||
#define TCG_TARGET_HAS_div_i32 1
|
||||
#else
|
||||
#define TCG_TARGET_HAS_div_i32 use_idiv_instructions
|
||||
#endif
|
||||
#define TCG_TARGET_HAS_rem_i32 0
|
||||
#define TCG_TARGET_HAS_goto_ptr 1
|
||||
#define TCG_TARGET_HAS_direct_jump 0
|
||||
|
||||
Reference in New Issue
Block a user