Force alignment of generated JVM called functions.
This CL effectively expands the zone of influence of https://webrtc-review.googlesource.com/64160, forcing 16-byte stack alignment of generated JNI methods for the Android x86 platform. Bug: webrtc:9085 Change-Id: Idc40c00ea3fb52dbbbeac7b58ceda2a9a44733d8 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159928 Commit-Queue: Sami Kalliomäki <sakal@webrtc.org> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29858}
This commit is contained in:
3
AUTHORS
3
AUTHORS
@ -82,6 +82,8 @@ Michel Promonet <michel.promonet.1@gmail.com>
|
||||
Min Wang <mingewang@gmail.com>
|
||||
Ramprakash Jelari <ennajelari@gmail.com>
|
||||
CZ Theng <cz.theng@gmail.com>
|
||||
Miguel Paris <mparisdiaz@gmail.com>
|
||||
Raman Budny <budnyjj@gmail.com>
|
||||
|
||||
&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 <mparisdiaz@gmail.com>
|
||||
Vewd Software AS <*@vewd.com>
|
||||
Highfive, Inc. <*@highfive.com>
|
||||
CoSMo Software Consulting, Pte Ltd <*@cosmosoftware.io>
|
||||
|
||||
@ -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()) \
|
||||
|
||||
@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user