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:
@@ -27,7 +27,7 @@
|
||||
|
||||
int arm_arch = __ARM_ARCH;
|
||||
|
||||
#ifndef use_idiv_instructions
|
||||
#ifndef __ARM_ARCH_EXT_IDIV__
|
||||
bool use_idiv_instructions;
|
||||
#endif
|
||||
|
||||
@@ -2201,7 +2201,7 @@ static void tcg_target_init(TCGContext *s)
|
||||
{
|
||||
/* Only probe for the platform and capabilities if we havn't already
|
||||
determined maximum values at compile time. */
|
||||
#ifndef use_idiv_instructions
|
||||
#ifndef __ARM_ARCH_EXT_IDIV__
|
||||
{
|
||||
unsigned long hwcap = qemu_getauxval(AT_HWCAP);
|
||||
use_idiv_instructions = (hwcap & HWCAP_ARM_IDIVA) != 0;
|
||||
|
||||
Reference in New Issue
Block a user