[runtime] Remove all NACL support. It was unmaintained for a long time. (#4955)
authorZoltan Varga <vargaz@gmail.com>
Fri, 2 Jun 2017 07:51:44 +0000 (03:51 -0400)
committerGitHub <noreply@github.com>
Fri, 2 Jun 2017 07:51:44 +0000 (03:51 -0400)
https://blog.chromium.org/2017/05/goodbye-pnacl-hello-webassembly.html

56 files changed:
configure.ac
eglib/src/eglib-config.h.in
eglib/src/gfile-posix.c
mono/dis/dump.c
mono/metadata/Makefile.am
mono/metadata/appdomain.c
mono/metadata/assembly.c
mono/metadata/boehm-gc.c
mono/metadata/console-unix.c
mono/metadata/gc.c
mono/metadata/icall.c
mono/metadata/mono-config.c
mono/metadata/nacl-stub.c [deleted file]
mono/metadata/threads.c
mono/metadata/w32file-unix.c
mono/mini/Makefile.am.in
mono/mini/aot-compiler.c
mono/mini/aot-runtime.c
mono/mini/branch-opts.c
mono/mini/driver.c
mono/mini/exceptions.cs
mono/mini/genmdesc.c
mono/mini/helpers.c
mono/mini/image-writer.c
mono/mini/jit-icalls.c
mono/mini/jit-icalls.h
mono/mini/mini-arm.c
mono/mini/mini-posix.c
mono/mini/mini-runtime.c
mono/mini/mini.c
mono/mini/mini.h
mono/mini/regalloc.h
mono/profiler/Makefile.am
mono/profiler/mprof-report.c
mono/tests/Makefile.am
mono/utils/dlmalloc.c
mono/utils/mono-context.c
mono/utils/mono-context.h
mono/utils/mono-dl.h
mono/utils/mono-mmap.c
mono/utils/mono-rand.c
mono/utils/mono-threads-posix-signals.c
mono/utils/mono-threads-posix.c
mono/utils/mono-threads.c
mono/utils/mono-threads.h
mono/utils/monobitset.c
msvc/libmonoruntime.vcxproj
msvc/libmonoruntime.vcxproj.filters
nacl/README [deleted file]
nacl/common.sh [deleted file]
nacl/config-nacl-runtime.cache [deleted file]
nacl/config-nacl-runtime64.cache [deleted file]
nacl/nacl-runtime-mono.sh [deleted file]
nacl/nacl_interp_loader_sdk.sh [deleted file]
runtime/Makefile.am
runtime/mono-wrapper.in

index c5c7ba58b9e3cfbd99ec0da64a13c1f3872cee0f..73893d65cdcc0c75dc7f0b9f7c12226466979fcd 100644 (file)
@@ -264,17 +264,8 @@ case "$host" in
                with_sgen_default_concurrent=yes
                ;;
        *-*-nacl*)
-               CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP"
-               if test "x$disable_munmap" != "xyes"; then
-                       CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
-               fi
-               libmono_cflags="-D_REENTRANT"
-               libdl=
-               libgc_threads=pthreads
-               use_sigposix=yes
-               ikvm_native=no
-               AC_DEFINE(DISABLE_SOCKETS,1,[Disable sockets support])
-               AC_DEFINE(DISABLE_ATTACH, 1, [Disable agent attach support])
+               echo "nacl no longer supported."
+               exit 1
                ;;
        *-*-hpux*)
                CPPFLAGS="$CPPFLAGS -DGC_HPUX_THREADS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_REENTRANT"
@@ -743,10 +734,6 @@ fi
 
 AM_CONDITIONAL(DISABLE_LIBRARIES, test x$enable_libraries = xno)
 
-case $host in
-*nacl* ) with_shared_mono=yes;;
-esac
-
 if test "x$host_win32" = "xyes"; then
    # Boehm GC requires the runtime to be in its own dll
    with_static_mono=no
@@ -1371,8 +1358,6 @@ AC_TRY_COMPILE([
        AC_DEFINE_UNQUOTED(MONO_ZERO_LEN_ARRAY, 1, [Length of zero length arrays])
 ])
 
-AC_CHECK_HEADERS(nacl/nacl_dyncode.h)
-
 dnl ***********************************
 dnl *** Checks for signals
 dnl ***********************************
@@ -2220,13 +2205,11 @@ if test x$host_win32 = xno; then
        dnl **********************************
        dnl *** epoll                      ***
        dnl **********************************
-       if test "x$ac_cv_header_nacl_nacl_dyncode_h" = "xno"; then
-               AC_CHECK_HEADERS(sys/epoll.h)
-               haveepoll=no
-               AC_CHECK_FUNCS(epoll_ctl, [haveepoll=yes], )
-               if test "x$haveepoll" = "xyes" -a "x$ac_cv_header_sys_epoll_h" = "xyes"; then
-                       AC_DEFINE(HAVE_EPOLL, 1, [epoll supported])
-               fi
+       AC_CHECK_HEADERS(sys/epoll.h)
+       haveepoll=no
+       AC_CHECK_FUNCS(epoll_ctl, [haveepoll=yes], )
+       if test "x$haveepoll" = "xyes" -a "x$ac_cv_header_sys_epoll_h" = "xyes"; then
+               AC_DEFINE(HAVE_EPOLL, 1, [epoll supported])
        fi
 
        havekqueue=no
@@ -2859,40 +2842,6 @@ fi
 AM_CONDITIONAL(ENABLE_DTRACE, [test x$enable_dtrace = xyes])
 AM_CONDITIONAL(DTRACE_G_REQUIRED, [test x$dtrace_g = xyes])
 
-dnl **************
-dnl ***  NaCl  ***
-dnl **************
-
-AC_ARG_ENABLE(nacl_codegen, [  --enable-nacl-codegen      Enable Native Client code generation], enable_nacl_codegen=$enableval, enable_nacl_codegen=no)
-AC_ARG_ENABLE(nacl_gc, [  --enable-nacl-gc           Enable Native Client garbage collection], enable_nacl_gc=$enableval, enable_nacl_gc=no)
-
-AM_CONDITIONAL(NACL_CODEGEN, test x$enable_nacl_codegen != xno)
-
-dnl
-dnl Hack to use system mono for operations in build/install not allowed in NaCl.
-dnl
-nacl_self_host=""
-if test "x$ac_cv_header_nacl_nacl_dyncode_h" = "xyes"; then
-   nacl_self_host="nacl_self_host"
-fi
-AC_SUBST(nacl_self_host)
-
-if test "x$enable_nacl_codegen" = "xyes"; then
-   MONO_NACL_ALIGN_MASK_OFF=1
-   AC_DEFINE(TARGET_NACL, 1, [...])
-   AC_DEFINE(__native_client_codegen__, 1, [...])
-fi
-if test "x$enable_nacl_gc" = "xyes"; then
-   if test "x$TARGET" = "xAMD64" -o "x$TARGET" = "xX86"; then
-      INSTRUMENT_CFLAG="-finstrument-for-thread-suspension"
-   else
-      # Not yet implemented
-      INSTRUMENT_CFLAG=""
-   fi
-   CPPFLAGS="$CPPFLAGS $INSTRUMENT_CFLAG -D__native_client_gc__"
-fi
-AC_SUBST(MONO_NACL_ALIGN_MASK_OFF)
-
 dnl **************************
 dnl *** AOT cross offsets  ***
 dnl **************************
@@ -3155,12 +3104,6 @@ case "$host" in
                  mingw*)
                        ;;
                esac
-               case "$host" in
-                       x86_64-*-nacl*)
-                               AC_DEFINE(__mono_ilp32__, 1, [64 bit mode with 4 byte longs and pointers])
-                               sizeof_register=8
-                               ;;
-               esac
                ;;
        sparc*-*-*)
                if test "x$ac_cv_sizeof_void_p" = "x8"; then
@@ -3241,13 +3184,6 @@ case "$host" in
                ACCESS_UNALIGNED="no"
                CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
                ;;
-# TODO: make proper support for NaCl host.
-#        arm*-*nacl)
-#              TARGET=ARM;
-#              arch_target=arm;
-#              ACCESS_UNALIGNED="no"
-#              AOT_SUPPORTED="no"
-#              ;;
        aarch64-*)
                # https://lkml.org/lkml/2012/7/15/133
                TARGET=ARM64
@@ -3308,38 +3244,6 @@ if test "x$host" != "x$target"; then
                sizeof_register=8
                target_byte_order=G_BIG_ENDIAN
                ;;
-   x86_64-*-nacl)
-               TARGET=AMD64
-               arch_target=amd64
-               AC_DEFINE(TARGET_AMD64, 1, [...])
-               AC_DEFINE(__mono_ilp32__, 1, [64 bit mode with 4 byte longs and pointers])
-               sizeof_register=8
-               ;;
-# TODO: make proper support for NaCl target.
-#   arm*-*nacl)
-#              TARGET=ARM
-#              arch_target=arm
-#              AC_DEFINE(TARGET_ARM, 1, [...])
-#              ACCESS_UNALIGNED="no"
-#              sizeof_register=4
-#               CPPFLAGS="$CPPFLAGS \
-#                    -D__ARM_EABI__ \
-#                    -D__arm__ \
-#                    -D__portable_native_client__ \
-#                    -Dtimezone=_timezone \
-#                    -DDISABLE_SOCKETS \
-#                    -DDISABLE_ATTACH \
-#                    -DUSE_NEWLIB"
-               # Can't use tls, since it depends on the runtime detection of tls offsets
-               # in mono-compiler.h
-#              with_tls=pthread
-#              ;;
-   i686-*-nacl)
-               TARGET=X86
-               arch_target=x86
-               AC_DEFINE(TARGET_X86, 1, [...])
-               sizeof_register=4
-               ;;
    arm*-linux-*)
                TARGET=ARM;
                arch_target=arm;
index ae7b6d45337183fb48d52b2593f26b7d0c0de28f..71797575e685c1107665e4eb14481f1fcb3a796f 100644 (file)
@@ -32,7 +32,7 @@ typedef signed   @GSIZE@ gssize;
 #define G_HAVE_ISO_VARARGS
 #endif
 
-#if defined (__native_client__) || defined (HOST_WATCHOS)
+#if defined (HOST_WATCHOS)
 #undef G_BREAKPOINT
 #define G_BREAKPOINT()
 #endif
index 49ee58a142fdee1c3e723bcac104c9a8174e4450..48a9192ab69fad8ea0d2ce2d195549af6442982e 100644 (file)
@@ -154,15 +154,6 @@ g_file_open_tmp (const gchar *tmpl, gchar **name_used, GError **error)
 gchar *
 g_get_current_dir (void)
 {
-#ifdef __native_client__
-       char *buffer;
-       if ((buffer = g_getenv("NACL_PWD"))) {
-               buffer = g_strdup(buffer);
-       } else {
-               buffer = g_strdup(".");
-       }
-       return buffer;
-#else
        int s = 32;
        char *buffer = NULL, *r;
        gboolean fail;
@@ -181,5 +172,4 @@ g_get_current_dir (void)
         * so we return the buffer here since it has a pointer to the valid string
         */
        return buffer;
-#endif
 }
index 9242e8639fe4fc147608b82d559b3a6d7e62b28f..c13675e8233525e0fd63f80f51b45f6677b19d94 100755 (executable)
 #include "mono/metadata/class-internals.h"
 #include "mono/utils/mono-compiler.h"
 
