From 010fcfb9ecfef1654b415dbb909a01148a89e827 Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Fri, 2 Jun 2017 03:51:44 -0400 Subject: [PATCH] [runtime] Remove all NACL support. It was unmaintained for a long time. (#4955) https://blog.chromium.org/2017/05/goodbye-pnacl-hello-webassembly.html --- configure.ac | 110 +----------- eglib/src/eglib-config.h.in | 2 +- eglib/src/gfile-posix.c | 10 -- mono/dis/dump.c | 5 - mono/metadata/Makefile.am | 1 - mono/metadata/appdomain.c | 4 - mono/metadata/assembly.c | 48 ------ mono/metadata/boehm-gc.c | 4 +- mono/metadata/console-unix.c | 6 - mono/metadata/gc.c | 4 - mono/metadata/icall.c | 12 -- mono/metadata/mono-config.c | 2 +- mono/metadata/nacl-stub.c | 85 ---------- mono/metadata/threads.c | 4 - mono/metadata/w32file-unix.c | 50 +----- mono/mini/Makefile.am.in | 16 -- mono/mini/aot-compiler.c | 18 +- mono/mini/aot-runtime.c | 12 -- mono/mini/branch-opts.c | 12 +- mono/mini/driver.c | 21 --- mono/mini/exceptions.cs | 2 - mono/mini/genmdesc.c | 5 - mono/mini/helpers.c | 3 - mono/mini/image-writer.c | 7 +- mono/mini/jit-icalls.c | 10 -- mono/mini/jit-icalls.h | 4 - mono/mini/mini-arm.c | 2 +- mono/mini/mini-posix.c | 15 +- mono/mini/mini-runtime.c | 30 +--- mono/mini/mini.c | 26 +-- mono/mini/mini.h | 16 -- mono/mini/regalloc.h | 4 - mono/profiler/Makefile.am | 2 - mono/profiler/mprof-report.c | 5 - mono/tests/Makefile.am | 97 ----------- mono/utils/dlmalloc.c | 7 - mono/utils/mono-context.c | 20 +-- mono/utils/mono-context.h | 30 +--- mono/utils/mono-dl.h | 4 +- mono/utils/mono-mmap.c | 15 -- mono/utils/mono-rand.c | 2 +- mono/utils/mono-threads-posix-signals.c | 31 ---- mono/utils/mono-threads-posix.c | 7 +- mono/utils/mono-threads.c | 8 - mono/utils/mono-threads.h | 4 +- mono/utils/monobitset.c | 8 +- msvc/libmonoruntime.vcxproj | 3 +- msvc/libmonoruntime.vcxproj.filters | 5 +- nacl/README | 2 - nacl/common.sh | 217 ------------------------ nacl/config-nacl-runtime.cache | 19 --- nacl/config-nacl-runtime64.cache | 19 --- nacl/nacl-runtime-mono.sh | 82 --------- nacl/nacl_interp_loader_sdk.sh | 56 ------ runtime/Makefile.am | 4 - runtime/mono-wrapper.in | 9 - 56 files changed, 40 insertions(+), 1166 deletions(-) delete mode 100644 mono/metadata/nacl-stub.c delete mode 100644 nacl/README delete mode 100644 nacl/common.sh delete mode 100644 nacl/config-nacl-runtime.cache delete mode 100644 nacl/config-nacl-runtime64.cache delete mode 100755 nacl/nacl-runtime-mono.sh delete mode 100755 nacl/nacl_interp_loader_sdk.sh diff --git a/configure.ac b/configure.ac index c5c7ba58b9e..73893d65cdc 100644 --- a/configure.ac +++ b/configure.ac @@ -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; diff --git a/eglib/src/eglib-config.h.in b/eglib/src/eglib-config.h.in index ae7b6d45337..71797575e68 100644 --- a/eglib/src/eglib-config.h.in +++ b/eglib/src/eglib-config.h.in @@ -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 diff --git a/eglib/src/gfile-posix.c b/eglib/src/gfile-posix.c index 49ee58a142f..48a9192ab69 100644 --- a/eglib/src/gfile-posix.c +++ b/eglib/src/gfile-posix.c @@ -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 } diff --git a/mono/dis/dump.c b/mono/dis/dump.c index 9242e8639fe..c13675e8233 100755 --- a/mono/dis/dump.c +++ b/mono/dis/dump.c @@ -21,11 +21,6 @@ #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) { diff --git a/mono/metadata/Makefile.am b/mono/metadata/Makefile.am index ef9df2a5cb2..a9f976f8c20 100644 --- a/mono/metadata/Makefile.am +++ b/mono/metadata/Makefile.am @@ -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 \ diff --git a/mono/metadata/appdomain.c b/mono/metadata/appdomain.c index 7bcd8fa7a75..02ca3bbf949 100644 --- a/mono/metadata/appdomain.c +++ b/mono/metadata/appdomain.c @@ -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) diff --git a/mono/metadata/assembly.c b/mono/metadata/assembly.c index 5bc9486f897..16c22c8fd10 100644 --- a/mono/metadata/assembly.c +++ b/mono/metadata/assembly.c @@ -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); diff --git a/mono/metadata/boehm-gc.c b/mono/metadata/boehm-gc.c index 99704f7c428..edc12105878 100644 --- a/mono/metadata/boehm-gc.c +++ b/mono/metadata/boehm-gc.c @@ -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; diff --git a/mono/metadata/console-unix.c b/mono/metadata/console-unix.c index 98b3ba551cb..fe71923dbba 100644 --- a/mono/metadata/console-unix.c +++ b/mono/metadata/console-unix.c @@ -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 #include #include @@ -525,5 +521,3 @@ ves_icall_System_ConsoleDriver_TtySetup (MonoString *keypad, MonoString *teardow return TRUE; } -#endif /* #if defined(__native_client__) */ - diff --git a/mono/metadata/gc.c b/mono/metadata/gc.c index 111ed39e6ba..f561dc15b4c 100644 --- a/mono/metadata/gc.c +++ b/mono/metadata/gc.c @@ -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; diff --git a/mono/metadata/icall.c b/mono/metadata/icall.c index eddd8bf2b07..756f58f8062 100644 --- a/mono/metadata/icall.c +++ b/mono/metadata/icall.c @@ -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; diff --git a/mono/metadata/mono-config.c b/mono/metadata/mono-config.c index 7cff2952632..e3d19ca7c13 100644 --- a/mono/metadata/mono-config.c +++ b/mono/metadata/mono-config.c @@ -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 index ca875829624..00000000000 --- a/mono/metadata/nacl-stub.c +++ /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 diff --git a/mono/metadata/threads.c b/mono/metadata/threads.c index 5cc8e1d86f9..6f1a34e2dfc 100644 --- a/mono/metadata/threads.c +++ b/mono/metadata/threads.c @@ -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; diff --git a/mono/metadata/w32file-unix.c b/mono/metadata/w32file-unix.c index 6fcb0f691f1..38ca36a1a9e 100644 --- a/mono/metadata/w32file-unix.c +++ b/mono/metadata/w32file-unix.c @@ -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) { diff --git a/mono/mini/Makefile.am.in b/mono/mini/Makefile.am.in index a08d93b4137..b2107a6c524 100755 --- a/mono/mini/Makefile.am.in +++ b/mono/mini/Makefile.am.in @@ -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) diff --git a/mono/mini/aot-compiler.c b/mono/mini/aot-compiler.c index edc5ca6c69f..59a04298499 100644 --- a/mono/mini/aot-compiler.c +++ b/mono/mini/aot-compiler.c @@ -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) diff --git a/mono/mini/aot-runtime.c b/mono/mini/aot-runtime.c index 30ef9a64ad7..a1ee87fd60b 100644 --- a/mono/mini/aot-runtime.c +++ b/mono/mini/aot-runtime.c @@ -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"); diff --git a/mono/mini/branch-opts.c b/mono/mini/branch-opts.c index 2f964b4162f..0dab1240f86 100644 --- a/mono/mini/branch-opts.c +++ b/mono/mini/branch-opts.c @@ -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) { diff --git a/mono/mini/driver.c b/mono/mini/driver.c index 8719a12994c..3d887e84d3a 100644 --- a/mono/mini/driver.c +++ b/mono/mini/driver.c @@ -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 { diff --git a/mono/mini/exceptions.cs b/mono/mini/exceptions.cs index f21ba2b5d18..07f498e628b 100644 --- a/mono/mini/exceptions.cs +++ b/mono/mini/exceptions.cs @@ -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; diff --git a/mono/mini/genmdesc.c b/mono/mini/genmdesc.c index 357651ee641..60ff683a9af 100644 --- a/mono/mini/genmdesc.c +++ b/mono/mini/genmdesc.c @@ -12,11 +12,6 @@ #include #include -#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 */ diff --git a/mono/mini/helpers.c b/mono/mini/helpers.c index 7f681b23bb5..6a741ca23b0 100644 --- a/mono/mini/helpers.c +++ b/mono/mini/helpers.c @@ -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; diff --git a/mono/mini/image-writer.c b/mono/mini/image-writer.c index f381ac83587..b5cf20dfde1 100644 --- a/mono/mini/image-writer.c +++ b/mono/mini/image-writer.c @@ -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; diff --git a/mono/mini/jit-icalls.c b/mono/mini/jit-icalls.c index 648e69cf18c..2b66be22f18 100644 --- a/mono/mini/jit-icalls.c +++ b/mono/mini/jit-icalls.c @@ -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) { diff --git a/mono/mini/jit-icalls.h b/mono/mini/jit-icalls.h index f605a709507..ffe4342d239 100644 --- a/mono/mini/jit-icalls.h +++ b/mono/mini/jit-icalls.h @@ -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* diff --git a/mono/mini/mini-arm.c b/mono/mini/mini-arm.c index 10a9daa20ef..9f2be7efacc 100644 --- a/mono/mini/mini-arm.c +++ b/mono/mini/mini-arm.c @@ -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 diff --git a/mono/mini/mini-posix.c b/mono/mini/mini-posix.c index 3659f7b99a4..5bcf5435df0 100644 --- a/mono/mini/mini-posix.c +++ b/mono/mini/mini-posix.c @@ -75,7 +75,7 @@ #include #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 diff --git a/mono/mini/mini-runtime.c b/mono/mini/mini-runtime.c index 7d427a915ee..703eb5373da 100644 --- a/mono/mini/mini-runtime.c +++ b/mono/mini/mini-runtime.c @@ -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 diff --git a/mono/mini/mini.c b/mono/mini/mini.c index c81919ececa..b2f16b7fe47 100644 --- a/mono/mini/mini.c +++ b/mono/mini/mini.c @@ -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; diff --git a/mono/mini/mini.h b/mono/mini/mini.h index ed10d8f9379..021c6a42a78 100644 --- a/mono/mini/mini.h +++ b/mono/mini/mini.h @@ -49,11 +49,6 @@ #include "mono/metadata/security-manager.h" #include "mono/metadata/exception.h" -#ifdef __native_client_codegen__ -#include -#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* diff --git a/mono/mini/regalloc.h b/mono/mini/regalloc.h index e5d6ae6bdb8..c0aa5fdf64a 100644 --- a/mono/mini/regalloc.h +++ b/mono/mini/regalloc.h @@ -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, diff --git a/mono/profiler/Makefile.am b/mono/profiler/Makefile.am index 9010ee26c78..d3dd15c3b29 100644 --- a/mono/profiler/Makefile.am +++ b/mono/profiler/Makefile.am @@ -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 diff --git a/mono/profiler/mprof-report.c b/mono/profiler/mprof-report.c index 1017d1f8e6d..3b5d170a694 100644 --- a/mono/profiler/mprof-report.c +++ b/mono/profiler/mprof-report.c @@ -76,11 +76,6 @@ #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; diff --git a/mono/tests/Makefile.am b/mono/tests/Makefile.am index 15af95e3e2a..0b3b086a4b1 100755 --- a/mono/tests/Makefile.am +++ b/mono/tests/Makefile.am @@ -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 = \ diff --git a/mono/utils/dlmalloc.c b/mono/utils/dlmalloc.c index 3177f2d17a1..296893ff2e7 100644 --- a/mono/utils/dlmalloc.c +++ b/mono/utils/dlmalloc.c @@ -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 /* For size_t */ #endif /* LACKS_SYS_TYPES_H */ diff --git a/mono/utils/mono-context.c b/mono/utils/mono-context.c index efbe9f03e7a..3861e54f5e6 100644 --- a/mono/utils/mono-context.c +++ b/mono/utils/mono-context.c @@ -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; diff --git a/mono/utils/mono-context.h b/mono/utils/mono-context.h index 3cc722f0aae..b26442f73f5 100644 --- a/mono/utils/mono-context.h +++ b/mono/utils/mono-context.h @@ -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 -#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) \ diff --git a/mono/utils/mono-dl.h b/mono/utils/mono-dl.h index ac7747c8799..333617edc92 100644 --- a/mono/utils/mono-dl.h +++ b/mono/utils/mono-dl.h @@ -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" diff --git a/mono/utils/mono-mmap.c b/mono/utils/mono-mmap.c index 4bd214d4ddd..f66ff902e1d 100644 --- a/mono/utils/mono-mmap.c +++ b/mono/utils/mono-mmap.c @@ -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 diff --git a/mono/utils/mono-rand.c b/mono/utils/mono-rand.c index 13b8a323937..fc6b61f2c4f 100644 --- a/mono/utils/mono-rand.c +++ b/mono/utils/mono-rand.c @@ -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 #include diff --git a/mono/utils/mono-threads-posix-signals.c b/mono/utils/mono-threads-posix-signals.c index 1dbb2236086..289bd98cd66 100644 --- a/mono/utils/mono-threads-posix-signals.c +++ b/mono/utils/mono-threads-posix-signals.c @@ -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) */ diff --git a/mono/utils/mono-threads-posix.c b/mono/utils/mono-threads-posix.c index 9ee2a77402d..5d0e1ab2911 100644 --- a/mono/utils/mono-threads-posix.c +++ b/mono/utils/mono-threads-posix.c @@ -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 @@ -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) diff --git a/mono/utils/mono-threads.c b/mono/utils/mono-threads.c index e6d151ce256..dac28b7037d 100644 --- a/mono/utils/mono-threads.c +++ b/mono/utils/mono-threads.c @@ -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); diff --git a/mono/utils/mono-threads.h b/mono/utils/mono-threads.h index dc26a4ac42e..63cad57d868 100644 --- a/mono/utils/mono-threads.h +++ b/mono/utils/mono-threads.h @@ -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, diff --git a/mono/utils/monobitset.c b/mono/utils/monobitset.c index 987689a9cd8..c3615d14bbe 100644 --- a/mono/utils/monobitset.c +++ b/mono/utils/monobitset.c @@ -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" diff --git a/msvc/libmonoruntime.vcxproj b/msvc/libmonoruntime.vcxproj index 7807fe88fea..904bb51f570 100644 --- a/msvc/libmonoruntime.vcxproj +++ b/msvc/libmonoruntime.vcxproj @@ -1,4 +1,4 @@ - + @@ -78,7 +78,6 @@ - diff --git a/msvc/libmonoruntime.vcxproj.filters b/msvc/libmonoruntime.vcxproj.filters index 3b1b01037cc..6c8dcdfb4fe 100644 --- a/msvc/libmonoruntime.vcxproj.filters +++ b/msvc/libmonoruntime.vcxproj.filters @@ -1,4 +1,4 @@ - + @@ -115,9 +115,6 @@ Source Files - - Source Files - Source Files diff --git a/nacl/README b/nacl/README deleted file mode 100644 index 03a77babafd..00000000000 --- a/nacl/README +++ /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 index 65e7dc7a4ad..00000000000 --- a/nacl/common.sh +++ /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 index 4bd26c474f8..00000000000 --- a/nacl/config-nacl-runtime.cache +++ /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 index b952fef84c6..00000000000 --- a/nacl/config-nacl-runtime64.cache +++ /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 index d93bb975463..00000000000 --- a/nacl/nacl-runtime-mono.sh +++ /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 index 1e4bd31c9b1..00000000000 --- a/nacl/nacl_interp_loader_sdk.sh +++ /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 "$@" diff --git a/runtime/Makefile.am b/runtime/Makefile.am index ae87dfa88c3..052a45eeaeb 100644 --- a/runtime/Makefile.am +++ b/runtime/Makefile.am @@ -167,12 +167,8 @@ mcs-compileall: mono-wrapper etc/mono/config if [ "$$ok" = "false" ]; then echo "Verifying framework assemblies failed. Check the log for more details." > 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 diff --git a/runtime/mono-wrapper.in b/runtime/mono-wrapper.in index 7c2822f4b99..33ff88d6f21 100644 --- a/runtime/mono-wrapper.in +++ b/runtime/mono-wrapper.in @@ -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" "$@" -- 2.25.1