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:
mio
2021-10-06 04:42:44 +08:00
parent 04f538e151
commit ae1b6ad89b
27 changed files with 62 additions and 15 deletions

View File

@ -1404,10 +1404,10 @@ AddressSpaceDispatch *address_space_dispatch_new(struct uc_struct *uc, FlatView
uint16_t n;
n = dummy_section(uc, &d->map, fv, &(uc->io_mem_unassigned));
assert(n == PHYS_SECTION_UNASSIGNED);
#else
dummy_section(uc, &d->map, fv, &(uc->io_mem_unassigned));
#endif
assert(n == PHYS_SECTION_UNASSIGNED);
d->phys_map = (PhysPageEntry) { .ptr = PHYS_MAP_NODE_NIL, .skip = 1 };
d->uc = uc;