-#if defined(__native_client__) && defined(__GLIBC__)
-volatile int __nacl_thread_suspension_needed = 0;
-void __nacl_suspend_thread_if_needed() {}
-#endif
-
 void
 dump_table_assembly (MonoImage *m)
 {
index ef9df2a5cb295d6828d0b2bd6aa613e2eee93fed..a9f976f8c207799107f48d02bb367fc5019a6efb 100644 (file)
@@ -203,7 +203,6 @@ common_sources = \
        mono-route.c            \
        mono-route.h            \
        monitor.h               \
-       nacl-stub.c             \
        normalization-tables.h  \
        number-formatter.h      \
        number-ms.c             \
index 7bcd8fa7a752ca25f81c4f58b7d898492a6e7961..02ca3bbf949dcfa99b1b35c56eccea187d7bfbb3 100644 (file)
@@ -2266,10 +2266,6 @@ ves_icall_System_AppDomain_InternalUnload (gint32 domain_id, MonoError *error)
        if (g_hasenv ("MONO_NO_UNLOAD"))
                return;
 
-#ifdef __native_client__
-       return;
-#endif
-
        MonoException *exc = NULL;
        mono_domain_try_unload (domain, (MonoObject**)&exc);
        if (exc)
index 5bc9486f897e85703bbf689875c78867e671f786..16c22c8fd10e8923ba813eea59aece7e0507bb22 100644 (file)
@@ -332,27 +332,6 @@ static const AssemblyVersionMap framework_assemblies [] = {
 static GList *loaded_assemblies = NULL;
 static MonoAssembly *corlib;
 
-#if defined(__native_client__)
-
-/* On Native Client, allow mscorlib to be loaded from memory  */
-/* instead of loaded off disk.  If these are not set, default */
-/* mscorlib loading will take place                           */
-
-/* NOTE: If mscorlib data is passed to mono in this way then */
-/* it needs to remain allocated during the use of mono.      */
-
-static void *corlibData = NULL;
-static size_t corlibSize = 0;
-
-void
-mono_set_corlib_data (void *data, size_t size)
-{
-  corlibData = data;
-  corlibSize = size;
-}
-
-#endif
-
 static char* unquote (const char *str);
 
 /* This protects loaded_assemblies and image->references */
@@ -462,12 +441,6 @@ mono_set_assemblies_path (const char* path)
        }
 }
 
