[Mono-dev] [PATCH] more support for Google Native Client

Elijah Taylor elijahtaylor at google.com
Fri Feb 18 17:19:41 EST 2011


Hi,

Take a look at this:
https://github.com/elijahtaylor/mono/blob/master/mono/mini/genmdesc.c

This includes a dummy implementation of __nacl_suspend_thread_if_needed for
that file.  It wasn't merged into mono's head because it's a temporary
measure and won't be required long term.

Essentially for building Mono for NaCl you can try one of 2 things:

1) Get Mono 2.10 and patch in my nacl/ folder (which it looks like you did)
and my change to genmdesc.c above.  Downside: I haven't explicitly tested
NaCl support with the very latest release, it's possible something has
broken slightly since my patch landed. I'm working on a continuous build to
minimize possible breakage in the future.

2) Get elijahtaylor/mono from github.  Downside: I haven't merged all of the
2.10 changes in, so there may be some stuff you don't get, but you should
get all of the Native Client work and it should function.

And to provide a little more info, I saw your posts to the other mono-devel
thread (sorry, I missed the one a few days ago).  Please note that 3D
support is currently in progress in Native Client and may not be suitable
for public use.  Also, Mono for NaCl doesn't have any bindings to any of the
PPAPI interfaces that are exposed for interacting with the browser yet, so
if you need such interaction, you'll have to provide it in C/C++ in the
meantime; this is really a barebones implementation of Mono currently.  And
lastly, I haven't tested building Mono for NaCl under cygwin, but if you
have the Native Client toolchain installed in cygwin, I would *assume* it
should work, but you're really in uncharted waters.  I've been building on
Ubuntu 10.04 LTS and Mac OS X 10.5.8 with success.

-Elijah

On Fri, Feb 18, 2011 at 9:20 AM, C.Rivlaldo <vladimir at neoaxisgroup.com>wrote:

>
> Hello!
>
> I'm trying to compile Mono 2.10 for Nacl at Ubuntu with using Elijah's
> patch.
>
> After executing "nacl-runtime-mono.sh" I had some error about undefined
> reference:
> genmdesc.c:29: undefined reference to `__nacl_suspend_thread_if_needed'
>
> Why it happened? Please, help me. I want to compile mono very much.
>
> P.S. End of log which I get:
> /bin/bash ../../libtool --tag=CC   --mode=link
> /home/vladimir/nacl/native_client/toolchain/linux_x86/bin/nacl-gcc
> -I../../../.. -I../../../../eglib/src -I../../eglib/src    -g
> -D_POSIX_PATH_MAX=256 -DPATH_MAX=256 -fno-strict-aliasing
> -Wdeclaration-after-statement -g -Wall -Wunused -Wmissing-prototypes
> -Wmissing-declarations -Wstrict-prototypes  -Wmissing-prototypes
> -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings
> -mno-tls-direct-seg-refs   -o genmdesc genmdesc-genmdesc.o
> genmdesc-helpers.o genmdesc-opcodes.o ../../mono/utils/libmonoutils.la -lm
> -L../../eglib/src -leglib -lm -lm -lnosys -lg -lpthread
> libtool: link:
> /home/vladimir/nacl/native_client/toolchain/linux_x86/bin/nacl-gcc
> -I../../../.. -I../../../../eglib/src -I../../eglib/src -g
> -D_POSIX_PATH_MAX=256 -DPATH_MAX=256 -fno-strict-aliasing
> -Wdeclaration-after-statement -g -Wall -Wunused -Wmissing-prototypes
> -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes
> -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings
> -mno-tls-direct-seg-refs -o genmdesc genmdesc-genmdesc.o genmdesc-helpers.o
> genmdesc-opcodes.o  ../../mono/utils/.libs/libmonoutils.a
> -L/home/vladimir/mono/nacl/runtime-build/eglib/src
> /home/vladimir/mono/nacl/runtime-build/eglib/src/.libs/libeglib.a -lm
> -lnosys -lg -lpthread
>
> /home/vladimir/mono/nacl/runtime-build/eglib/src/.libs/libeglib.a(libeglib_la-gpath.o):
> In function `monoeg_g_find_program_in_path':
>
> /home/vladimir/mono/nacl/runtime-build/eglib/src/../../../../eglib/src/gpath.c:226:
> warning: the `access' function is not implemented and will always fail
>
> /home/vladimir/nacl/native_client/toolchain/linux_x86/bin/../lib/gcc/nacl64/4.4.3/../../../../nacl64/lib/../lib32/libg.a(lib_a-execve.o):
> In function `execve':
> execve.c:(.text+0xa): warning: the `_execve' function is not implemented
> and
> will always fail
>
> /home/vladimir/nacl/native_client/toolchain/linux_x86/bin/../lib/gcc/nacl64/4.4.3/../../../../nacl64/lib/../lib32/libg.a(lib_a-execr.o):
> In function `_fork_r':
> execr.c:(.text+0x9c): warning: the `fork' function is not implemented and
> will always fail
>
> /home/vladimir/mono/nacl/runtime-build/eglib/src/.libs/libeglib.a(libeglib_la-gfile-posix.o):
> In function `monoeg_g_get_current_dir':
>
> /home/vladimir/mono/nacl/runtime-build/eglib/src/../../../../eglib/src/gfile-posix.c:158:
> warning: the `getcwd' function is not implemented and will always fail
>
> /home/vladimir/mono/nacl/runtime-build/eglib/src/.libs/libeglib.a(libeglib_la-gmisc-unix.o):
> In function `get_pw_data':
>
> /home/vladimir/mono/nacl/runtime-build/eglib/src/../../../../eglib/src/gmisc-unix.c:97:
> warning: the `getpwuid_r' function is not implemented and will always fail
>
> /home/vladimir/mono/nacl/runtime-build/eglib/src/../../../../eglib/src/gmisc-unix.c:97:
> warning: the `getuid' function is not implemented and will always fail
> genmdesc-helpers.o: In function `mono_disassemble_code':
>
> /home/vladimir/mono/nacl/runtime-build/mono/mini/../../../../mono/mini/helpers.c:253:
> warning: the `unlink' function is not implemented and will always fail
>
> /home/vladimir/nacl/native_client/toolchain/linux_x86/bin/../lib/gcc/nacl64/4.4.3/../../../../nacl64/lib/../lib32/libg.a(lib_a-execr.o):
> In function `_wait_r':
> execr.c:(.text+0x1c): warning: the `wait' function is not implemented and
> will always fail
> genmdesc-genmdesc.o: In function `monoeg_strdup':
>
> /home/vladimir/mono/nacl/runtime-build/mono/mini/../../../../eglib/src/glib.h:148:
> undefined reference to `__nacl_suspend_thread_if_needed'
> genmdesc-genmdesc.o: In function `inst_name':
>
> /home/vladimir/mono/nacl/runtime-build/mono/mini/../../../../mono/mini/genmdesc.c:29:
> undefined reference to `__nacl_suspend_thread_if_needed'
>
> /home/vladimir/mono/nacl/runtime-build/mono/mini/../../../../mono/mini/genmdesc.c:34:
> undefined reference to `__nacl_suspend_thread_if_needed'
>
> /home/vladimir/mono/nacl/runtime-build/mono/mini/../../../../mono/mini/genmdesc.c:34:
> undefined reference to `__nacl_suspend_thread_if_needed'
> genmdesc-genmdesc.o: In function `load_file':
>
> /home/vladimir/mono/nacl/runtime-build/mono/mini/../../../../mono/mini/genmdesc.c:53:
> undefined reference to `__nacl_suspend_thread_if_needed'
>
> genmdesc-genmdesc.o:/home/vladimir/mono/nacl/runtime-build/mono/mini/../../../../mono/mini/genmdesc.c:62:
> more undefined references to `__nacl_suspend_thread_if_needed' follow
> collect2: ld returned 1 exit status
> make[3]: *** [genmdesc] Ошибка 1
> make[3]: Выход из каталога
> `/home/vladimir/mono/nacl/runtime-build/mono/mini'
> make[2]: *** [all-recursive] Ошибка 1
> make[2]: Выход из каталога `/home/vladimir/mono/nacl/runtime-build/mono'
> make[1]: *** [all-recursive] Ошибка 1
> make[1]: Выход из каталога `/home/vladimir/mono/nacl/runtime-build'
> make: *** [all] Ошибка 2
>
> --
> View this message in context:
> http://mono.1490590.n4.nabble.com/PATCH-more-support-for-Google-Native-Client-tp3159583p3313177.html
> Sent from the Mono - Dev mailing list archive at Nabble.com.
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20110218/5d7e70a2/attachment.html 


More information about the Mono-devel-list mailing list