diff --git a/cmds/app_process/app_main.cpp b/cmds/app_process/app_main.cpp index b54774ee18f07..80df56873a3a3 100644 --- a/cmds/app_process/app_main.cpp +++ b/cmds/app_process/app_main.cpp @@ -12,10 +12,10 @@ #include #include #include -#include #include #include +#include #include #include @@ -144,12 +144,11 @@ int main(int argc, char* const argv[]) * This breaks some programs which improperly embed * an out of date copy of Android's linker. */ - char value[PROPERTY_VALUE_MAX]; - property_get("ro.kernel.qemu", value, ""); - if (strcmp(value, "1") != 0) { + if (getenv("NO_ADDR_COMPAT_LAYOUT_FIXUP") == NULL) { int current = personality(0xFFFFFFFF); if ((current & ADDR_COMPAT_LAYOUT) == 0) { personality(current | ADDR_COMPAT_LAYOUT); + setenv("NO_ADDR_COMPAT_LAYOUT_FIXUP", "1", 1); execv("/system/bin/app_process", argv); return -1; }