From d53afd2b05f428fcce5695770c04d6cb6fba7aca Mon Sep 17 00:00:00 2001 From: Nick Kralevich Date: Wed, 18 Sep 2013 14:29:46 -0700 Subject: [PATCH] revert ADDR_COMPAT_LAYOUT workaround. Stop working around bad applications by setting ADDR_COMPAT_LAYOUT. ADDR_COMPAT_LAYOUT is undesirable because it reduces the amount of address space available to an application. The Android emulator, in both 4.3 and 4.4, does not set ADDR_COMPAT_LAYOUT. Anyone needing to test their application on a version of Android without ADDR_COMPAT_LAYOUT can use the emulator and reproduce the failures. Change-Id: I8f753acc205798bd7f031026c7ece12d26de562c --- cmds/app_process/app_main.cpp | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/cmds/app_process/app_main.cpp b/cmds/app_process/app_main.cpp index 28752a5315adf..8d2b739fc3011 100644 --- a/cmds/app_process/app_main.cpp +++ b/cmds/app_process/app_main.cpp @@ -7,7 +7,6 @@ #define LOG_TAG "appproc" -#include #include #include #include @@ -15,7 +14,6 @@ #include #include #include -#include #include #include @@ -137,33 +135,6 @@ static void setArgv0(const char *argv0, const char *newArgv0) int main(int argc, char* const argv[]) { -#ifdef __arm__ - /* - * b/7188322 - Temporarily revert to the compat memory layout - * to avoid breaking third party apps. - * - * THIS WILL GO AWAY IN A FUTURE ANDROID RELEASE. - * - * http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=7dbaa466 - * changes the kernel mapping from bottom up to top-down. - * 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, ""); - bool is_qemu = (strcmp(value, "1") == 0); - if ((getenv("NO_ADDR_COMPAT_LAYOUT_FIXUP") == NULL) && !is_qemu) { - 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; - } - } - unsetenv("NO_ADDR_COMPAT_LAYOUT_FIXUP"); -#endif - // These are global variables in ProcessState.cpp mArgC = argc; mArgV = argv;