Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 35587a0c authored by Nick Kralevich's avatar Nick Kralevich Committed by Gerrit Code Review
Browse files

Merge "Don't set ADDR_COMPAT_LAYOUT on the emulator"

parents be4536d2 fc17dc25
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -7,6 +7,7 @@


#define LOG_TAG "appproc"
#define LOG_TAG "appproc"


#include <cutils/properties.h>
#include <binder/IPCThreadState.h>
#include <binder/IPCThreadState.h>
#include <binder/ProcessState.h>
#include <binder/ProcessState.h>
#include <utils/Log.h>
#include <utils/Log.h>
@@ -144,7 +145,10 @@ int main(int argc, char* const argv[])
     * This breaks some programs which improperly embed
     * This breaks some programs which improperly embed
     * an out of date copy of Android's linker.
     * an out of date copy of Android's linker.
     */
     */
    if (getenv("NO_ADDR_COMPAT_LAYOUT_FIXUP") == NULL) {
    char value[PROPERTY_VALUE_MAX];
    property_get("ro.kernel.qemu", value, "");
    bool is_qemu = (strcmp(value, "1") == 0);
    if ((getenv("NO_ADDR_COMPAT_LAYOUT_FIXUP") == NULL) && !is_qemu) {
        int current = personality(0xFFFFFFFF);
        int current = personality(0xFFFFFFFF);
        if ((current & ADDR_COMPAT_LAYOUT) == 0) {
        if ((current & ADDR_COMPAT_LAYOUT) == 0) {
            personality(current | ADDR_COMPAT_LAYOUT);
            personality(current | ADDR_COMPAT_LAYOUT);