Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodrigo Kumpera <kumpera@users.noreply.github.com>2017-02-27 23:46:03 +0300
committerGitHub <noreply@github.com>2017-02-27 23:46:03 +0300
commit6025544e01621474c7c7e1acb08bcfa66704e8db (patch)
tree19305517355291bbe666456f35f1ddf40b0e6772
parentb7f7f8c40dec2b9fc2cd6971ddbd5a77ab02c631 (diff)
parent34012db8950766dfe02c59c1af4f11824752de2a (diff)
Merge pull request #4433 from kumpera/android-fixes
Fix a few issues on Android
-rw-r--r--configure.ac33
-rw-r--r--mono/mini/alias-analysis.c13
-rw-r--r--mono/mini/liveness.c3
-rw-r--r--mono/mini/method-to-ir.c15
-rw-r--r--mono/mini/mini-arm64.c2
5 files changed, 49 insertions, 17 deletions
diff --git a/configure.ac b/configure.ac
index c3a0beb8a94..a8dcb129243 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1428,8 +1428,6 @@ if test x$host_win32 = xno; then
AC_CHECK_FUNCS(getgrgid_r)
AC_CHECK_FUNCS(getgrnam_r)
- AC_CHECK_FUNCS(getpwnam_r)
- AC_CHECK_FUNCS(getpwuid_r)
AC_CHECK_FUNCS(getresuid)
AC_CHECK_FUNCS(setresuid)
AC_CHECK_FUNCS(kqueue)
@@ -1450,6 +1448,11 @@ if test x$host_win32 = xno; then
AC_CHECK_FUNCS(sched_setaffinity)
AC_CHECK_FUNCS(sched_getcpu)
+ if test x$platform_android != xyes; then
+ AC_CHECK_FUNCS(getpwnam_r)
+ AC_CHECK_FUNCS(getpwuid_r)
+ fi
+
dnl ****************************************************************
dnl *** Check for sched_setaffinity from glibc versions before ***
dnl *** 2.3.4. The older versions of the function only take 2 ***
@@ -3310,7 +3313,6 @@ if test "x$host" != "x$target"; then
TARGET=ARM;
arch_target=arm;
AC_DEFINE(TARGET_ARM, 1, [...])
- AC_DEFINE(TARGET_ANDROID, 1, [...])
ACCESS_UNALIGNED="no"
CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
# Can't use tls, since it depends on the runtime detection of tls offsets
@@ -3323,6 +3325,11 @@ if test "x$host" != "x$target"; then
CPPFLAGS="$CPPFLAGS"
;;
armv5-*-linux-androideabi*)
+ AC_DEFINE(TARGET_ANDROID, 1, [...])
+ CPPFLAGS="$CPPFLAGS"
+ ;;
+ *-linux-androideabi*)
+ AC_DEFINE(TARGET_ANDROID, 1, [...])
CPPFLAGS="$CPPFLAGS"
;;
esac
@@ -3342,23 +3349,33 @@ if test "x$host" != "x$target"; then
TARGET=X86;
arch_target=x86;
AC_DEFINE(TARGET_X86, 1, [...])
- AC_DEFINE(TARGET_ANDROID, 1, [...])
CPPFLAGS="$CPPFLAGS"
# Can't use tls, since it depends on the runtime detection of tls offsets
# in mono-compiler.h
with_tls=pthread
target_mach=no
+
+ case "$target" in
+ *-linux-android*)
+ AC_DEFINE(TARGET_ANDROID, 1, [...])
+ ;;
+ esac
;;
x86_64*-linux-*)
TARGET=AMD64;
arch_target=amd64;
AC_DEFINE(TARGET_AMD64, 1, [...])
- AC_DEFINE(TARGET_ANDROID, 1, [...])
CPPFLAGS="$CPPFLAGS"
# Can't use tls, since it depends on the runtime detection of tls offsets
# in mono-compiler.h
with_tls=pthread
target_mach=no
+
+ case "$target" in
+ *-linux-android*)
+ AC_DEFINE(TARGET_ANDROID, 1, [...])
+ ;;
+ esac
;;
x86_64-ps4-freebsd)
TARGET=AMD64;
@@ -3377,12 +3394,16 @@ if test "x$host" != "x$target"; then
TARGET=ARM64;
arch_target=arm64;
AC_DEFINE(TARGET_ARM64, 1, [...])
- AC_DEFINE(TARGET_ANDROID, 1, [...])
CPPFLAGS="$CPPFLAGS"
# Can't use tls, since it depends on the runtime detection of tls offsets
# in mono-compiler.h
with_tls=pthread
target_mach=no
+ case "$target" in
+ *-linux-android*)
+ AC_DEFINE(TARGET_ANDROID, 1, [...])
+ ;;
+ esac
;;
aarch64-*)
TARGET=ARM64
diff --git a/mono/mini/alias-analysis.c b/mono/mini/alias-analysis.c
index c419dfa2b42..7ff437f9f9d 100644
--- a/mono/mini/alias-analysis.c
+++ b/mono/mini/alias-analysis.c
@@ -159,10 +159,17 @@ lower_memory_access (MonoCompile *cfg)
for (ins = bb->code; ins; ins = ins->next) {
handle_instruction:
switch (ins->opcode) {
- case OP_LDADDR:
- g_hash_table_insert (addr_loads, GINT_TO_POINTER (ins->dreg), ins);
- if (cfg->verbose_level > 2) { printf ("New address: "); mono_print_ins (ins); }
+ case OP_LDADDR: {
+ MonoInst *var = (MonoInst*)ins->inst_p0;
+ if (var->flags & MONO_INST_VOLATILE) {
+ if (cfg->verbose_level > 2) { printf ("Found address to volatile var, can't take it: "); mono_print_ins (ins); }
+ } else {
+ g_hash_table_insert (addr_loads, GINT_TO_POINTER (ins->dreg), ins);
+ if (cfg->verbose_level > 2) { printf ("New address: "); mono_print_ins (ins); }
+ }
break;
+ }
+
case OP_MOVE:
tmp = (MonoInst*)g_hash_table_lookup (addr_loads, GINT_TO_POINTER (ins->sreg1));
/*
diff --git a/mono/mini/liveness.c b/mono/mini/liveness.c
index cdd1c42ef49..cfdc728c0d0 100644
--- a/mono/mini/liveness.c
+++ b/mono/mini/liveness.c
@@ -231,8 +231,7 @@ analyze_liveness_bb (MonoCompile *cfg, MonoBasicBlock *bb)
#ifdef DEBUG_LIVENESS
if (cfg->verbose_level > 1) {
- printf ("\t");
- mono_print_ins (ins);
+ mono_print_ins_index (1, ins);
}
#endif
diff --git a/mono/mini/method-to-ir.c b/mono/mini/method-to-ir.c
index e522e4e69b3..5982e0c2008 100644
--- a/mono/mini/method-to-ir.c
+++ b/mono/mini/method-to-ir.c
@@ -348,14 +348,19 @@ mono_print_bb (MonoBasicBlock *bb, const char *msg)
{
int i;
MonoInst *tree;
+ GString *str = g_string_new ("");
- printf ("\n%s %d: [IN: ", msg, bb->block_num);
+ g_string_append_printf (str, "%s %d: [IN: ", msg, bb->block_num);
for (i = 0; i < bb->in_count; ++i)
- printf (" BB%d(%d)", bb->in_bb [i]->block_num, bb->in_bb [i]->dfn);
- printf (", OUT: ");
+ g_string_append_printf (str, " BB%d(%d)", bb->in_bb [i]->block_num, bb->in_bb [i]->dfn);
+ g_string_append_printf (str, ", OUT: ");
for (i = 0; i < bb->out_count; ++i)
- printf (" BB%d(%d)", bb->out_bb [i]->block_num, bb->out_bb [i]->dfn);
- printf (" ]\n");
+ g_string_append_printf (str, " BB%d(%d)", bb->out_bb [i]->block_num, bb->out_bb [i]->dfn);
+ g_string_append_printf (str, " ]\n");
+
+ g_print ("%s", str->str);
+ g_string_free (str, TRUE);
+
for (tree = bb->code; tree; tree = tree->next)
mono_print_ins_index (-1, tree);
}
diff --git a/mono/mini/mini-arm64.c b/mono/mini/mini-arm64.c
index 3ad91e31cd0..1884dc1d49d 100644
--- a/mono/mini/mini-arm64.c
+++ b/mono/mini/mini-arm64.c
@@ -1902,7 +1902,7 @@ mono_arch_create_vars (MonoCompile *cfg)
if (cfg->method->save_lmf) {
cfg->create_lmf_var = TRUE;
cfg->lmf_ir = TRUE;
-#ifndef TARGET_MACH
+#ifdef HAVE_GET_TLS_ADDR
cfg->lmf_ir_mono_lmf = TRUE;
#endif
}