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"
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
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 ***********************************
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
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 **************************
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
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
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;
#define G_HAVE_ISO_VARARGS
#endif
-#if defined (__native_client__) || defined (HOST_WATCHOS)
+#if defined (HOST_WATCHOS)
#undef G_BREAKPOINT
#define G_BREAKPOINT()
#endif
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;
* so we return the buffer here since it has a pointer to the valid string
*/
return buffer;
-#endif
}
#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)
{
mono-route.c \
mono-route.h \
monitor.h \
- nacl-stub.c \
normalization-tables.h \
number-formatter.h \
number-ms.c \
if (g_hasenv ("MONO_NO_UNLOAD"))
return;
-#ifdef __native_client__
- return;
-#endif
-
MonoException *exc = NULL;
mono_domain_try_unload (domain, (MonoObject**)&exc);
if (exc)
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 */
}
}
-/* 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)
{
return;
char* path = g_getenv ("MONO_PATH");
-#ifdef __native_client__
- if (!path)
- path = strdup (nacl_mono_path);
-#endif
if (!path)
return;
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);
* 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;
GC_stackbottom = (char*)ss.ss_sp;
}
-#elif defined(__native_client__)
- /* Do nothing, GC_stackbottom is set correctly in libgc */
#else
{
int dummy;
* 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>
return TRUE;
}
-#endif /* #if defined(__native_client__) */
-
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;
{
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 ();
mono_thread_suspend_all_other_threads ();
mono_runtime_quit ();
-#endif
/* we may need to do some cleanup here... */
exit (result);
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;
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);
+++ /dev/null
-/**
- * \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
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;
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;
}
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;
}
return TRUE;
-#endif /* __native_client__ */
}
static void file_close (gpointer handle, gpointer data);
}
#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
*/
_wapi_set_last_error_from_errno ();
return(FALSE);
}
-#endif
return(TRUE);
}
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) {
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);
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);
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);
g_free (filename);
goto retry;
}
-#endif
utf8_filename = mono_utf8_from_external (filename);
if (utf8_filename == NULL) {
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);
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);
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*/
_wapi_set_last_error_from_errno ();
return 0;
}
-#endif
utf16_path = mono_unicode_from_external ((gchar*)buffer, &bytes);
count = (bytes/2)+1;
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)
{
MemoryIntrinsics.il \
mixed.cs
-if NACL_CODEGEN
-test_sources += nacl.cs
-endif
-
regtests_UNIVERSAL = \
basic.exe \
basic-float.exe \
unaligned.exe \
basic-vectors.exe
-if NACL_CODEGEN
-regtests_UNIVERSAL += nacl.exe
-endif
-
regtests_DISABLED =
if FULL_AOT_TESTS
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
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)
#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"
#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
#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"
#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)
* 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;
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");
}
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) {
#endif
-#ifdef __native_client__
-extern char *nacl_mono_path;
-#endif
-
#define DEFAULT_OPTIMIZATIONS ( \
MONO_OPT_PEEPHOLE | \
MONO_OPT_CFOLD | \
#ifdef HOST_WIN32
int mixed_mode = FALSE;
#endif
-#ifdef __native_client__
- gboolean nacl_null_checks_off = FALSE;
-#endif
#ifdef MOONLIGHT
#ifndef HOST_WIN32
#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)
}
}
-#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
{
return 0;
}
- [Category ("NaClDisable")]
public static int test_0_div_zero () {
int d = 1;
int q = 0;
return 0;
}
- [Category ("NaClDisable")]
public static int test_0_long_div_zero () {
long d = 1;
long q = 0;
#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 */
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;
* 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
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;
}
#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)
{
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*
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
#include <mach/clock.h>
#endif
-#if defined(__native_client__) || defined(HOST_WATCHOS)
+#if defined(HOST_WATCHOS)
void
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)
#endif // HAVE_EXECV
}
-#endif /* defined(__native_client__) */
-
#if !defined (__MACH__)
gboolean
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:
*
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 {
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]);
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);
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);
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
}
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 */
} 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);
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;
{
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)
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;
#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.
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;
/* 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*
* \file
*/
-#if defined(__native_client__) && defined(__x86_64__)
-typedef guint64 regmask_t;
-#else
typedef size_t regmask_t;
-#endif
enum {
MONO_REG_INT,
# FIXME fix the profiler tests to work with coop.
if !ENABLE_COOP
-if !NACL_CODEGEN
check_targets = testlog
endif
-endif
endif
endif
#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;
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
#
# Test that no symbols are missed in eglib-remap.h
#
-if NACL_CODEGEN
-else
if PLATFORM_LINUX
test-platform: test-eglib-remap
else
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.
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
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 = \
#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 */
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;
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 ();
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__) */
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)
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)
{
#ifdef MONO_CROSS_COMPILE
g_assert_not_reached ();
-#elif defined(__native_client__)
- g_assert_not_reached ();
#else
arm_ucontext *my_uc = sigctx;
{
#ifdef MONO_CROSS_COMPILE
g_assert_not_reached ();
-#elif defined(__native_client__)
- g_assert_not_reached ();
#else
arm_ucontext *my_uc = ctx;
#endif
#endif
-#if defined(__native_client__)
-#undef MONO_SIGNAL_USE_UCONTEXT_T
-#endif
-
#ifdef __HAIKU__
/* sigcontext surrogate */
struct sigcontext {
#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
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) \
#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"
* \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)
{
}
return mprotect (addr, length, prot);
}
-#endif // __native_client__
#else
#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>
#endif
}
-#ifndef __native_client__
-
static int suspend_signal_num = -1;
static int restart_signal_num = -1;
static int abort_signal_num = -1;
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) */
extern int tkill (pid_t tid, int signal);
#endif
-#if defined(_POSIX_VERSION) || defined(__native_client__)
+#if defined(_POSIX_VERSION)
#include <pthread.h>
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
return !pthread_join (tid, &res);
}
-#endif /* defined(_POSIX_VERSION) || defined(__native_client__) */
+#endif /* defined(_POSIX_VERSION) */
#if defined(USE_POSIX_BACKEND)
((MonoThreadInfo*)info)->tls [key] = value;
}
-#if defined(__native_client__)
-void nacl_shutdown_gc_thread(void);
-#endif
-
/*
* mono_thread_info_exit:
*
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);
/* 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
#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,
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 */
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"
-<?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
<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
-<?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
+++ /dev/null
-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
-
+++ /dev/null
-# 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
-}
+++ /dev/null
-# 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}
+++ /dev/null
-# 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}
+++ /dev/null
-#!/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
+++ /dev/null
-#!/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 "$@"
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
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" "$@"