-/* Native Client can't get this info from an environment variable so */
-/* it's passed in to the runtime, or set manually by embedding code. */
-#ifdef __native_client__
-char* nacl_mono_path = NULL;
-#endif
-
 static void
 check_path_env (void)
 {
@@ -475,10 +448,6 @@ check_path_env (void)
                return;
 
        char* path = g_getenv ("MONO_PATH");
-#ifdef __native_client__
-       if (!path)
-               path = strdup (nacl_mono_path);
-#endif
        if (!path)
                return;
 
@@ -3492,23 +3461,6 @@ mono_assembly_load_corlib (const MonoRuntimeInfo *runtime, MonoImageOpenStatus *
                return corlib;
        }
 
-       // In native client, Corlib is embedded in the executable as static variable corlibData
-#if defined(__native_client__)
-       if (corlibData != NULL && corlibSize != 0) {
-               int status = 0;
-               /* First "FALSE" instructs mono not to make a copy. */
-               /* Second "FALSE" says this is not just a ref.      */
-               MonoImage* image = mono_image_open_from_data_full (corlibData, corlibSize, FALSE, &status, FALSE);
-               if (image == NULL || status != 0)
-                       g_print("mono_image_open_from_data_full failed: %d\n", status);
-               corlib = mono_assembly_load_from_full (image, "mscorlib", &status, FALSE);
-               if (corlib == NULL || status != 0)
-                       g_print ("mono_assembly_load_from_full failed: %d\n", status);
-               if (corlib)
-                       return corlib;
-       }
-#endif
-
        // A nonstandard preload hook may provide a special mscorlib assembly
        aname = mono_assembly_name_new ("mscorlib.dll");
        corlib = invoke_assembly_preload_hook (aname, assemblies_path);
index 99704f7c428bfe69fac794b09e43e8515c62573b..edc1210587834cd3c50ae1e0b8c5ad92d8517f34 100644 (file)
@@ -129,7 +129,7 @@ mono_gc_base_init (void)
         * we used to do this only when running on valgrind,
         * but it happens also in other setups.
         */
-#if defined(HAVE_PTHREAD_GETATTR_NP) && defined(HAVE_PTHREAD_ATTR_GETSTACK) && !defined(__native_client__)
+#if defined(HAVE_PTHREAD_GETATTR_NP) && defined(HAVE_PTHREAD_ATTR_GETSTACK)
        {
                size_t size;
                void *sstart;
@@ -164,8 +164,6 @@ mono_gc_base_init (void)
 
                GC_stackbottom = (char*)ss.ss_sp;
        }
-#elif defined(__native_client__)
-       /* Do nothing, GC_stackbottom is set correctly in libgc */
 #else
        {
                int dummy;
index 98b3ba551cb005a3af4cbadc884cb576a81e4984..fe71923dbbadbdb97378b047a0f822f80a977749 100644 (file)
@@ -8,10 +8,6 @@
  * Copyright (C) 2005-2009 Novell, Inc. (http://www.novell.com)
  * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  */
-#if defined(__native_client__)
-#include "console-null.c"
-#else
-
 #include <config.h>
 #include <glib.h>
 #include <stdio.h>
@@ -525,5 +521,3 @@ ves_icall_System_ConsoleDriver_TtySetup (MonoString *keypad, MonoString *teardow
 
        return TRUE;
 }
-#endif /* #if defined(__native_client__) */
-
index 111ed39e6ba610289e1faf69a43f336f05e0a4da..f561dc15b4cb01fd6956f23df5c277339b0fdd08 100644 (file)
@@ -416,10 +416,6 @@ mono_domain_finalize (MonoDomain *domain, guint32 timeout)
        gboolean ret;
        gint64 start;
 
-#if defined(__native_client__)
-       return FALSE;
-#endif
-
        if (mono_thread_internal_current () == gc_thread)
                /* We are called from inside a finalizer, not much we can do here */
                return FALSE;
index eddd8bf2b076cf5dfdf7ee9e9b63a38f6c573e52..756f58f8062a0fe4032498e136eb6a9c94968924 100644 (file)
@@ -6676,11 +6676,6 @@ ves_icall_System_Environment_Exit (int result)
 {
        mono_environment_exitcode_set (result);
 
-/* FIXME: There are some cleanup hangs that should be worked out, but
- * if the program is going to exit, everything will be cleaned up when
- * NaCl exits anyway.
- */
-#ifndef __native_client__
        if (!mono_runtime_try_shutdown ())
                mono_thread_exit ();
 
@@ -6688,7 +6683,6 @@ ves_icall_System_Environment_Exit (int result)
        mono_thread_suspend_all_other_threads ();
 
        mono_runtime_quit ();
-#endif
 
        /* we may need to do some cleanup here... */
        exit (result);
@@ -7365,12 +7359,6 @@ mono_ArgIterator_IntGetNextArg (MonoArgIterator *iter)
        iter->args = (guint8*)(((gsize)iter->args + (align) - 1) & ~(align - 1));
 #endif
        res.value = iter->args;
-#if defined(__native_client__) && SIZEOF_REGISTER == 8
-       /* Values are stored as 8 byte register sized objects, but 'value'
-        * is dereferenced as a pointer in other routines.
-        */
-       res.value = (char*)res.value + 4;
-#endif
 #if G_BYTE_ORDER != G_LITTLE_ENDIAN
        if (arg_size <= sizeof (gpointer)) {
                int dummy;
index 7cff2952632bb4673e16069e807be67ed6b08122..e3d19ca7c130c3ef57cf87b841a6920a1712e55d 100644 (file)
@@ -668,7 +668,7 @@ mono_config_parse (const char *filename) {
        mono_config_parse_file (mono_cfg);
        g_free (mono_cfg);
 
-#if !defined(TARGET_WIN32) && !defined(__native_client__)
+#if !defined(TARGET_WIN32)
        home = g_get_home_dir ();
        user_cfg = g_strconcat (home, G_DIR_SEPARATOR_S, ".mono/config", NULL);
        mono_config_parse_file (user_cfg);
diff --git a/mono/metadata/nacl-stub.c b/mono/metadata/nacl-stub.c
deleted file mode 100644 (file)
index ca87582..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * \file
- */
-
-#if defined(__native_client__)
-
-#include "nacl-stub.h"
-
-struct group *getgrnam(const char *name)
-{
-       return NULL;
-}
-
-struct group *getgrgid(gid_t gid)
-{
-       errno = EIO;
-       return NULL;
-}
-
-int fsync(int fd)
-{
-       errno = EINVAL;
-       return -1;
-}
-
-#ifdef USE_NEWLIB
-dev_t makedev(int maj, int min)
-{
-       return (maj)*256+(min);
-}
-
-int utime(const char *filename, const void *times)
-{
-       errno = EACCES;
-       return -1;
-}
-
-int kill(pid_t pid, int sig)
-{
-       errno = EACCES;
-       return -1;
-}
-
-int getrusage(int who, void *usage)
-{
-       errno = EACCES;
-       return -1;
-}
-
-int lstat(const char *path, struct stat *buf)
-{
-       return stat (path, buf);
-}
-
-int getdtablesize(void)
-{
-#ifdef OPEN_MAX
-  return OPEN_MAX;
-#else
-  return 256;
-#endif
-}
-
-size_t getpagesize(void)
-{
-#ifdef PAGE_SIZE
-  return PAGE_SIZE;
-#else
-  return 4096;
-#endif
-}
-
-int sem_trywait(sem_t *sem) {
-  g_assert_not_reached ();
-  return -1;
-}
-
-int sem_timedwait(sem_t *sem, const struct timespec *abs_timeout) {
-  g_assert_not_reached ();
-  return -1;
-}
-
-#endif
-
-#endif
index 5cc8e1d86f906d0541dff394a7f445f59fb8de8f..6f1a34e2dfc46b18eea5a8d7131ff418a934bcba 100644 (file)
@@ -3916,10 +3916,6 @@ collect_appdomain_thread (gpointer key, gpointer value, gpointer user_data)
 gboolean
 mono_threads_abort_appdomain_threads (MonoDomain *domain, int timeout)
 {
-#ifdef __native_client__
-       return FALSE;
-#endif
-
        abort_appdomain_data user_data;
        gint64 start_time;
        int orig_timeout = timeout;
index 6fcb0f691f19ed0ec8c362698b4ee38fe6893e9a..38ca36a1a9eff4f07f8c468757c7d74c7278cb72 100644 (file)
@@ -721,11 +721,6 @@ _wapi_io_scandir (const gchar *dirname, const gchar *pattern, gchar ***namelist)
 static gboolean
 _wapi_lock_file_region (gint fd, off_t offset, off_t length)
 {
-#if defined(__native_client__)
-       printf("WARNING: %s: fcntl() not available on Native Client!\n", __func__);
-       // behave as below -- locks are not available
-       return TRUE;
-#else
        struct flock lock_data;
        gint ret;
 
@@ -766,16 +761,11 @@ _wapi_lock_file_region (gint fd, off_t offset, off_t length)
        }
 
        return TRUE;
-#endif /* __native_client__ */
 }
 
 static gboolean
 _wapi_unlock_file_region (gint fd, off_t offset, off_t length)
 {
-#if defined(__native_client__)
-       printf("WARNING: %s: fcntl() not available on Native Client!\n", __func__);
-       return TRUE;
-#else
        struct flock lock_data;
        gint ret;
 
@@ -811,7 +801,6 @@ _wapi_unlock_file_region (gint fd, off_t offset, off_t length)
        }
 
        return TRUE;
-#endif /* __native_client__ */
 }
 
 static void file_close (gpointer handle, gpointer data);
@@ -1529,8 +1518,6 @@ static gboolean file_setendoffile(gpointer handle)
        }
 #endif
 
-/* Native Client has no ftruncate function, even in standalone sel_ldr. */
-#ifndef __native_client__
        /* always truncate, because the extend write() adds an extra
         * byte to the end of the file
         */
@@ -1547,7 +1534,6 @@ static gboolean file_setendoffile(gpointer handle)
                _wapi_set_last_error_from_errno ();
                return(FALSE);
        }
-#endif
                
        return(TRUE);
 }
@@ -2407,13 +2393,6 @@ mono_w32file_create(const gunichar2 *name, guint32 fileaccess, guint32 sharemode
                
                return(INVALID_HANDLE_VALUE);
        }
-#ifdef __native_client__
-       /* Workaround: Native Client currently returns the same fake inode
-        * for all files, so do a simple hash on the filename so we don't
-        * use the same share info for each file.
-        */
-       statbuf.st_ino = g_str_hash(filename);
-#endif
 
        if (share_allows_open (&statbuf, sharemode, fileaccess,
                         &file_handle.share_info) == FALSE) {
@@ -2988,7 +2967,6 @@ _wapi_stdhandle_create (gint fd, const gchar *name)
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: creating standard handle type %s, fd %d", __func__, name, fd);
 
-#if !defined(__native_client__)
        /* Check if fd is valid */
        do {
                flags = fcntl(fd, F_GETFL);
@@ -3019,13 +2997,6 @@ _wapi_stdhandle_create (gint fd, const gchar *name)
                file_handle.fileaccess = 0;
                break;
        }
-#else
-       /*
-        * fcntl will return -1 in nacl, as there is no real file system API.
-        * Yet, standard streams are available.
-        */
-       file_handle.fileaccess = (fd == STDIN_FILENO) ? GENERIC_READ : GENERIC_WRITE;
-#endif
 
        file_handle.fd = fd;
        file_handle.filename = g_strdup(name);
@@ -3529,7 +3500,6 @@ retry:
                goto retry;
        }
 
-#ifndef __native_client__
        result = _wapi_lstat (filename, &linkbuf);
        if (result != 0) {
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: lstat failed: %s", __func__, filename);
@@ -3537,7 +3507,6 @@ retry:
                g_free (filename);
                goto retry;
        }
-#endif
 
        utf8_filename = mono_utf8_from_external (filename);
        if (utf8_filename == NULL) {
@@ -3561,11 +3530,7 @@ retry:
        else
                create_time = buf.st_ctime;
        
-#ifdef __native_client__
-       find_data->dwFileAttributes = _wapi_stat_to_file_attributes (utf8_filename, &buf, NULL);
-#else
        find_data->dwFileAttributes = _wapi_stat_to_file_attributes (utf8_filename, &buf, &linkbuf);
-#endif
 
        time_t_to_filetime (create_time, &find_data->ftCreationTime);
        time_t_to_filetime (buf.st_atime, &find_data->ftLastAccessTime);
@@ -3750,20 +3715,14 @@ mono_w32file_get_attributes (const gunichar2 *name)
                return (INVALID_FILE_ATTRIBUTES);
        }
 
-#ifndef __native_client__
        result = _wapi_lstat (utf8_name, &linkbuf);
        if (result != 0) {
                _wapi_set_last_path_error_from_errno (NULL, utf8_name);
                g_free (utf8_name);
                return (INVALID_FILE_ATTRIBUTES);
        }
-#endif
        
-#ifdef __native_client__
-       ret = _wapi_stat_to_file_attributes (utf8_name, &buf, NULL);
-#else
        ret = _wapi_stat_to_file_attributes (utf8_name, &buf, &linkbuf);
-#endif
        
        g_free (utf8_name);
 
@@ -3908,12 +3867,6 @@ mono_w32file_get_cwd (guint32 length, gunichar2 *buffer)
        glong count;
        gsize bytes;
 
-#ifdef __native_client__
-       gchar *path = g_get_current_dir ();
-       if (length < strlen(path) + 1 || path == NULL)
-               return 0;
-       memcpy (buffer, path, strlen(path) + 1);
-#else
        if (getcwd ((gchar*)buffer, length) == NULL) {
                if (errno == ERANGE) { /*buffer length is not big enough */ 
                        gchar *path = g_get_current_dir (); /*FIXME g_get_current_dir doesn't work with broken paths and calling it just to know the path length is silly*/
@@ -3927,7 +3880,6 @@ mono_w32file_get_cwd (guint32 length, gunichar2 *buffer)
                _wapi_set_last_error_from_errno ();
                return 0;
        }
-#endif
 
        utf16_path = mono_unicode_from_external ((gchar*)buffer, &bytes);
        count = (bytes/2)+1;
@@ -4919,7 +4871,7 @@ mono_w32file_get_drive_type(const gunichar2 *root_path_name)
        return (drive_type);
 }
 
-#if defined (PLATFORM_MACOSX) || defined (__linux__) || defined(PLATFORM_BSD) || defined(__native_client__) || defined(__FreeBSD_kernel__) || defined(__HAIKU__)
+#if defined (PLATFORM_MACOSX) || defined (__linux__) || defined(PLATFORM_BSD) || defined(__FreeBSD_kernel__) || defined(__HAIKU__)
 static gchar*
 get_fstypename (gchar *utfpath)
 {
index a08d93b4137fe71b2f60d77b25010a51bd3d5638..b2107a6c524d8a33b267af7af06c601020fa2caf 100755 (executable)
@@ -509,10 +509,6 @@ test_sources =                     \
        MemoryIntrinsics.il     \
        mixed.cs
 
-if NACL_CODEGEN
-test_sources += nacl.cs
-endif
-
 regtests_UNIVERSAL = \
        basic.exe \
        basic-float.exe \
@@ -529,10 +525,6 @@ regtests_UNIVERSAL = \
        unaligned.exe   \
        basic-vectors.exe
 
-if NACL_CODEGEN
-regtests_UNIVERSAL += nacl.exe
-endif
-
 regtests_DISABLED = 
 
 if FULL_AOT_TESTS
@@ -678,11 +670,7 @@ generics-variant-types.dll: generics-variant-types.il
 MemoryIntrinsics.dll: MemoryIntrinsics.il
        $(ILASM) -dll -output=$@ $<
 
-if NACL_CODEGEN
-GENMDESC_OPTS=--nacl
-else !NACL_CODEGEN
 GENMDESC_OPTS=
-endif !NACL_CODEGEN
 
 # we don't always use the perl impl because it's an additional
 # build dependency for the poor windows users
@@ -691,11 +679,7 @@ endif !NACL_CODEGEN
 if CROSS_COMPILING
 GENMDESC_PRG=perl $(srcdir)/genmdesc.pl $(arch_define) $(srcdir) $(GENMDESC_OPTS)
 else !CROSS_COMPILING
-if NACL_CODEGEN
-GENMDESC_PRG=perl $(srcdir)/genmdesc.pl $(arch_define) $(srcdir) $(GENMDESC_OPTS)
-else
 GENMDESC_PRG=./genmdesc $(GENMDESC_OPTS)
-endif
 endif !CROSS_COMPILING
 
 cpu-x86.h: cpu-x86.md genmdesc$(EXEEXT)
index edc5ca6c69fe1a3d3bceae327266ae5b35548a47..59a042984997c31746f7cc869e02bb9e9d1414fb 100644 (file)
@@ -78,7 +78,7 @@
 #define TARGET_WIN32_MSVC
 #endif
 
-#if defined(__linux__) || defined(__native_client_codegen__)
+#if defined(__linux__)
 #define RODATA_SECT ".rodata"
 #elif defined(TARGET_MACH)
 #define RODATA_SECT ".section __TEXT, __const"
@@ -953,10 +953,8 @@ emit_code_bytes (MonoAotCompile *acfg, const guint8* buf, int size)
 #ifdef TARGET_X86
 #ifdef TARGET_WIN32
 #define AOT_TARGET_STR "X86 (WIN32)"
-#elif defined(__native_client_codegen__)
-#define AOT_TARGET_STR "X86 (native client codegen)"
 #else
-#define AOT_TARGET_STR "X86 (!native client codegen)"
+#define AOT_TARGET_STR "X86"
 #endif
 #endif
 
@@ -10361,19 +10359,13 @@ compile_asm (MonoAotCompile *acfg)
 #define AS_OPTIONS "-a64 -mppc64"
 #elif defined(sparc) && SIZEOF_VOID_P == 8
 #define AS_OPTIONS "-xarch=v9"
-#elif defined(TARGET_X86) && defined(TARGET_MACH) && !defined(__native_client_codegen__)
+#elif defined(TARGET_X86) && defined(TARGET_MACH)
 #define AS_OPTIONS "-arch i386"
 #else
 #define AS_OPTIONS ""
 #endif
 
-#ifdef __native_client_codegen__
-#if defined(TARGET_AMD64)
-#define AS_NAME "nacl64-as"
-#else
-#define AS_NAME "nacl-as"
-#endif
-#elif defined(TARGET_OSX)
+#if defined(TARGET_OSX)
 #define AS_NAME "clang"
 #elif defined(TARGET_WIN32_MSVC)
 #define AS_NAME "clang.exe"
@@ -10402,7 +10394,7 @@ compile_asm (MonoAotCompile *acfg)
 #elif defined(TARGET_WIN32) && !defined(TARGET_ANDROID)
 #define LD_NAME "gcc"
 #define LD_OPTIONS "-shared"
-#elif defined(TARGET_X86) && defined(TARGET_MACH) && !defined(__native_client_codegen__)
+#elif defined(TARGET_X86) && defined(TARGET_MACH)
 #define LD_NAME "clang"
 #define LD_OPTIONS "-m32 -dynamiclib"
 #elif defined(TARGET_ARM) && !defined(TARGET_ANDROID)
index 30ef9a64ad7bc9628a0e2a5a52c7306b469dd6d1..a1ee87fd60b8c8e247099d1da51ee9bdf65c5155 100644 (file)
@@ -2283,16 +2283,6 @@ load_aot_module (MonoAssembly *assembly, gpointer user_data)
         * non-lazily, since we can't handle out-of-date errors later.
         * The cached class info also depends on the exact assemblies.
         */
-#if defined(__native_client__)
-       /* TODO: Don't 'load_image' on mscorlib due to a */
-       /* recursive loading problem.  This should be    */
-       /* removed if mscorlib is loaded from disk.      */
-       if (strncmp(assembly->aname.name, "mscorlib", 8)) {
-               do_load_image = TRUE;
-       } else {
-               do_load_image = FALSE;
-       }
-#endif
        if (do_load_image) {
                for (i = 0; i < amodule->image_table_len; ++i) {
                        MonoError error;
@@ -2353,9 +2343,7 @@ mono_aot_init (void)
        mono_os_mutex_init_recursive (&aot_page_mutex);
        aot_modules = g_hash_table_new (NULL, NULL);
 
-#ifndef __native_client__
        mono_install_assembly_load_hook (load_aot_module, NULL);
-#endif
        mono_counters_register ("Async JIT info size", MONO_COUNTER_INT|MONO_COUNTER_JIT, &async_jit_info_size);
 
        char *lastaot = g_getenv ("MONO_LASTAOT");
index 2f964b4162f88a70a06caaf992da8b14db18bac2..0dab1240f8637cd2ac334e2b881124aeb441ca83 100644 (file)
@@ -819,17 +819,9 @@ replace_in_block (MonoBasicBlock *bb, MonoBasicBlock *orig, MonoBasicBlock *repl
 }
 
 static void
-replace_out_block_in_code (MonoBasicBlock *bb, MonoBasicBlock *orig, MonoBasicBlock *repl) {
+replace_out_block_in_code (MonoBasicBlock *bb, MonoBasicBlock *orig, MonoBasicBlock *repl)
+{
        MonoInst *ins;
-
-#if defined(__native_client_codegen__)
-       /* Need to maintain this flag for the new block because */
-       /* we can't jump indirectly to a non-aligned block.     */
-       if (orig->flags & BB_INDIRECT_JUMP_TARGET)
-       {
-               repl->flags |= BB_INDIRECT_JUMP_TARGET;
-       }
-#endif
        
        for (ins = bb->code; ins != NULL; ins = ins->next) {
                switch (ins->opcode) {
index 8719a12994c8e3fa936f5c34277412141aa72953..3d887e84d3acd47f2e6132d6cbdab9fa53c212ae 100644 (file)
@@ -121,10 +121,6 @@ opt_names [] = {
 
 #endif
 
-#ifdef __native_client__
-extern char *nacl_mono_path;
-#endif
-
 #define DEFAULT_OPTIMIZATIONS (        \
        MONO_OPT_PEEPHOLE |     \
        MONO_OPT_CFOLD |        \
@@ -1603,9 +1599,6 @@ mono_main (int argc, char* argv[])
 #ifdef HOST_WIN32
        int mixed_mode = FALSE;
 #endif
-#ifdef __native_client__
-       gboolean nacl_null_checks_off = FALSE;
-#endif
 
 #ifdef MOONLIGHT
 #ifndef HOST_WIN32
@@ -1937,13 +1930,6 @@ mono_main (int argc, char* argv[])
 #else
                        fprintf (stderr, "Mono Warning: --interp= not enabled in this runtime.\n");
 #endif
-
-#ifdef __native_client__
-               } else if (strcmp (argv [i], "--nacl-mono-path") == 0){
-                       nacl_mono_path = g_strdup(argv[++i]);
-               } else if (strcmp (argv [i], "--nacl-null-checks-off") == 0){
-                       nacl_null_checks_off = TRUE;
-#endif
                } else if (strncmp (argv [i], "--assembly-loader=", strlen("--assembly-loader=")) == 0) {
                        gchar *arg = argv [i] + strlen ("--assembly-loader=");
                        if (strcmp (arg, "strict") == 0)
@@ -1968,13 +1954,6 @@ mono_main (int argc, char* argv[])
                }
        }
 
-#ifdef __native_client_codegen__
-       if (!nacl_null_checks_off) {
-               MonoDebugOptions *opt = mini_get_debug_options ();
-               opt->explicit_null_checks = TRUE;
-       }
-#endif
-
 #if defined(DISABLE_HW_TRAPS) || defined(MONO_ARCH_DISABLE_HW_TRAPS)
        // Signal handlers not available
        {
index f21ba2b5d18493d36caff6c2c3f4a94196963640..07f498e628ba1812082dbf0cb1d3a12b2d86245d 100644 (file)
@@ -1462,7 +1462,6 @@ class Tests
                return 0;
        }
        
-       [Category ("NaClDisable")]
        public static int test_0_div_zero () {
                int d = 1;
                int q = 0;
@@ -1633,7 +1632,6 @@ class Tests
                return 0;
        }
 
-       [Category ("NaClDisable")]
        public static int test_0_long_div_zero () {
                long d = 1;
                long q = 0;
index 357651ee64175b78d2d4ecb3fd1d88ee7b808853..60ff683a9af013b5e752fba402e179e89eb425d5 100644 (file)
 #include <string.h>
 #include <mono/metadata/opcodes.h>
 
-#if defined(__native_client__) || defined(__native_client_codegen__)
-volatile int __nacl_thread_suspension_needed = 0;
-void __nacl_suspend_thread_if_needed() {}
-#endif
-
 #define MINI_OP(a,b,dest,src1,src2) b,
 #define MINI_OP3(a,b,dest,src1,src2,src3) b,
 /* keep in sync with the enum in mini.h */
index 7f681b23bb5ba355da140cd5fb52c4b0fac81acb..6a741ca23b0ac313ca8be69ed98f7e507ebbebdf 100644 (file)
@@ -135,9 +135,6 @@ mono_blockset_print (MonoCompile *cfg, MonoBitSet *set, const char *name, guint
 void
 mono_disassemble_code (MonoCompile *cfg, guint8 *code, int size, char *id)
 {
-#if defined(__native_client__)
-       return;
-#endif
 #ifndef DISABLE_LOGGING
        GHashTable *offset_to_bb_hash = NULL;
        int i, cindex, bb_num;
index f381ac8358750ff78ef0ac55f11862c110b6442d..b5cf20dfde120e02d353ad7e69e64c3b82788dd6 100644 (file)
@@ -55,7 +55,7 @@
  * TARGET_ASM_GAS == GNU assembler
  */
 #if !defined(TARGET_ASM_APPLE) && !defined(TARGET_ASM_GAS)
-#if defined(TARGET_MACH) && !defined(__native_client_codegen__)
+#if defined(TARGET_MACH)
 #define TARGET_ASM_APPLE
 #else
 #define TARGET_ASM_GAS
@@ -329,11 +329,6 @@ bin_writer_emit_ensure_buffer (BinSection *section, int size)
                while (new_size <= new_offset)
                        new_size *= 2;
                data = (guint8 *)g_malloc0 (new_size);
-#ifdef __native_client_codegen__
-               /* for Native Client, fill empty space with HLT instruction */
-               /* instead of 00.                                           */
-               memset(data, 0xf4, new_size);
-#endif         
                memcpy (data, section->data, section->data_len);
                g_free (section->data);
                section->data = data;
index 648e69cf18cc49cff4c27e6ee517637df2d83a68..2b66be22f182a3b0b0289899dd46a4e02fe054bb 100644 (file)
@@ -1089,16 +1089,6 @@ mono_lconv_to_r8_un (guint64 a)
 }
 #endif
 
-#if defined(__native_client_codegen__) || defined(__native_client__)
-/* When we cross-compile to Native Client we can't directly embed calls */
-/* to the math library on the host. This will use the fmod on the target*/
-double
-mono_fmod(double a, double b)
-{
-       return fmod(a, b);
-}
-#endif
-
 gpointer
 mono_helper_compile_generic_method (MonoObject *obj, MonoMethod *method, gpointer *this_arg)
 {
index f605a709507ac845e886240354877a313bd91c68..ffe4342d2398168fc42fde8ef57f2e2649eaf7f9 100644 (file)
@@ -99,10 +99,6 @@ double mono_conv_to_r8_un (guint32 a);
 
 double mono_lconv_to_r8_un (guint64 a);
 
-#if defined(__native_client_codegen__) || defined(__native_client__)
-double mono_fmod(double a, double b);
-#endif
-
 gpointer mono_helper_compile_generic_method (MonoObject *obj, MonoMethod *method, gpointer *this_arg);
 
 MonoString*
index 10a9daa20ef24f7fd45f015a82d119d3c3f80a17..9f2be7efacc50d72195d484bcfcafa460ac77e44 100644 (file)
@@ -323,7 +323,7 @@ mono_arm_patchable_bl (guint8 *code, int cond)
        return code;
 }
 
-#if defined(__ARM_EABI__) && defined(__linux__) && !defined(PLATFORM_ANDROID) && !defined(__native_client__) && !defined(MONO_CROSS_COMPILE)
+#if defined(__ARM_EABI__) && defined(__linux__) && !defined(PLATFORM_ANDROID) && !defined(MONO_CROSS_COMPILE)
 #define HAVE_AEABI_READ_TP 1
 #endif
 
index 3659f7b99a420a344268ab756e9daedbfde50f4f..5bcf5435df0e2a65a9a2f154b6582c80f8f3674f 100644 (file)
@@ -75,7 +75,7 @@
 #include <mach/clock.h>
 #endif
 
-#if defined(__native_client__) || defined(HOST_WATCHOS)
+#if defined(HOST_WATCHOS)
 
 void
 mono_runtime_setup_stat_profiler (void)
@@ -840,16 +840,7 @@ mono_runtime_setup_stat_profiler (void)
 
 #endif
 
-#endif /* defined(__native_client__) || defined(HOST_WATCHOS) */
-
-#if defined(__native_client__)
-
-void
-mono_gdb_render_native_backtraces (pid_t crashed_pid)
-{
-}
-
-#else
+#endif /* defined(HOST_WATCHOS) */
 
 static gboolean
 native_stack_with_gdb (pid_t crashed_pid, const char **argv, FILE *commands, char* commands_filename)
@@ -946,8 +937,6 @@ exec:
 #endif // HAVE_EXECV
 }
 
-#endif /* defined(__native_client__) */
-
 #if !defined (__MACH__)
 
 gboolean
index 7d427a915ee53263ccff6c19689782a15c5c48d7..703eb5373da6b4d4f62c38ef974c24f3a5cad0c4 100644 (file)
@@ -372,16 +372,6 @@ mono_global_codeman_foreach (MonoCodeManagerFunc func, void *user_data)
        mono_jit_unlock ();
 }
 
-#if defined(__native_client_codegen__) && defined(__native_client__)
-void
-mono_nacl_gc()
-{
-#ifdef __native_client_gc__
-       __nacl_suspend_thread_if_needed();
-#endif
-}
-#endif /* __native_client__ */
-
 /**
  * mono_create_unwind_op:
  *
@@ -1403,21 +1393,12 @@ mono_resolve_patch_target (MonoMethod *method, MonoDomain *domain, guint8 *code,
                break;
        }
        case MONO_PATCH_INFO_GC_SAFE_POINT_FLAG:
-#if defined(__native_client_codegen__)
-               target = (gpointer)&__nacl_thread_suspension_needed;
-#else
                g_assert (mono_threads_is_coop_enabled ());
                target = (gpointer)&mono_polling_required;
-#endif
                break;
        case MONO_PATCH_INFO_SWITCH: {
                gpointer *jump_table;
                int i;
-#if defined(__native_client__) && defined(__native_client_codegen__)
-               /* This memory will leak, but we don't care if we're */
-               /* not deleting JIT'd methods anyway                 */
-               jump_table = g_malloc0 (sizeof(gpointer) * patch_info->data.table->table_size);
-#else
                if (method && method->dynamic) {
                        jump_table = (void **)mono_code_manager_reserve (mono_dynamic_code_hash_lookup (domain, method)->code_mp, sizeof (gpointer) * patch_info->data.table->table_size);
                } else {
@@ -1427,7 +1408,6 @@ mono_resolve_patch_target (MonoMethod *method, MonoDomain *domain, guint8 *code,
                                jump_table = (void **)mono_domain_code_reserve (domain, sizeof (gpointer) * patch_info->data.table->table_size);
                        }
                }
-#endif
 
                for (i = 0; i < patch_info->data.table->table_size; i++) {
                        jump_table [i] = code + GPOINTER_TO_INT (patch_info->data.table->table [i]);
@@ -3763,7 +3743,7 @@ mini_init (const char *filename, const char *runtime_version)
 
        CHECKED_MONO_INIT ();
 
-#if defined(__linux__) && !defined(__native_client__)
+#if defined(__linux__)
        if (access ("/proc/self/maps", F_OK) != 0) {
                g_print ("Mono requires /proc to be mounted.\n");
                exit (1);
@@ -4067,10 +4047,6 @@ register_icalls (void)
        register_icall (mono_thread_interruption_checkpoint, "mono_thread_interruption_checkpoint", "object", FALSE);
        register_icall (mono_thread_force_interruption_checkpoint_noraise, "mono_thread_force_interruption_checkpoint_noraise", "object", FALSE);
 
-#if defined(__native_client__) || defined(__native_client_codegen__)
-       register_icall (mono_nacl_gc, "mono_nacl_gc", "void", FALSE);
-#endif
-
        if (mono_threads_is_coop_enabled ())
                register_icall (mono_threads_state_poll, "mono_threads_state_poll", "void", FALSE);
 
@@ -4139,12 +4115,8 @@ register_icalls (void)
        register_opcode_emulation (OP_LCONV_TO_R_UN, "__emul_lconv_to_r8_un", "double long", mono_lconv_to_r8_un, "mono_lconv_to_r8_un", FALSE);
 #endif
 #ifdef MONO_ARCH_EMULATE_FREM
-#if !defined(__native_client__)
        register_opcode_emulation (OP_FREM, "__emul_frem", "double double double", fmod, "fmod", FALSE);
        register_opcode_emulation (OP_RREM, "__emul_rrem", "float float float", fmodf, "fmodf", FALSE);
-#else
-       register_opcode_emulation (OP_FREM, "__emul_frem", "double double double", mono_fmod, "mono_fmod", FALSE);
-#endif
 #endif
 
 #ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
index c81919ececada46517dc824b89e7a60219885640..b2f16b7fe47cf613e1e591f761ac8167b4d2c2ca 100644 (file)
@@ -2152,18 +2152,11 @@ mono_postprocess_patches (MonoCompile *cfg)
                }
                case MONO_PATCH_INFO_SWITCH: {
                        gpointer *table;
-#if defined(__native_client__) && defined(__native_client_codegen__)
-                       /* This memory will leak.  */
-                       /* TODO: can we free this when  */
-                       /* making the final jump table? */
-                       table = g_malloc0 (sizeof(gpointer) * patch_info->data.table->table_size);
-#else
                        if (cfg->method->dynamic) {
                                table = (void **)mono_code_manager_reserve (cfg->dynamic_info->code_mp, sizeof (gpointer) * patch_info->data.table->table_size);
                        } else {
                                table = (void **)mono_domain_code_reserve (cfg->domain, sizeof (gpointer) * patch_info->data.table->table_size);
                        }
-#endif
 
                        for (i = 0; i < patch_info->data.table->table_size; i++) {
                                /* Might be NULL if the switch is eliminated */
@@ -2385,9 +2378,6 @@ mono_codegen (MonoCompile *cfg)
        } else {
                mono_domain_code_commit (code_domain, cfg->native_code, cfg->code_size, cfg->code_len);
        }
-#if defined(__native_client_codegen__) && defined(__native_client__)
-       cfg->native_code = code_dest;
-#endif
        mono_profiler_code_buffer_new (cfg->native_code, cfg->code_len, MONO_PROFILER_CODE_BUFFER_METHOD, cfg->method);
        
        mono_arch_flush_icache (cfg->native_code, cfg->code_len);
@@ -2869,12 +2859,8 @@ mono_create_gc_safepoint (MonoCompile *cfg, MonoBasicBlock *bblock)
        if (cfg->verbose_level > 1)
                printf ("ADDING SAFE POINT TO BB %d\n", bblock->block_num);
 
-#if defined(__native_client_codegen__)
-       NEW_AOTCONST (cfg, poll_addr, MONO_PATCH_INFO_GC_SAFE_POINT_FLAG, (gpointer)&__nacl_thread_suspension_needed);
-#else
        g_assert (mono_threads_is_coop_enabled ());
        NEW_AOTCONST (cfg, poll_addr, MONO_PATCH_INFO_GC_SAFE_POINT_FLAG, (gpointer)&mono_polling_required);
-#endif
 
        MONO_INST_NEW (cfg, ins, OP_GC_SAFE_POINT);
        ins->sreg1 = poll_addr->dreg;
@@ -2919,19 +2905,13 @@ mono_insert_safepoints (MonoCompile *cfg)
 {
        MonoBasicBlock *bb;
 
-#if !defined(__native_client_codegen__)
        if (!mono_threads_is_coop_enabled ())
                return;
-#endif
 
        if (cfg->method->wrapper_type == MONO_WRAPPER_MANAGED_TO_NATIVE) {
                WrapperInfo *info = mono_marshal_get_wrapper_info (cfg->method);
-#if defined(__native_client__) || defined(__native_client_codegen__)
-               gpointer poll_func = &mono_nacl_gc;
-#else
                g_assert (mono_threads_is_coop_enabled ());
                gpointer poll_func = &mono_threads_state_poll;
-#endif
 
                if (info && info->subtype == WRAPPER_SUBTYPE_ICALL_WRAPPER && info->d.icall.func == poll_func) {
                        if (cfg->verbose_level > 1)
@@ -3207,13 +3187,9 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
                cfg->gen_seq_points = FALSE;
                cfg->gen_sdb_seq_points = FALSE;
        }
-       /* coop / nacl requires loop detection to happen */
-#if defined(__native_client_codegen__)
-       cfg->opt |= MONO_OPT_LOOP;
-#else
+       /* coop requires loop detection to happen */
        if (mono_threads_is_coop_enabled ())
                cfg->opt |= MONO_OPT_LOOP;
-#endif
        cfg->explicit_null_checks = debug_options.explicit_null_checks || (flags & JIT_FLAG_EXPLICIT_NULL_CHECKS);
        cfg->soft_breakpoints = debug_options.soft_breakpoints;
        cfg->check_pinvoke_callconv = debug_options.check_pinvoke_callconv;
index ed10d8f937934da36d172b9a60b1b2847947453d..021c6a42a7865c7f45f02a6bbe76e82094967687 100644 (file)
 #include "mono/metadata/security-manager.h"
 #include "mono/metadata/exception.h"
 
-#ifdef __native_client_codegen__
-#include <nacl/nacl_dyncode.h>
-#endif
-
-
 /*
  * The mini code should not have any compile time dependencies on the GC being used, so the same object file from mini/
  * can be linked into both mono and mono-sgen.
@@ -1679,11 +1674,6 @@ typedef struct {
        MonoInst *stack_inbalance_var;
 
        unsigned char   *cil_start;
-#ifdef __native_client_codegen__
-       /* this alloc is not aligned, native_code */
-       /* is the 32-byte aligned version of this */
-       unsigned char   *native_code_alloc;
-#endif
        unsigned char   *native_code;
        guint            code_size;
        guint            code_len;
@@ -2500,12 +2490,6 @@ void      mono_liveness_handle_exception_clauses (MonoCompile *cfg);
 /* Native Client functions */
 gpointer mono_realloc_native_code(MonoCompile *cfg);
 
-#if defined(__native_client__) || defined(__native_client_codegen__)
-extern volatile int __nacl_thread_suspension_needed;
-void __nacl_suspend_thread_if_needed(void);
-void mono_nacl_gc(void);
-#endif
-
 extern MonoDebugOptions debug_options;
 
 static inline MonoMethod*
index e5d6ae6bdb82618cfa703fd77e2811170f68788e..c0aa5fdf64a8a37f27bbaced10183f224d0d42ed 100644 (file)
@@ -2,11 +2,7 @@
  * \file
  */
 
-#if defined(__native_client__) && defined(__x86_64__)
-typedef guint64 regmask_t;
-#else
 typedef size_t regmask_t;
-#endif
 
 enum {
        MONO_REG_INT,
index 9010ee26c787c49b1fda2a235ac0ebda605f8555..d3dd15c3b2922cd7ebe7aeb3f229a26358962e59 100644 (file)
@@ -50,10 +50,8 @@ endif
 
 # FIXME fix the profiler tests to work with coop.
 if !ENABLE_COOP
-if !NACL_CODEGEN
 check_targets = testlog
 endif
-endif
 
 endif
 endif
index 1017d1f8e6d4fb9e09b8f08fc4c7c8a976f35db6..3b5d170a694ac1385491fcb43d427c7ae48a33b9 100644 (file)
 #define HASH_SIZE 9371
 #define SMALL_HASH_SIZE 31
 
-#if defined(__native_client__) || defined(__native_client_codegen__)
-volatile int __nacl_thread_suspension_needed = 0;
-void __nacl_suspend_thread_if_needed() {}
-#endif
-
 static int debug = 0;
 static int collect_traces = 0;
 static int show_traces = 0;
index 15af95e3e2a6c0ab31d9fc27487e642101626771..0b3b086a4b1d65cd98a5e18421664df5200bcb6b 100755 (executable)
@@ -707,92 +707,6 @@ PLATFORM_DISABLED_TESTS += \
        sgen-bridge-xref.exe
 endif
 
-if NACL_CODEGEN
-# Tests that use Thread.Abort()
-PLATFORM_DISABLED_TESTS= abort-stress-1.exe \
-                         abort-stress-2.exe \
-                         abort-stress-3.exe \
-                         appdomain-thread-abort.exe \
-                         async-exc-compilation.exe \
-                         bug-561239.exe \
-                         bug-70561.exe \
-                         finalizer-abort.exe \
-                         finally_guard.exe \
-                         finally_block_ending_in_dead_bb.exe \
-                         main-returns-abort-resetabort.exe \
-                         main-returns-background-abort-resetabort.exe \
-                         thread6.exe \
-                         threadpool-exceptions5.exe \
-                         threadpool-exceptions6.exe
-
-PLATFORM_DISABLED_TESTS+= w32message.exe
-
-# Tests that rely on AppDomain.Unload
-PLATFORM_DISABLED_TESTS+= appdomain-async-invoke.exe \
-                          appdomain-exit.exe \
-                          appdomain-unload-callback.exe \
-                          appdomain-unload.exe \
-                          domain-stress.exe \
-                          generic-unloading.2.exe \
-                          monitor.exe \
-                          remoting4.exe \
-                          threadpool-exceptions7.exe \
-                          xdomain-threads.exe
-
-# pinvoke2 attaches a thread to the runtime, but
-# doesn't 'unattach' it and it hangs in GC on exit
-PLATFORM_DISABLED_TESTS+= pinvoke2.exe
-
-# Tests that currently hang waiting for non-main threads
-# to exit in NaCl, need to investigate.  Most are AppDomain
-# creation and Delegate tests.
-PLATFORM_DISABLED_TESTS+= appdomain1.exe \
-                          delegate9.exe \
-                          marshal-valuetypes.exe \
-                          cross-domain.exe \
-                          stackframes-async.2.exe \
-                          generic-marshalbyref.2.exe \
-                          generic-xdomain.2.exe \
-                          bug-415577.exe
-
-# Tests that fail trying to write files (appdomain create mostly)
-PLATFORM_DISABLED_TESTS+= bug-335131.2.exe \
-                          bug-349190.2.exe \
-                          bug-80307.exe \
-                          bug-462592.exe
-
-# FIXME: don't know why delegate2.exe fails, it shouldn't
-PLATFORM_DISABLED_TESTS+= delegate2.exe
-
-# These tests newly fail with the latest revision. pinvoke3 fails because
-# of a thread attach, the others have not been investigated.  TODO revisit.
-PLATFORM_DISABLED_TESTS+= pinvoke3.exe \
-                          async_read.exe \
-                          async-with-cb-throws.exe \
-                          appdomain-unload-doesnot-raise-pending-events.exe \
-                          gsharing-valuetype-layout.exe
-
-if X86
-# FIXME: There are problems with async callbacks and results on NaCl 32-bit
-PLATFORM_DISABLED_TESTS+= delegate1.exe \
-                          delegate3.exe \
-                          delegate5.exe \
-                          delegate8.exe \
-                          threadpool.exe \
-                          threadpool1.exe \
-                          threadpool-exceptions3.exe \
-                          bug-323114.exe \
-                          delegate-exit.exe \
-                          bug-80392.2.exe
-
-# FIXME: These tests hang/fail for unknown reasons, deal with exiting
-PLATFORM_DISABLED_TESTS+= main-returns-background-resetabort.exe \
-                          main-returns-background.exe \
-                          main-returns-background-change.exe
-endif
-
-endif
-
 if ENABLE_COOP
 COOP_DISABLED_TESTS= thunks.exe
 else
@@ -1221,8 +1135,6 @@ tests: compile-tests
 #
 # Test that no symbols are missed in eglib-remap.h
 #
-if NACL_CODEGEN
-else
 if PLATFORM_LINUX
 test-platform: test-eglib-remap
 else
@@ -1230,7 +1142,6 @@ if PLATFORM_DARWIN
 test-platform: test-eglib-remap
 endif
 endif
-endif
 # The following regexp describes all symbols that start with "g_" but are not part of eglibc.
 # The optional underscore prepending symbol names may or may not appear depending on the
 # system and the state of the leading-underscore compiler flag.
@@ -1929,12 +1840,8 @@ test-generic-sharing-normal: $(TESTS_GSHARED) $(TESTSAOT_GSHARED)
 test-generic-sharing-managed: test-runner.exe $(TESTS_GSHARED) $(TESTSAOT_GSHARED) 
        $(Q) $(TOOLS_RUNTIME) $(TEST_RUNNER) -j a --testsuite-name "gshared" --disabled "$(DISABLED_TESTS)" --opt-sets "gshared gshared,shared gshared,-inline gshared,-inline,shared" $(TESTS_GSHARED)
 
-if NACL_CODEGEN
-test-generic-sharing:
-else
 test-generic-sharing:
        @if test x$(M) != x0; then $(MAKE) test-generic-sharing-managed; else $(MAKE) test-generic-sharing-normal; fi
-endif
 
 EXTRA_DIST += async-exceptions.cs
 async-exceptions.exe : async-exceptions.cs
@@ -1957,16 +1864,12 @@ patch-libtool:
        touch libtest.c
 
 
-if NACL_CODEGEN
-test-process-exit:
-else
 EXTRA_DIST += threadpool-in-processexit.cs threadpool-in-processexit.exe.stdout.expected
 test-process-exit:
        @$(MCS) $(srcdir)/threadpool-in-processexit.cs -out:threadpool-in-processexit.exe
        @echo "Testing threadpool-in-processexit.exe..."
        @$(RUNTIME) threadpool-in-processexit.exe > threadpool-in-processexit.exe.stdout
        @diff -w threadpool-in-processexit.exe.stdout $(srcdir)/threadpool-in-processexit.exe.stdout.expected
-endif
 
 # tests that expect a 1 exit code
 TESTS_UNHANDLED_EXCEPTION_1_SRC =      \
index 3177f2d17a1194f5ebc59fbea7382990120a4db5..296893ff2e7f2a77a8e7b5e46f4684d45421b8a4 100644 (file)
@@ -484,13 +484,6 @@ DEFAULT_MMAP_THRESHOLD       default: 256K
 #endif  /* HAVE_MORECORE */
 #endif  /* DARWIN */
 
-#if defined(__native_client__)
-#undef HAVE_MMAP
-#undef HAVE_MREMAP
-#define HAVE_MMAP 0
-#define HAVE_MREMAP 0
-#endif
-
 #ifndef LACKS_SYS_TYPES_H
 #include <sys/types.h>  /* For size_t */
 #endif  /* LACKS_SYS_TYPES_H */
index efbe9f03e7a28eeed84c76c2c110f7ce3bf16f6e..3861e54f5e6a04b75c661be7308939c904008859 100644 (file)
@@ -36,7 +36,7 @@
 void
 mono_sigctx_to_monoctx (void *sigctx, MonoContext *mctx)
 {
-#if defined (__native_client__) || defined (HOST_WATCHOS)
+#if defined (HOST_WATCHOS)
        printf("WARNING: mono_arch_sigctx_to_monoctx() called!\n");
        mctx->eax = 0xDEADBEEF;
        mctx->ebx = 0xDEADBEEF;
@@ -95,13 +95,13 @@ mono_sigctx_to_monoctx (void *sigctx, MonoContext *mctx)
        mctx->esi = ctx->SC_ESI;
        mctx->edi = ctx->SC_EDI;
        mctx->eip = ctx->SC_EIP;
-#endif /* if defined(__native_client__) */
+#endif
 }
 
 void
 mono_monoctx_to_sigctx (MonoContext *mctx, void *sigctx)
 {
-#if defined(__native_client__) || defined(HOST_WATCHOS)
+#if defined(HOST_WATCHOS)
        printf("WARNING: mono_arch_monoctx_to_sigctx() called!\n");
 #elif MONO_CROSS_COMPILE
        g_assert_not_reached ();
@@ -151,7 +151,7 @@ mono_monoctx_to_sigctx (MonoContext *mctx, void *sigctx)
        ctx->SC_ESI = mctx->esi;
        ctx->SC_EDI = mctx->edi;
        ctx->SC_EIP = mctx->eip;
-#endif /* __native_client__ */
+#endif
 }
 
 #elif (defined(__x86_64__) && !defined(MONO_CROSS_COMPILE)) || (defined(TARGET_AMD64)) /* defined(__i386__) */
@@ -165,10 +165,6 @@ mono_monoctx_to_sigctx (MonoContext *mctx, void *sigctx)
 void
 mono_sigctx_to_monoctx (void *sigctx, MonoContext *mctx)
 {
-#if defined(__native_client_codegen__) || defined(__native_client__)
-       printf("WARNING: mono_arch_sigctx_to_monoctx() called!\n");
-#endif
-
 #ifdef MONO_CROSS_COMPILE
        g_assert_not_reached ();
 #elif defined(MONO_SIGNAL_USE_UCONTEXT_T)
@@ -239,10 +235,6 @@ mono_sigctx_to_monoctx (void *sigctx, MonoContext *mctx)
 void
 mono_monoctx_to_sigctx (MonoContext *mctx, void *sigctx)
 {
-#if defined(__native_client__) || defined(__native_client_codegen__)
-  printf("WARNING: mono_arch_monoctx_to_sigctx() called!\n");
-#endif
-
 #ifdef MONO_CROSS_COMPILE
        g_assert_not_reached ();
 #elif defined(MONO_SIGNAL_USE_UCONTEXT_T)
@@ -358,8 +350,6 @@ mono_sigctx_to_monoctx (void *sigctx, MonoContext *mctx)
 {
 #ifdef MONO_CROSS_COMPILE
        g_assert_not_reached ();
-#elif defined(__native_client__)
-       g_assert_not_reached ();
 #else
        arm_ucontext *my_uc = sigctx;
 
@@ -378,8 +368,6 @@ mono_monoctx_to_sigctx (MonoContext *mctx, void *ctx)
 {
 #ifdef MONO_CROSS_COMPILE
        g_assert_not_reached ();
-#elif defined(__native_client__)
-       g_assert_not_reached ();
 #else
        arm_ucontext *my_uc = ctx;
 
index 3cc722f0aae7d7909614be82bc9b3f14ab41b121..b26442f73f5c7897e5ec9da2bf1881399dacf2fa 100644 (file)
@@ -44,10 +44,6 @@ typedef struct __darwin_xmm_reg MonoContextSimdReg;
 #endif
 #endif
 
-#if defined(__native_client__)
-#undef MONO_SIGNAL_USE_UCONTEXT_T
-#endif
-
 #ifdef __HAIKU__
 /* sigcontext surrogate */
 struct sigcontext {
@@ -213,7 +209,7 @@ typedef struct {
 
 #include <mono/arch/amd64/amd64-codegen.h>
 
-#if !defined( HOST_WIN32 ) && !defined(__native_client__) && !defined(__native_client_codegen__)
+#if !defined( HOST_WIN32 )
 
 #if defined(HAVE_SIGACTION) || defined(__APPLE__)  // the __APPLE__ check is required for the tvos simulator, which has ucontext_t but not sigaction
 #define MONO_SIGNAL_USE_UCONTEXT_T 1
@@ -243,30 +239,6 @@ typedef struct {
 extern void mono_context_get_current (void *);
 #define MONO_CONTEXT_GET_CURRENT(ctx) do { mono_context_get_current((void*)&(ctx)); } while (0)
 
-#elif defined(__native_client__)
-#define MONO_CONTEXT_GET_CURRENT(ctx)  \
-       __asm__ __volatile__(   \
-               "movq $0x0,  %%nacl:0x00(%%r15, %0, 1)\n"       \
-               "movq %%rcx, %%nacl:0x08(%%r15, %0, 1)\n"       \
-               "movq %%rdx, %%nacl:0x10(%%r15, %0, 1)\n"       \
-               "movq %%rbx, %%nacl:0x18(%%r15, %0, 1)\n"       \
-               "movq %%rsp, %%nacl:0x20(%%r15, %0, 1)\n"       \
-               "movq %%rbp, %%nacl:0x28(%%r15, %0, 1)\n"       \
-               "movq %%rsi, %%nacl:0x30(%%r15, %0, 1)\n"       \
-               "movq %%rdi, %%nacl:0x38(%%r15, %0, 1)\n"       \
-               "movq %%r8,  %%nacl:0x40(%%r15, %0, 1)\n"       \
-               "movq %%r9,  %%nacl:0x48(%%r15, %0, 1)\n"       \
-               "movq %%r10, %%nacl:0x50(%%r15, %0, 1)\n"       \
-               "movq %%r11, %%nacl:0x58(%%r15, %0, 1)\n"       \
-               "movq %%r12, %%nacl:0x60(%%r15, %0, 1)\n"       \
-               "movq %%r13, %%nacl:0x68(%%r15, %0, 1)\n"       \
-               "movq %%r14, %%nacl:0x70(%%r15, %0, 1)\n"       \
-               "movq %%r15, %%nacl:0x78(%%r15, %0, 1)\n"       \
-               "leaq (%%rip), %%rdx\n" \
-               "movq %%rdx, %%nacl:0x80(%%r15, %0, 1)\n"       \
-               :       \
-               : "a" ((int64_t)&(ctx)) \
-               : "rdx", "memory")
 #else
 
 #define MONO_CONTEXT_GET_CURRENT_GREGS(ctx) \
index ac7747c8799f9f0f12b53613a2d9e45627d159fc..333617edc92d8a5d59cb359cc15e9fd25e3d7445 100644 (file)
@@ -12,9 +12,9 @@
 #define MONO_SOLIB_EXT ".dll"
 #elif defined(__ppc__) && defined(TARGET_MACH)
 #define MONO_SOLIB_EXT ".dylib"
-#elif defined(TARGET_MACH) && defined(TARGET_X86) && !defined(__native_client_codegen__)
+#elif defined(TARGET_MACH) && defined(TARGET_X86)
 #define MONO_SOLIB_EXT ".dylib"
-#elif defined(TARGET_MACH) && defined(TARGET_AMD64) && !defined(__native_client_codegen__)
+#elif defined(TARGET_MACH) && defined(TARGET_AMD64)
 #define MONO_SOLIB_EXT ".dylib"
 #else
 #define MONO_SOLIB_EXT ".so"
index 4bd214d4dddc26787ab4c8c702c5cf667f74a08e..f66ff902e1d6c90a0e0931559ac618b743a0ac29 100644 (file)
@@ -331,20 +331,6 @@ mono_file_unmap (void *addr, void *handle)
  * \p length must be a multiple of the page size.
  * \returns \c 0 on success.
  */
-#if defined(__native_client__)
-int
-mono_mprotect (void *addr, size_t length, int flags)
-{
-       int prot = prot_from_flags (flags);
-       void *new_addr;
-
-       if (flags & MONO_MMAP_DISCARD) memset (addr, 0, length);
-
-       new_addr = mmap(addr, length, prot, MAP_PRIVATE | MAP_FIXED | MAP_ANONYMOUS, -1, 0);
-       if (new_addr == addr) return 0;
-        return -1;
-}
-#else
 int
 mono_mprotect (void *addr, size_t length, int flags)
 {
@@ -367,7 +353,6 @@ mono_mprotect (void *addr, size_t length, int flags)
        }
        return mprotect (addr, length, prot);
 }
-#endif // __native_client__
 
 #else
 
index 13b8a32393716ec9473ce9d9e4bbd9ef6e849087..fc6b61f2c4f35e07cb76b816c269411391dba48c 100644 (file)
@@ -26,7 +26,7 @@
 
 #ifdef HOST_WIN32
 // Windows specific implementation in mono-rand-windows.c
-#elif defined (HAVE_SYS_UN_H) && !defined(__native_client__)
+#elif defined (HAVE_SYS_UN_H)
 
 #include <errno.h>
 #include <fcntl.h>
index 1dbb223608647398daaa6ff780b70fc868a889ad..289bd98cd66e2faa8c61063213ce5aba2de7d38e 100644 (file)
@@ -39,8 +39,6 @@ mono_threads_suspend_search_alternative_signal (void)
 #endif
 }
 
-#ifndef __native_client__
-
 static int suspend_signal_num = -1;
 static int restart_signal_num = -1;
 static int abort_signal_num = -1;
@@ -274,33 +272,4 @@ mono_threads_suspend_get_abort_signal (void)
        return abort_signal_num;
 }
 
-#else
-
-void
-mono_threads_suspend_init_signals (void)
-{
-       g_assert_not_reached ();
-}
-
-gint
-mono_threads_suspend_get_suspend_signal (void)
-{
-       return -1;
-}
-
-gint
-mono_threads_suspend_get_restart_signal (void)
-{
-       return -1;
-}
-
-gint
-mono_threads_suspend_get_abort_signal (void)
-{
-       return -1;
-}
-
-#endif /* __native_client__ */
-
-
 #endif /* defined(USE_POSIX_BACKEND) */
index 9ee2a77402de20bebbca6cabbd61ec0a3f7917bd..5d0e1ab29112e3e8b0ce624e2cbd257a6519f077 100644 (file)
@@ -30,7 +30,7 @@
 extern int tkill (pid_t tid, int signal);
 #endif
 
-#if defined(_POSIX_VERSION) || defined(__native_client__)
+#if defined(_POSIX_VERSION)
 
 #include <pthread.h>
 
@@ -150,9 +150,6 @@ mono_threads_pthread_kill (MonoThreadInfo *info, int signum)
                errno = old_errno;
        }
        return result;
-#elif defined(__native_client__)
-       /* Workaround pthread_kill abort() in NaCl glibc. */
-       return 0;
 #elif !defined(HAVE_PTHREAD_KILL)
        g_error ("pthread_kill() is not supported by this platform");
 #else
@@ -234,7 +231,7 @@ mono_native_thread_join (MonoNativeThreadId tid)
        return !pthread_join (tid, &res);
 }
 
-#endif /* defined(_POSIX_VERSION) || defined(__native_client__) */
+#endif /* defined(_POSIX_VERSION) */
 
 #if defined(USE_POSIX_BACKEND)
 
index e6d151ce2566c841cfdba4ae8d1f083d30bfcfa6..dac28b7037dbe4f739cfa543457f1d8514305c14 100644 (file)
@@ -1310,10 +1310,6 @@ mono_thread_info_tls_set (THREAD_INFO_TYPE *info, MonoTlsKey key, gpointer value
        ((MonoThreadInfo*)info)->tls [key] = value;
 }
 
-#if defined(__native_client__)
-void nacl_shutdown_gc_thread(void);
-#endif
-
 /*
  * mono_thread_info_exit:
  *
@@ -1323,10 +1319,6 @@ void nacl_shutdown_gc_thread(void);
 void
 mono_thread_info_exit (gsize exit_code)
 {
-#if defined(__native_client__)
-       nacl_shutdown_gc_thread();
-#endif
-
        mono_thread_info_detach ();
 
        mono_threads_platform_exit (0);
index dc26a4ac42e8d8b4068467a2c90f92cab9025208..63cad57d86825aeaf3e3b15d60737fe9d5b252c2 100644 (file)
@@ -109,7 +109,7 @@ and reduce the number of casts drastically.
 /* If this is defined, use the signals backed on Mach. Debug only as signals can't be made usable on OSX. */
 // #define USE_SIGNALS_ON_MACH
 
-#if defined (_POSIX_VERSION) || defined (__native_client__)
+#if defined (_POSIX_VERSION)
 #if defined (__MACH__) && !defined (USE_SIGNALS_ON_MACH)
 #define USE_MACH_BACKEND
 #else
@@ -119,7 +119,7 @@ and reduce the number of casts drastically.
 #define USE_WINDOWS_BACKEND
 #else
 #error "no backend support for current platform"
-#endif /* defined (_POSIX_VERSION) || defined (__native_client__) */
+#endif /* defined (_POSIX_VERSION) */
 
 enum {
        STATE_STARTING                          = 0x00,
index 987689a9cd8e946671fd35f5ae4d42c39cc61a30..c3615d14bbedc53d4cabf12999b183a2f2a42ad9 100644 (file)
@@ -275,11 +275,7 @@ my_g_bit_nth_lsf (gsize mask, gint nth_bit)
        if ((mask == 0) || (nth_bit == BITS_PER_CHUNK))
                return -1;
 
-#if defined(__native_client__) && (defined(__i386__) || defined(__x86_64))
-#define USE_X86_32BIT_INSTRUCTIONS 1
-#endif
-
-#if (defined(__i386__) && defined(__GNUC__)) || defined(USE_X86_32BIT_INSTRUCTIONS)
+#if (defined(__i386__) && defined(__GNUC__))
  {
         int r;
         /* This depends on mask != 0 */
@@ -309,7 +305,7 @@ static inline gint
 my_g_bit_nth_lsf_nomask (gsize mask)
 {
        /* Mask is expected to be != 0 */
-#if (defined(__i386__) && defined(__GNUC__)) || defined(USE_X86_32BIT_INSTRUCTIONS)
+#if (defined(__i386__) && defined(__GNUC__))
        int r;
 
        __asm__("bsfl %1,%0\n\t"
index 7807fe88fea7e36cd654395ffde0e0679b5eb74f..904bb51f570fc0b934a3977016f1380de8f2fd7b 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>\r
+<?xml version="1.0" encoding="utf-8"?>\r
 <Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <ItemGroup Label="ProjectConfigurations">\r
     <ProjectConfiguration Include="Debug|Win32">\r
@@ -78,7 +78,6 @@
     <ClCompile Include="..\mono\metadata\mono-conc-hash.c" />\r
     <ClCompile Include="..\mono\metadata\mono-mlist.c" />\r
     <ClCompile Include="..\mono\metadata\mono-perfcounters.c" />\r
-    <ClCompile Include="..\mono\metadata\nacl-stub.c" />\r
     <ClCompile Include="..\mono\metadata\null-gc.c" />\r
     <ClCompile Include="..\mono\metadata\number-ms.c" />\r
     <ClCompile Include="..\mono\metadata\object.c" />\r
index 3b1b01037ccb53cf69b148065107f4e33881f25c..6c8dcdfb4fe6c64f05c3335567d566570843348a 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>\r
+<?xml version="1.0" encoding="utf-8"?>\r
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <ItemGroup>\r
     <ClCompile Include="..\mono\metadata\assembly.c">\r
     <ClCompile Include="..\mono\metadata\mono-security.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\mono\metadata\nacl-stub.c">\r
-      <Filter>Source Files</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="..\mono\metadata\null-gc.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
diff --git a/nacl/README b/nacl/README
deleted file mode 100644 (file)
index 03a77ba..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Building NaCl Mono with glibc (newlib support is eliminated but should still be buildable with small effort) is complex.  Instructions live here for the adventurous: https://docs.google.com/a/google.com/document/d/1Jd_4M7mlmxF8daVbepAy_8RKYcRbhifXanRYyBKkVa4/pub
-
diff --git a/nacl/common.sh b/nacl/common.sh
deleted file mode 100644 (file)
index 65e7dc7..0000000
+++ /dev/null
@@ -1,217 +0,0 @@
-# Copyright (c) 2011 The Native Client Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that be
-# found in the LICENSE file.
-#
-
-set -o nounset
-set -o errexit
-
-# scripts that source this file must be run from within packages tree
-readonly SAVE_PWD=$(pwd)
-
-# Pick platform directory for compiler.
-readonly OS_NAME=$(uname -s)
-if [ $OS_NAME = "Darwin" ]; then
-  readonly OS_SUBDIR="mac"
-  readonly OS_SUBDIR_SHORT="mac"
-elif [ $OS_NAME = "Linux" ]; then
-  readonly OS_SUBDIR="linux"
-  readonly OS_SUBDIR_SHORT="linux"
-else
-  readonly OS_SUBDIR="windows"
-  readonly OS_SUBDIR_SHORT="win"
-fi
-
-readonly MACHINE=$(uname -m)
-if [ $MACHINE = "x86_64" ]; then
-  readonly TARGET_BITSIZE=${TARGET_BITSIZE:-"64"}
-  readonly HOST_BITSIZE=${HOST_BITSIZE:-"64"}
-else
-  # uname -m reports i686 on Linux and i386 on Mac
-  readonly TARGET_BITSIZE=${TARGET_BITSIZE:-"32"}
-  readonly HOST_BITSIZE=${HOST_BITSIZE:-"32"}
-fi
-
-if [ $TARGET_BITSIZE == "64" ]; then
-  readonly TARGET_BIT_PREFIX="64"
-  readonly CROSS_ID=x86_64
-else
-  readonly TARGET_BIT_PREFIX=""
-  readonly CROSS_ID=i686
-fi
-# we might want to override the detected host platform (e.g. on OSX 10.6)
-if [ $HOST_BITSIZE == "64" ]; then
-  readonly HOST_BIT_PREFIX="64"
-else
-  readonly HOST_BIT_PREFIX=""
-fi
-
-export NACL_CROSS_PREFIX=${CROSS_ID}-nacl
-export NACL_CROSS_PREFIX_DASH=${NACL_CROSS_PREFIX}-
-
-readonly NACL_NEWLIB=${NACL_NEWLIB:-"0"}
-
-if [ $NACL_NEWLIB = "1" ]; then
-  readonly NACL_SDK_BASE=${NACL_SDK_ROOT}/toolchain/${OS_SUBDIR_SHORT}_x86_newlib
-else
-case "${NACL_SDK_ROOT}" in
-*pepper_15* | *pepper_16* | *pepper_17*)
-  readonly NACL_SDK_BASE=${NACL_SDK_ROOT}/toolchain/${OS_SUBDIR_SHORT}_x86
-  ;;
-*)
-  readonly NACL_SDK_BASE=${NACL_SDK_ROOT}/toolchain/${OS_SUBDIR_SHORT}_x86_glibc
-  ;;
-esac
-fi
-
-readonly NACL_BIN_PATH=${NACL_SDK_BASE}/bin
-export NACLCC=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX_DASH}gcc
-export NACLCXX=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX_DASH}g++
-export NACLAR=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX_DASH}ar
-export NACLRANLIB=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX_DASH}ranlib
-export NACLLD=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX_DASH}ld
-export NACLAS=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX_DASH}as
-
-# NACL_SDK_GCC_SPECS_PATH is where nacl-gcc 'specs' file will be installed
-readonly NACL_SDK_GCC_SPECS_PATH=${NACL_SDK_BASE}/lib/gcc/x86_64-nacl/4.4.3
-
-# NACL_SDK_USR is where the headers, libraries, etc. will be installed
-readonly NACL_SDK_USR=${NACL_SDK_BASE}/${NACL_CROSS_PREFIX}/usr
-readonly NACL_SDK_USR_INCLUDE=${NACL_SDK_USR}/include
-readonly NACL_SDK_USR_LIB=${NACL_SDK_USR}/lib
-
-
-######################################################################
-# Helper functions
-######################################################################
-
-Banner() {
-  echo "######################################################################"
-  echo $*
-  echo "######################################################################"
-}
-
-
-VerifyPath() {
-  # make sure path isn't all slashes (possibly from an unset variable)
-  local PATH=$1
-  local TRIM=${PATH##/}
-  if [ ${#TRIM} -ne 0 ]; then
-    return 0
-  else
-    return 1
-  fi
-}
-
-
-ChangeDir() {
-  local NAME=$1
-  if VerifyPath ${NAME}; then
-    cd ${NAME}
-  else
-    echo "ChangeDir called with bad path."
-    exit -1
-  fi
-}
-
-
-Remove() {
-  local NAME=$1
-  if VerifyPath ${NAME}; then
-    rm -rf ${NAME}
-  else
-    echo "Remove called with bad path."
-    exit -1
-  fi
-}
-
-
-MakeDir() {
-  local NAME=$1
-  if VerifyPath ${NAME}; then
-    mkdir -p ${NAME}
-  else
-    echo "MakeDir called with bad path."
-    exit -1
-  fi
-}
-
-
-PatchSpecFile() {
-  # fix up spaces so gcc sees entire path
-  local SED_SAFE_SPACES_USR_INCLUDE=${NACL_SDK_USR_INCLUDE/ /\ /}
-  local SED_SAFE_SPACES_USR_LIB=${NACL_SDK_USR_LIB/ /\ /}
-  # have nacl-gcc dump specs file & add include & lib search paths
-  ${NACL_SDK_BASE}/bin/x86_64-nacl-gcc -dumpspecs |\
-    sed "/*cpp:/{
-      N
-      s|$| -I${SED_SAFE_SPACES_USR_INCLUDE}|
-    }" |\
-    sed "/*link_libgcc:/{
-      N
-      s|$| -L${SED_SAFE_SPACES_USR_LIB}|
-    }" >${NACL_SDK_GCC_SPECS_PATH}/specs
-}
-
-
-DefaultConfigureStep() {
-  Banner "Configuring ${PACKAGE_NAME}"
-  # export the nacl tools
-  export CC=${NACLCC}
-  export CXX=${NACLCXX}
-  export AR=${NACLAR}
-  export RANLIB=${NACLRANLIB}
-  export PKG_CONFIG_PATH=${NACL_SDK_USR_LIB}/pkgconfig
-  export PKG_CONFIG_LIBDIR=${NACL_SDK_USR_LIB}
-  export PATH=${NACL_BIN_PATH}:${PATH};
-  ChangeDir ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME}
-  Remove ${PACKAGE_NAME}-build
-  MakeDir ${PACKAGE_NAME}-build
-  cd ${PACKAGE_NAME}-build
-  ../configure \
-    --host=nacl \
-    --disable-shared \
-    --prefix=${NACL_SDK_USR} \
-    --exec-prefix=${NACL_SDK_USR} \
-    --libdir=${NACL_SDK_USR_LIB} \
-    --oldincludedir=${NACL_SDK_USR_INCLUDE} \
-    --with-http=off \
-    --with-html=off \
-    --with-ftp=off \
-    --with-x=no
-}
-
-
-DefaultBuildStep() {
-  # assumes pwd has makefile
-  make clean
-if [ $TARGET_BITSIZE == "64" ]; then
-  make -j8
-else
-  make
-fi
-}
-
-
-DefaultInstallStep() {
-  # assumes pwd has makefile
-  make install
-}
-
-
-DefaultCleanUpStep() {
-  PatchSpecFile
-  ChangeDir ${SAVE_PWD}
-}
-
-
-DefaultPackageInstall() {
-  DefaultPreInstallStep
-  DefaultDownloadStep
-  DefaultExtractStep
-  DefaultPatchStep
-  DefaultConfigureStep
-  DefaultBuildStep
-  DefaultInstallStep
-  DefaultCleanUpStep
-}
diff --git a/nacl/config-nacl-runtime.cache b/nacl/config-nacl-runtime.cache
deleted file mode 100644 (file)
index 4bd26c4..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems.  If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-ac_cv_func_mmap=${ac_cv_func_mmap=no}
-ac_cv_var_timezone=${ac_cv_var_timezone=yes}
-ac_cv_host=${ac_cv_host=i686-pc-nacl}
-ac_cv_target=${ac_cv_target=i686-pc-nacl}
-ac_cv_func_backtrace_symbols=${ac_cv_func_backtrace_symbols=no}
-mono_cv_uscore=${mono_cv_uscore=no}
diff --git a/nacl/config-nacl-runtime64.cache b/nacl/config-nacl-runtime64.cache
deleted file mode 100644 (file)
index b952fef..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems.  If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-ac_cv_func_mmap=${ac_cv_func_mmap=no}
-ac_cv_var_timezone=${ac_cv_var_timezone=yes}
-ac_cv_host=${ac_cv_host=x86_64-pc-nacl}
-ac_cv_target=${ac_cv_target=x86_64-pc-nacl}
-ac_cv_func_backtrace_symbols=${ac_cv_func_backtrace_symbols=no}
-mono_cv_uscore=${mono_cv_uscore=no}
diff --git a/nacl/nacl-runtime-mono.sh b/nacl/nacl-runtime-mono.sh
deleted file mode 100755 (executable)
index d93bb97..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2009 The Native Client Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that be
-# found in the LICENSE file.
-#
-
-# nacl-runtime-mono.sh
-#
-# usage:  nacl-runtime-mono.sh
-#
-# this script builds mono runtime for Native Client 
-#
-
-readonly MONO_TRUNK_NACL=$(pwd)
-
-source common.sh
-
-readonly PACKAGE_NAME=runtime${TARGET_BIT_PREFIX}-build
-readonly INSTALL_PATH=${MONO_TRUNK_NACL}/naclmono-${CROSS_ID}
-
-
-CustomConfigureStep() {
-  Banner "Configuring ${PACKAGE_NAME}"
-  # export the nacl tools
-  set +e
-  if [ -f ${PACKAGE_NAME}/Makefile ]
-  then
-    cd ${PACKAGE_NAME}
-  fi
-  make distclean
-  cd ${MONO_TRUNK_NACL}
-  set -e
-  if [ $TARGET_BITSIZE == "32" ]; then
-    CONFIG_OPTS="--host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --target=i686-pc-linux-gnu"
-  else
-    CONFIG_OPTS="--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu"
-  fi
-  # UGLY hack to allow dynamic linking
-  sed -i -e s/elf_i386/elf_nacl/ -e s/elf_x86_64/elf64_nacl/ ../configure
-  sed -i -e s/elf_i386/elf_nacl/ -e s/elf_x86_64/elf64_nacl/ ../libgc/configure
-  sed -i -e s/elf_i386/elf_nacl/ -e s/elf_x86_64/elf64_nacl/ ../eglib/configure
-  Remove ${PACKAGE_NAME}
-  MakeDir ${PACKAGE_NAME}
-  cd ${PACKAGE_NAME}
-  CC=${NACLCC} CXX=${NACLCXX} AR=${NACLAR} RANLIB=${NACLRANLIB} PKG_CONFIG_PATH=${NACL_SDK_USR_LIB}/pkgconfig LD="${NACLLD}" \
-  PKG_CONFIG_LIBDIR=${NACL_SDK_USR_LIB} PATH=${NACL_BIN_PATH}:${PATH} LIBS="-lnacl_dyncode -lc -lg -lnosys -lnacl" \
-  CFLAGS="-g -O2 -D_POSIX_PATH_MAX=256 -DPATH_MAX=256" ../../configure \
-    ${CONFIG_OPTS} \
-    --exec-prefix=${INSTALL_PATH} \
-    --libdir=${INSTALL_PATH}/lib \
-    --prefix=${INSTALL_PATH} \
-    --program-prefix="" \
-    --oldincludedir=${INSTALL_PATH}/include \
-    --with-glib=embedded \
-    --with-tls=pthread \
-    --enable-threads=posix \
-    --without-sigaltstack \
-    --without-mmap \
-    --with-gc=included \
-    --enable-nacl-gc \
-    --with-sgen=no \
-    --enable-nls=no \
-    --enable-nacl-codegen \
-    --disable-system-aot \
-    --enable-shared \
-    --disable-parallel-mark \
-    --with-static-mono=no
-
-}
-
-CustomInstallStep() {
-  make install
-}
-
-CustomPackageInstall() {
-  CustomConfigureStep
-  DefaultBuildStep
-  CustomInstallStep
-}
-
-CustomPackageInstall
-exit 0
diff --git a/nacl/nacl_interp_loader_sdk.sh b/nacl/nacl_interp_loader_sdk.sh
deleted file mode 100755 (executable)
index 1e4bd31..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2012 The Native Client Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-# Usage: nacl_interp_loader.sh PLATFORM NEXE ARGS...
-
-# Assumes this file is sitting in the source tree.
-# This should be changed for some proper SDK installation setup.
-NACL_SDK_ROOT=${NACL_SDK_ROOT:-/path/to/naclsdk/pepper_XX}
-
-case "$1" in
-i?86)
-  arch=x86_32
-  libdir=lib32
-  ;;
-x86_64)
-  arch=x86_64
-  libdir=lib64
-  ;;
-arm|v7l)
-  arch=arm
-  libdir=lib32
-  ;;
-*)
-  echo >&2 "$0: Do not recognize architecture \"$1\""
-  exit 127
-  ;;
-esac
-
-shift
-
-case "${NACL_SDK_ROOT}" in
-*pepper_15* | *pepper_16* | *pepper_17*)
-  SEL_LDR="$NACL_SDK_ROOT/toolchain/linux_x86/bin/sel_ldr_${arch}"
-  IRT="$NACL_SDK_ROOT/toolchain/linux_x86/runtime/irt_core_${arch}.nexe"
-  RTLD="$NACL_SDK_ROOT/toolchain/linux_x86/x86_64-nacl/${libdir}/runnable-ld.so"
-  LIBDIR="$NACL_SDK_ROOT/toolchain/linux_x86/x86_64-nacl/${libdir}"
-  ;;
-*)
-  SEL_LDR="$NACL_SDK_ROOT/tools/sel_ldr_${arch}"
-  IRT="$NACL_SDK_ROOT/tools/irt_core_${arch}.nexe"
-  RTLD="$NACL_SDK_ROOT/toolchain/linux_x86_glibc/x86_64-nacl/${libdir}/runnable-ld.so"
-  LIBDIR="$NACL_SDK_ROOT/toolchain/linux_x86_glibc/x86_64-nacl/${libdir}"
-  ;;
-esac
-
-IGNORE_VALIDATOR_ARG=""
-if [ x"$NACL_IGNORE_VALIDATOR" == x"1" ]; then
-  IGNORE_VALIDATOR_ARG="-c"
-fi
-
-exec "$SEL_LDR" -E "NACL_PWD=`pwd`" -E "MONO_PATH=$MONO_PATH" \
-  -E "MONO_CFG_DIR=$MONO_CFG_DIR" -E "MONO_SHARED_DIR=$MONO_SHARED_DIR" \
-  -a $IGNORE_VALIDATOR_ARG -S -B "$IRT" -l /dev/null -- "$RTLD" \
-  --library-path $LIBDIR "$@"
index ae87dfa88c37f436cff9022ff5b69127d58b7e8e..052a45eeaeb3bf235e56a49bec0550313c14c96e 100644 (file)
@@ -167,12 +167,8 @@ mcs-compileall: mono-wrapper etc/mono/config
        if [ "$$ok" = "false" ]; then echo "<?xml version='1.0' encoding='utf-8'?><test-results failures='1' total='1' not-run='0' name='verify' date='$$(date +%F)' time='$$(date +%T)'><test-suite name='mcs-compileall' success='False' time='0'><results><test-case name='fail' executed='True' success='False' time='0'><failure><message>Verifying framework assemblies failed. Check the log for more details.</message><stack-trace></stack-trace></failure></test-case></results></test-suite></test-results>" > TestResult-verify.xml; fi; \
        $$ok
 
-if NACL_CODEGEN
-check-local:
-else
 check-local: mcs-compileall mcs-do-test-profiles
        $(MAKE) mcs-do-run-test-profiles
-endif
 
 # Compile all mcs tests
 test: mcs-do-test-profiles
index 7c2822f4b996ef75426ccfdb805e0f56e6a5b8d7..33ff88d6f2143b1195c623b07b66c11a70a2fef9 100644 (file)
@@ -4,13 +4,4 @@ MONO_CFG_DIR='@mono_cfg_dir@'
 PATH="$r/runtime/_tmpinst/bin:$PATH"
 MONO_EXECUTABLE=${MONO_EXECUTABLE:-"$r/@mono_runtime@"}
 export MONO_CFG_DIR PATH
-if [ -n "@nacl_self_host@" ]; then
-  case "$@" in
-    # gacutil.exe and mdoc.exe require filesystem functionality not
-    # exposed in NaCl.
-    # mcs.exe was added to the list recently because mcs under NaCl
-    # no longer produces equivalent output. TODO: investigate
-    */mcs.exe* | */gacutil.exe* | */mdoc.exe* ) exec /usr/local/bin/mono "$@";;
-  esac
-fi
 exec "$r/libtool" --mode=execute "${MONO_EXECUTABLE}" --config "@mono_cfg_dir@/mono/config" "$@"