Mono in NaCL

664 views
Skip to first unread message

Jeff Ward

unread,
Jul 20, 2011, 6:17:28 PM7/20/11
to native-cli...@googlegroups.com
Hi all,

Mono 2.10.2 claims to support NaCL, but I can't find any information on how to make this happen.  Is there a pre-packaged library or do I need to build said  Mono library?

Thanks guys!

--
Jeff

Elijah Taylor

unread,
Jul 20, 2011, 6:42:38 PM7/20/11
to native-cli...@googlegroups.com
Hi Jeff,

Mono does have NaCl support for its x86 (32 and 64 bit) code generators, and even JIT support using dynamic code interfaces NaCl exposes.  This has been part of the Mono codebase since its 2.10 release (Feb 2011).  The changes were merged from my github fork at http://github.com/elijahtaylor/mono and that fork has a better chance of working than the mainline in general since we haven't been running integration tests on mainline changes and NaCl.

I started to dust off the NaCl Mono fork within the last couple weeks, but a lot has changed in NaCl since then and it's currently not 100% working.  In particular I could only get AOT compilation to work, no JIT.  If you're adventurous and want to give it a shot anyway, see the README file in trunk/nacl/ on my fork, but there's no official support for it now.

The NaCl team is working hard towards ABI stability and once that work is complete I'd like to revisit NaCl Mono to bring it back to its former functionality and make sure it's working going forward.

-Elijah 

--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To post to this group, send email to native-cli...@googlegroups.com.
To unsubscribe from this group, send email to native-client-di...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/native-client-discuss?hl=en.

Jeff Ward

unread,
Jul 25, 2011, 12:03:48 PM7/25/11
to native-cli...@googlegroups.com
Hey Elijah,

Thanks for the heads up.

I'm trying to build from your git repo with the instructions provided and I'm running into some trouble.  I've fixed a few problems with PATHs (using the root of the NativeClient SDK as NACL_SDK_ROOT instead of naclports) but I still have one more problem.

When building mono proper, it's having trouble finding nacl_dyncode.h.  It looks as if this is in native_client/src/untrusted, but it also got "installed" to native_client/scons-out/nacl-x86-32/include.  It looks as if the native_client build script is installing to the wrong location (it should probably be installing into the toolchain directory in NACL_SDK_ROOT).  Is this correct?  Do I want to change the scons script in native_client or change something in the shell script in the nacl directory?

Also, for anyone else that might attempt this, you cannot build this in Windows, even with cygwin.  There seems to be a weird autoconf or sed or something bug in cygwin that causes weird parameters to not pass through while building eglib.  I basically installed Ubuntu on a Virtual PC and it passes eglib fine.

Thanks!

--
Jeff

Elijah Taylor

unread,
Jul 25, 2011, 2:00:25 PM7/25/11
to native-cli...@googlegroups.com
Replies inline:

On Mon, Jul 25, 2011 at 9:03 AM, Jeff Ward <je...@fuzzybinary.com> wrote:
Hey Elijah,

Thanks for the heads up.

I'm trying to build from your git repo with the instructions provided and I'm running into some trouble.  I've fixed a few problems with PATHs (using the root of the NativeClient SDK as NACL_SDK_ROOT instead of naclports) but I still have one more problem. 
 
When building mono proper, it's having trouble finding nacl_dyncode.h.  It looks as if this is in native_client/src/untrusted, but it also got "installed" to native_client/scons-out/nacl-x86-32/include.  It looks as if the native_client build script is installing to the wrong location (it should probably be installing into the toolchain directory in NACL_SDK_ROOT).  Is this correct?  Do I want to change the scons script in native_client or change something in the shell script in the nacl directory?

If you're using SDK 0.4 then nacl_dyncode.h was not an installed header at that time.  You could try manually grabbing the header and library from a native_client build, but that's obviously hacky.  Once we release the next official version of the SDK this should be available to you without extra steps.  Since Mono JIT support is a bit broken in the latest, these nacl_dyncode interfaces won't be super helpful right now anyway.  I intend to dust off NaCl Mono more once the next SDK is available.

 

Also, for anyone else that might attempt this, you cannot build this in Windows, even with cygwin.  There seems to be a weird autoconf or sed or something bug in cygwin that causes weird parameters to not pass through while building eglib.  I basically installed Ubuntu on a Virtual PC and it passes eglib fine.


Nobody has tried this config AFAIK.  It's buildable on Ubuntu and Mac OS 10.5/10.6 (with extra packages, probably).

Jeff Ward

unread,
Jul 25, 2011, 2:14:10 PM7/25/11
to native-cli...@googlegroups.com
Replies inline:

If you're using SDK 0.4 then nacl_dyncode.h was not an installed header at that time.  You could try manually grabbing the header and library from a native_client build, but that's obviously hacky.  Once we release the next official version of the SDK this should be available to you without extra steps.  Since Mono JIT support is a bit broken in the latest, these nacl_dyncode interfaces won't be super helpful right now anyway.  I intend to dust off NaCl Mono more once the next SDK is available.


