Index: compiler-rt/lib/builtins/divdi3.c =================================================================== --- compiler-rt/lib/builtins/divdi3.c +++ compiler-rt/lib/builtins/divdi3.c @@ -26,3 +26,13 @@ s_a ^= s_b; /*sign of quotient */ return (__udivmoddi4(a, b, (du_int*)0) ^ s_a) - s_a; /* negate if s_a == -1 */ } + +#if defined(__ANDROID__) && defined(__ARM_EABI__) +// For libgcc compatibility +COMPILER_RT_ABI di_int +__gnu_ldivmod_helper(di_int a, di_int b, di_int *remainder) { + di_int quotient = __divdi3 (a, b); + *remainder = a - b * quotient; + return quotient; +} +#endif Index: compiler-rt/lib/builtins/udivdi3.c =================================================================== --- compiler-rt/lib/builtins/udivdi3.c +++ compiler-rt/lib/builtins/udivdi3.c @@ -20,3 +20,13 @@ { return __udivmoddi4(a, b, 0); } + +#if defined(__ANDROID__) && defined(__ARM_EABI__) +// For libgcc compatibility +COMPILER_RT_ABI du_int +__gnu_uldivmod_helper(du_int a, du_int b, du_int *remainder) { + di_int quotient = __udivdi3 (a, b); + *remainder = a - b * quotient; + return quotient; +} +#endif