Merge "Don't use ADDR_COMPAT_LAYOUT on the emulator"
This commit is contained in:
@ -12,6 +12,7 @@
|
|||||||
#include <utils/Log.h>
|
#include <utils/Log.h>
|
||||||
#include <cutils/process_name.h>
|
#include <cutils/process_name.h>
|
||||||
#include <cutils/memory.h>
|
#include <cutils/memory.h>
|
||||||
|
#include <cutils/properties.h>
|
||||||
#include <android_runtime/AndroidRuntime.h>
|
#include <android_runtime/AndroidRuntime.h>
|
||||||
#include <sys/personality.h>
|
#include <sys/personality.h>
|
||||||
|
|
||||||
@ -143,11 +144,15 @@ 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.
|
||||||
*/
|
*/
|
||||||
int current = personality(0xFFFFFFFF);
|
char value[PROPERTY_VALUE_MAX];
|
||||||
if ((current & ADDR_COMPAT_LAYOUT) == 0) {
|
property_get("ro.kernel.qemu", value, "");
|
||||||
personality(current | ADDR_COMPAT_LAYOUT);
|
if (strcmp(value, "1") != 0) {
|
||||||
execv("/system/bin/app_process", argv);
|
int current = personality(0xFFFFFFFF);
|
||||||
return -1;
|
if ((current & ADDR_COMPAT_LAYOUT) == 0) {
|
||||||
|
personality(current | ADDR_COMPAT_LAYOUT);
|
||||||
|
execv("/system/bin/app_process", argv);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user