提交 89cd864e 编写于 作者: E Erik Hemming

android; export internal funcs + mono_file_map_override

上级 0867dca2
......@@ -3,7 +3,7 @@
# NB! Prereq : ANDROID_NDK_ROOT=/usr/local/android-ndk-xxx or similar
# Todo: set appropriate ARM flags for hard floats
ANDROID_PLATFORM=android-5
export ANDROID_PLATFORM=android-5
GCC_VERSION=4.4.0
OUTDIR=builds/embedruntimes/android
PREFIX=`pwd`/builds/android
......@@ -106,9 +106,9 @@ function clean_build
make && echo "Build SUCCESS!" || exit 1
mkdir -p `dirname $3`
cp mono/mini/.libs/libmono.a $3.a
cp mono/mini/.libs/libmono.so $3.so
mkdir -p $3
cp mono/mini/.libs/libmono.a $3
cp mono/mini/.libs/libmono.so $3
}
CCFLAGS_ARMv5_CPU="-DARM_FPU_NONE=1 -march=armv5te -mtune=xscale -msoft-float"
......@@ -119,11 +119,11 @@ LDFLAGS_ARMv7="-Wl,--fix-cortex-a8"
rm -rf $OUTDIR
clean_build "$CCFLAGS_ARMv5_CPU" "$LDFLAGS_ARMv5" "$OUTDIR/libmono_armv5"
clean_build "$CCFLAGS_ARMv5_VFP" "$LDFLAGS_ARMv5" "$OUTDIR/libmono_armv5_vfp"
clean_build "$CCFLAGS_ARMv7_VFP" "$LDFLAGS_ARMv7" "$OUTDIR/libmono_armv7a"
clean_build "$CCFLAGS_ARMv5_CPU" "$LDFLAGS_ARMv5" "$OUTDIR/armv5"
clean_build "$CCFLAGS_ARMv5_VFP" "$LDFLAGS_ARMv5" "$OUTDIR/armv5_vfp"
clean_build "$CCFLAGS_ARMv7_VFP" "$LDFLAGS_ARMv7" "$OUTDIR/armv7a"
NUM_LIBS_BUILT=`ls -Al $OUTDIR | grep libmono | wc -l`
NUM_LIBS_BUILT=`ls -AlR $OUTDIR | grep libmono | wc -l`
if [ $NUM_LIBS_BUILT -eq 6 ]; then
echo "Android STATIC/SHARED libraries are found here: $OUTDIR"
else
......
......@@ -2351,6 +2351,15 @@ case "$host" in
if test "x$X11" = "xlibX11.so"; then
AC_MSG_WARN([Could not find X development libs. Do you have the -devel package installed? WinForms may not work...]);
fi
case $ANDROID_PLATFORM in
android-*)
soname_spec='${libname}${release}${shared_ext}'
;;
*)
soname_spec='${libname}${release}${shared_ext}$major'
;;
esac
;;
esac
......
......@@ -478,7 +478,7 @@ gboolean
mono_runtime_get_no_exec (void) MONO_INTERNAL;
gboolean
mono_assembly_name_parse (const char *name, MonoAssemblyName *aname) MONO_INTERNAL;
mono_assembly_name_parse (const char *name, MonoAssemblyName *aname) /*MONO_INTERNAL*/;
void
mono_assembly_name_free (MonoAssemblyName *aname) MONO_INTERNAL;
......
......@@ -98,7 +98,7 @@ void* mono_gc_alloc_fixed (size_t size, void *descr) MONO_INTERNAL;
void mono_gc_free_fixed (void* addr) MONO_INTERNAL;
/* make sure the gchandle was allocated for an object in domain */
gboolean mono_gchandle_is_in_domain (guint32 gchandle, MonoDomain *domain) MONO_INTERNAL;
gboolean mono_gchandle_is_in_domain (guint32 gchandle, MonoDomain *domain) /*MONO_INTERNAL*/;
void mono_gchandle_free_domain (MonoDomain *domain) MONO_INTERNAL;
typedef void (*FinalizerThreadCallback) (gpointer user_data);
......
......@@ -1428,7 +1428,7 @@ typedef enum {
MonoRuntimeUnhandledExceptionPolicy
mono_runtime_unhandled_exception_policy_get (void) MONO_INTERNAL;
void
mono_runtime_unhandled_exception_policy_set (MonoRuntimeUnhandledExceptionPolicy policy) MONO_INTERNAL;
mono_runtime_unhandled_exception_policy_set (MonoRuntimeUnhandledExceptionPolicy policy) /*MONO_INTERNAL*/;
MonoVTable *
mono_class_try_get_vtable (MonoDomain *domain, MonoClass *class) MONO_INTERNAL;
......
......@@ -74,7 +74,7 @@ void mono_secman_inheritancedemand_class (MonoClass *klass, MonoClass *parent) M
void mono_secman_inheritancedemand_method (MonoMethod *override, MonoMethod *base) MONO_INTERNAL;
/* Security mode */
void mono_security_set_mode (MonoSecurityMode mode) MONO_INTERNAL;
void mono_security_set_mode (MonoSecurityMode mode) /*MONO_INTERNAL*/;
MonoSecurityMode mono_security_get_mode (void) MONO_INTERNAL;
/* internal calls */
......
......@@ -15,7 +15,7 @@ MonoObject *
mono_thread_pool_finish (MonoAsyncResult *ares, MonoArray **out_args,
MonoObject **exc) MONO_INTERNAL;
void mono_thread_pool_cleanup (void) MONO_INTERNAL;
void mono_thread_pool_cleanup (void) /*MONO_INTERNAL*/;
gboolean mono_thread_pool_remove_domain_jobs (MonoDomain *domain, int timeout) MONO_INTERNAL;
......
......@@ -159,7 +159,7 @@ gboolean mono_thread_test_state (MonoThread *thread, MonoThreadState test) MONO_
void mono_thread_init_apartment_state (void) MONO_INTERNAL;
void mono_thread_cleanup_apartment_state (void) MONO_INTERNAL;
void mono_threads_set_shutting_down (void) MONO_INTERNAL;
void mono_threads_set_shutting_down (void) /*MONO_INTERNAL*/;
gboolean mono_threads_is_shutting_down (void) MONO_INTERNAL;
gunichar2* mono_thread_get_name (MonoThread *this_obj, guint32 *name_len) MONO_INTERNAL;
......
......@@ -12,7 +12,7 @@ typedef enum {
MONO_VERIFIER_MODE_STRICT
} MiniVerifierMode;
void mono_verifier_set_mode (MiniVerifierMode mode) MONO_INTERNAL;
void mono_verifier_set_mode (MiniVerifierMode mode) /*MONO_INTERNAL*/;
void mono_verifier_enable_verify_all (void) MONO_INTERNAL;
gboolean mono_verifier_is_enabled_for_image (MonoImage *image) MONO_INTERNAL;
......
......@@ -5,6 +5,10 @@ VER_1 {
GC_start_blocking;
GC_end_blocking;
gc_thread_vtable;
GC_lookup_thread;
GC_delete_thread;
GC_notify_event;
g_free;
local:
*;
};
......@@ -22,9 +22,29 @@
#include "mono-mmap.h"
static MonoFileMapOpen file_open_func = 0;
static MonoFileMapSize file_size_func = 0;
static MonoFileMapFd file_fd_func = 0;
static MonoFileMapClose file_close_func = 0;
MonoFileMapMap file_map_func = 0;
MonoFileMapUnmap file_unmap_func = 0;
#if defined(ANDROID)
void mono_file_map_override(MonoFileMapOpen open_func, MonoFileMapSize size_func, MonoFileMapFd fd_func, MonoFileMapClose close_func, MonoFileMapMap map_func, MonoFileMapUnmap unmap_func)
{
file_open_func = open_func;
file_size_func = size_func;
file_fd_func = fd_func;
file_close_func = close_func;
file_map_func = map_func;
file_unmap_func = unmap_func;
}
#endif
MonoFileMap *
mono_file_map_open (const char* name)
{
if (file_open_func) return file_open_func(name);
return (MonoFileMap *)fopen (name, "rb");
}
......@@ -32,6 +52,7 @@ guint64
mono_file_map_size (MonoFileMap *fmap)
{
struct stat stat_buf;
if (file_size_func) return file_size_func(fmap);
if (fstat (fileno ((FILE*)fmap), &stat_buf) < 0)
return 0;
return stat_buf.st_size;
......@@ -40,12 +61,14 @@ mono_file_map_size (MonoFileMap *fmap)
int
mono_file_map_fd (MonoFileMap *fmap)
{
if (file_fd_func) return file_fd_func(fmap);
return fileno ((FILE*)fmap);
}
int
mono_file_map_close (MonoFileMap *fmap)
{
if (file_close_func) return file_close_func(fmap);
return fclose ((FILE*)fmap);
}
......
......@@ -314,9 +314,13 @@ mono_vfree (void *addr, size_t length)
* the memory area using mono_file_unmap ().
*
*/
extern MonoFileMapMap file_map_func;
extern MonoFileMapUnmap file_unmap_func;
void*
mono_file_map (size_t length, int flags, int fd, guint64 offset, void **ret_handle)
{
if (file_map_func) return file_map_func(length, flags, fd, offset, ret_handle);
void *ptr;
int mflags = 0;
int prot = prot_from_flags (flags);
......@@ -350,6 +354,7 @@ mono_file_map (size_t length, int flags, int fd, guint64 offset, void **ret_hand
int
mono_file_unmap (void *addr, void *handle)
{
if (file_unmap_func) return file_unmap_func(addr, handle);
return munmap (addr, (size_t)handle);
}
......
......@@ -52,5 +52,14 @@ typedef void (*mono_file_map_release_fn) (void *addr);
void mono_file_map_set_allocator (mono_file_map_alloc_fn alloc, mono_file_map_release_fn release);
typedef MonoFileMap* (*MonoFileMapOpen) (const char* name);
typedef guint64 (*MonoFileMapSize) (MonoFileMap *fmap);
typedef int (*MonoFileMapFd) (MonoFileMap *fmap);
typedef int (*MonoFileMapClose) (MonoFileMap *fmap);
typedef void * (*MonoFileMapMap) (size_t length, int flags, int fd, guint64 offset, void **ret_handle);
typedef int (*MonoFileMapUnmap) (void *addr, void *handle);
void mono_file_map_override(MonoFileMapOpen open_func, MonoFileMapSize size_func, MonoFileMapFd fd_func, MonoFileMapClose close_func, MonoFileMapMap map_func, MonoFileMapUnmap unmap_func);
#endif /* __MONO_UTILS_MMAP_H__ */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册