diff --git a/AUTHORS b/AUTHORS index d76148e8d2..df32313b3d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -82,6 +82,8 @@ Michel Promonet Min Wang Ramprakash Jelari CZ Theng +Miguel Paris +Raman Budny &yet LLC <*@andyet.com> Agora IO <*@agora.io> @@ -109,7 +111,6 @@ Videxio AS <*@videxio.com> Vidyo, Inc. <*@vidyo.com> Vonage Holdings Corp. <*@vonage.com> Wire Swiss GmbH <*@wire.com> -Miguel Paris Vewd Software AS <*@vewd.com> Highfive, Inc. <*@highfive.com> CoSMo Software Consulting, Pte Ltd <*@cosmosoftware.io> diff --git a/sdk/android/src/jni/jni_generator_helper.h b/sdk/android/src/jni/jni_generator_helper.h index e6d6f7ef15..a5497e1635 100644 --- a/sdk/android/src/jni/jni_generator_helper.h +++ b/sdk/android/src/jni/jni_generator_helper.h @@ -27,7 +27,16 @@ #define BASE_EXPORT #define JNI_REGISTRATION_EXPORT __attribute__((visibility("default"))) + +#if defined(WEBRTC_ARCH_X86) +// Dalvik JIT generated code doesn't guarantee 16-byte stack alignment on +// x86 - use force_align_arg_pointer to realign the stack at the JNI +// boundary. crbug.com/655248 +#define JNI_GENERATOR_EXPORT \ + __attribute__((force_align_arg_pointer)) extern "C" JNIEXPORT JNICALL +#else #define JNI_GENERATOR_EXPORT extern "C" JNIEXPORT JNICALL +#endif #define CHECK_EXCEPTION(jni) \ RTC_CHECK(!jni->ExceptionCheck()) \ diff --git a/sdk/android/src/jni/jni_helpers.h b/sdk/android/src/jni/jni_helpers.h index 38b0d7edf4..7a2f27b99d 100644 --- a/sdk/android/src/jni/jni_helpers.h +++ b/sdk/android/src/jni/jni_helpers.h @@ -23,8 +23,17 @@ // Convenience macro defining JNI-accessible methods in the org.webrtc package. // Eliminates unnecessary boilerplate and line-wraps, reducing visual clutter. +#if defined(WEBRTC_ARCH_X86) +// Dalvik JIT generated code doesn't guarantee 16-byte stack alignment on +// x86 - use force_align_arg_pointer to realign the stack at the JNI +// boundary. crbug.com/655248 +#define JNI_FUNCTION_DECLARATION(rettype, name, ...) \ + __attribute__((force_align_arg_pointer)) extern "C" JNIEXPORT rettype \ + JNICALL Java_org_webrtc_##name(__VA_ARGS__) +#else #define JNI_FUNCTION_DECLARATION(rettype, name, ...) \ extern "C" JNIEXPORT rettype JNICALL Java_org_webrtc_##name(__VA_ARGS__) +#endif namespace webrtc { namespace jni {