For now I guess I'll try removing references to nacl_dyncode?  Is this worth me even attempting before you do a bit of dusting? What's the timeline on SDK 0.5?

 
Nobody has tried this config AFAIK.  It's buildable on Ubuntu and Mac OS 10.5/10.6 (with extra packages, probably).


I've tried it ;).  The error is really weird in cygwin.  When running autoconf on eglib, one of the compiler tests fails, complaining of an unknown command line flag.  I don't know enough about autoconf to know what's potentially causing the problem, but Ubuntu (with extra packages ;)) seems to be working fine save the nacl_dyncode issues.

Elijah Taylor

unread,
Jul 25, 2011, 2:52:53 PM7/25/11
to native-cli...@googlegroups.com
On Mon, Jul 25, 2011 at 11:14 AM, Jeff Ward <je...@fuzzybinary.com> wrote:
Replies inline:

If you're using SDK 0.4 then nacl_dyncode.h was not an installed header at that time.  You could try manually grabbing the header and library from a native_client build, but that's obviously hacky.  Once we release the next official version of the SDK this should be available to you without extra steps.  Since Mono JIT support is a bit broken in the latest, these nacl_dyncode interfaces won't be super helpful right now anyway.  I intend to dust off NaCl Mono more once the next SDK is available.


For now I guess I'll try removing references to nacl_dyncode?  Is this worth me even attempting before you do a bit of dusting? What's the timeline on SDK 0.5?


I can't comment on SDK release timeframes, but it depends if having an AOT compiler only is worth your effort right now.  Given that JIT will still be unusable for some time this type of change wouldn't negatively impact you, but it may cause unnecessary headaches as you fight with brokenness and workarounds.

 
 
Nobody has tried this config AFAIK.  It's buildable on Ubuntu and Mac OS 10.5/10.6 (with extra packages, probably).


I've tried it ;).  

Ha, fair enough :)

David Springer

unread,
Jul 25, 2011, 2:56:25 PM7/25/11
to native-cli...@googlegroups.com
On Mon, Jul 25, 2011 at 12:52 PM, Elijah Taylor <elijah...@google.com> wrote:


On Mon, Jul 25, 2011 at 11:14 AM, Jeff Ward <je...@fuzzybinary.com> wrote:
Replies inline:

If you're using SDK 0.4 then nacl_dyncode.h was not an installed header at that time.  You could try manually grabbing the header and library from a native_client build, but that's obviously hacky.  Once we release the next official version of the SDK this should be available to you without extra steps.  Since Mono JIT support is a bit broken in the latest, these nacl_dyncode interfaces won't be super helpful right now anyway.  I intend to dust off NaCl Mono more once the next SDK is available.


For now I guess I'll try removing references to nacl_dyncode?  Is this worth me even attempting before you do a bit of dusting? What's the timeline on SDK 0.5?

Unless some catastrophe occurs, there should be an SDK release candidate a couple of days after the M14 dev branch point (which should be this week sometime).  The release candidate might not be the final release, and will be subject to changes without notice so use appropriate caution.
 


I can't comment on SDK release timeframes, but it depends if having an AOT compiler only is worth your effort right now.  Given that JIT will still be unusable for some time this type of change wouldn't negatively impact you, but it may cause unnecessary headaches as you fight with brokenness and workarounds.

 
 
Nobody has tried this config AFAIK.  It's buildable on Ubuntu and Mac OS 10.5/10.6 (with extra packages, probably).


I've tried it ;).  

Ha, fair enough :)

--

Victor Khimenko

unread,
Jul 25, 2011, 3:33:44 PM7/25/11
to native-cli...@googlegroups.com
On Mon, Jul 25, 2011 at 10:14 PM, Jeff Ward <je...@fuzzybinary.com> wrote:

Nobody has tried this config AFAIK.  It's buildable on Ubuntu and Mac OS 10.5/10.6 (with extra packages, probably).


I've tried it ;).  The error is really weird in cygwin.  When running autoconf on eglib, one of the compiler tests fails, complaining of an unknown command line flag.

It may be related to bug #2074:

Of course few developers use CygWin right now so it may be totally unrelated bug.

Andrew

unread,
Jun 25, 2013, 7:52:25 AM6/25/13
to native-cli...@googlegroups.com
I can see there were a bunch of replies to this question in 2011.
I am wondering if there has been much of an update or progress on this since then?
(It is now Jun 2013).

Is https://github.com/elijahtaylor/mono still the place to start with this?

Andrew

Elijah Taylor

unread,
Jun 25, 2013, 11:48:09 AM6/25/13
to native-cli...@googlegroups.com

Hi,

See this thread for instructions on getting started: https://groups.google.com/forum/#!msg/native-client-discuss/hHYJbE-IL2M/0sbbOn0jWpAJ

Mono is available as an add on to the SDK. It is built for each revision of the SDK, but I haven't had a close eye on it lately so it's possible a new version might not be covered. Please let us know if you run into issues.

The github link you listed is still where these bundles are built out of for now, though all the code has been upstreamed to mono/mono and will soon build from there for actual releases.

-Elijah

--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-di...@googlegroups.com.

To post to this group, send email to native-cli...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages