summaryrefslogtreecommitdiff
path: root/cmds/app_process/app_main.cpp
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2013-04-23 23:33:52 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2013-04-23 23:33:52 +0000
commit35587a0c47c33a8eed7817dc705dbf502f7b5b60 (patch)
tree8f8bbf8c1ab2defe9926b461fa9090222ced4275 /cmds/app_process/app_main.cpp
parentbe4536d214eedc3d12b50f0f30b47bba773b8dbc (diff)
parentfc17dc2548234461eb43ff83539ede4c9893a825 (diff)
Merge "Don't set ADDR_COMPAT_LAYOUT on the emulator"
Diffstat (limited to 'cmds/app_process/app_main.cpp')
-rw-r--r--cmds/app_process/app_main.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmds/app_process/app_main.cpp b/cmds/app_process/app_main.cpp
index 0668be606a7e..6f37180e15eb 100644
--- a/cmds/app_process/app_main.cpp
+++ b/cmds/app_process/app_main.cpp
@@ -7,6 +7,7 @@
#define LOG_TAG "appproc"
+#include <cutils/properties.h>
#include <binder/IPCThreadState.h>
#include <binder/ProcessState.h>
#include <utils/Log.h>
@@ -144,7 +145,10 @@ int main(int argc, char* const argv[])
* This breaks some programs which improperly embed
* 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);
if ((current & ADDR_COMPAT_LAYOUT) == 0) {
personality(current | ADDR_COMPAT_LAYOUT);