[Mono-list] New: cross-compiling with mkbundle

Miguel de Icaza miguel at microsoft.com
Sat Aug 20 03:24:34 UTC 2016


Hello,

The pull request is going through:

https://github.com/mono/mono/pull/3423

The only downside is that until we build new runtime binaries and post them to the server, the feature will not work (it will work with local builds though)

From: Mono-list <mono-list-bounces at lists.dot.net> on behalf of Miguel de Icaza via Mono-list <mono-list at lists.dot.net>
Reply-To: Miguel de Icaza <miguel at microsoft.com>
Date: Friday, August 19, 2016 at 11:05 PM
To: opcon <frozen.dinosaur at gmail.com>, "mono-list at lists.ximian.com" <mono-list at lists.ximian.com>
Subject: Re: [Mono-list] New: cross-compiling with mkbundle


Hello,



1) Will the new cross-platform mode support embedding the machine config?



My program uses web connections which relies on the configuration in

machine.config, however when I bundle a program with:



mkbundle --cross {target} --machine-config {path-to-machine.config} ....

app.exe app-native



and then try to run the output, I get the following error:



Unknown stream on embedded package: machineconfig:


Apologies, this is a bug, I will fix it.



2) Cross-compiling for macOS from Linux produces an ELF binary, rather than

a Mac binary (Mach-0?).



Is this happening because I haven't specified a runtime, just a

cross-compilation target?

It is because I made a mistake.   You can either use Mono/master, or the stable mono branch, or if you do not want to, just run mkbundle and specify the --runtime option, and pass the file to your runtime, like this:


mkbundle --runtime ~/.mono/targets/4.4.0-macos-10.7-amd64/mono






Sent from Outlook<https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2faka.ms%2fweboutlook&data=01%7c01%7cmiguel%40microsoft.com%7c859df007cfdc4c86f11908d3c8a6e106%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=iptT6q%2fn2eHpxDHcGtPFwybsNL8mBNZS2Z3TzPRoqCE%3d>

________________________________
From: Mono-list <mono-list-bounces at lists.dot.net> on behalf of opcon <frozen.dinosaur at gmail.com>
Sent: Thursday, August 18, 2016 7:33 PM
To: mono-list at lists.ximian.com
Subject: Re: [Mono-list] New: cross-compiling with mkbundle

Hi Miguel,

I have 2 questions about the new mkbundle:

1) Will the new cross-platform mode support embedding the machine config?

My program uses web connections which relies on the configuration in
machine.config, however when I bundle a program with:

mkbundle --cross {target} --machine-config {path-to-machine.config} ....
app.exe app-native

and then try to run the output, I get the following error:

Unknown stream on embedded package: machineconfig:

2) Cross-compiling for macOS from Linux produces an ELF binary, rather than
a Mac binary (Mach-0?).

Is this happening because I haven't specified a runtime, just a
cross-compilation target?

Thanks,
Patrick


Miguel de Icaza via Mono-list wrote
> Hello folks,
>
> The new mkbundle tool in Mono no longer requires an installed compiler,
> and you can use it to cross compile.
>
> Would love to get some feedback from you guys.
>
> First, get a list of all cross-platform targets available, like this:
>
> mkbundle –list-targets
>
> Then, find out which version of Mono you have on your system:
>
> mono –version
>
> Use this to pick the right version and fetch it, for example, to cross
> compile to Linux/64 from a Mac do:
>
> mkbundle –fetch-target 4.4.2-linux-libc2.13-amd64
>
> Repeat for as many cross-platform targets as wanted.
>
> Now take your executable that you want to bundle and bundle it up for this
> platform:
>
> mkbundle –cross 4.4.2-linux-libc2.13-amd64 demo.exe demo-native
>
> Now, you can copy that “demo-native” executable to your Linux machine and
> run it.
>
> I have done very minimal testing on this, and some features are missing,
> things that I want to add:
>
> ·         Ship native libraries
>
> ·         Add support for shipping the LLVM runtime as an option
>
> ·         Add support to target different Mono versions, not just the same
> you have installed
>
> Miguel.
>
>
> _______________________________________________
> Mono-list maillist  -

> Mono-list at .dot

> https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2flists.dot.net%2fmailman%2flistinfo%2fmono-list&data=01%7c01%7cmiguel%40microsoft.com%7ccfb62cbb84c34a1afb8f08d3c7c898d2%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=b%2fkc%2fuDmx%2fODHVYyx3rdlhKf8OH7hHZTtYkClPm57lQ%3d





--
View this message in context: https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fmono.1490590.n4.nabble.com%2fNew-cross-compiling-with-mkbundle-tp4668362p4668467.html&data=01%7c01%7cmiguel%40microsoft.com%7ccfb62cbb84c34a1afb8f08d3c7c898d2%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=5fY37yOHGgQbteS3UnxyHyVY8%2fO3Te%2fgrFv5AA0fYGE%3d
Sent from the Mono - General mailing list archive at Nabble.com.
_______________________________________________
Mono-list maillist  -  Mono-list at lists.dot.net
https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2flists.dot.net%2fmailman%2flistinfo%2fmono-list&data=01%7c01%7cmiguel%40microsoft.com%7ccfb62cbb84c34a1afb8f08d3c7c898d2%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=b%2fkc%2fuDmx%2fODHVYyx3rdlhKf8OH7hHZTtYkClPm57lQ%3d
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dot.net/pipermail/mono-list/attachments/20160820/87060622/attachment-0001.html>


More information about the Mono-list mailing list