am 35587a0c: Merge "Don\'t set ADDR_COMPAT_LAYOUT on the emulator"

* commit '35587a0c47c33a8eed7817dc705dbf502f7b5b60':
  Don't set ADDR_COMPAT_LAYOUT on the emulator
This commit is contained in:
Nick Kralevich
2013-04-23 17:06:58 -07:00
committed by Android Git Automerger

View File

@@ -7,6 +7,7 @@
#define LOG_TAG "appproc"
#include <cutils/properties.h>
#include <binder/IPCThreadState.h>
#include <binder/ProcessState.h>
#include <utils/Log.h>
@@ -148,7 +149,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);