Skip to contentSkip to conversation

package/mono: new package

PATCH Superseded Angelo Compagnucci 4 participants 10 messages Oct 10, 2014 – Oct 17, 2014

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 package/mono: new package

This patch adds the complete Mono implementation. This patch compiles both the native and managed parts.

---
Changelog:

* Bump to version 3.10.0 (released today!)
* Various build optimization
* Fixing problems with uClibc
* Mono library version chooser added

I tried to merge mono-managed and mono-native in a single package, but crosscompiling and compiling in the same folder without a clean makes a big mess, so I think these packages should remain splitted. Any hint appreciated!

 package/Config.in                                  |  1 +
 package/mono/Config.in                             | 34 ++++++++++++++++++
 package/mono/mono-managed/mono-managed.mk          | 42 ++++++++++++++++++++++
 .../mono-native/mono-native-001-fix_uclibc.patch   | 14 ++++++++
 package/mono/mono-native/mono-native.mk            | 31 ++++++++++++++++
 package/mono/mono.mk                               | 18 ++++++++++
 6 files changed, 140 insertions(+)
 create mode 100644 package/mono/Config.in
 create mode 100644 package/mono/mono-managed/mono-managed.mk
 create mode 100644 package/mono/mono-native/mono-native-001-fix_uclibc.patch
 create mode 100644 package/mono/mono-native/mono-native.mk
 create mode 100644 package/mono/mono.mk
package/Config.in +1 -0
index ea89c96..92cf4b8 100644
@@ -433,6 +433,7 @@ menu "Lua libraries/modules"
 	source "package/xavante/Config.in"
 endmenu
 endif
+	source "package/mono/Config.in"
 	source "package/nodejs/Config.in"
 	source "package/perl/Config.in"
 if BR2_PACKAGE_PERL
package/mono/Config.in new file +34 -0
new file mode 100644
index 0000000..1b2471e
@@ -0,0 +1,34 @@
+config BR2_PACKAGE_MONO
+	bool "mono"
+	select BR2_STRIP_none
+	depends on (BR2_arm || BR2_armeb || BR2_i386 || BR2_mips \
+		|| BR2_powerpc || BR2_sparc || BR2_x86_64)
+	depends on BR2_INET_IPV6
+	help
+	  An open source, cross-platform, implementation of C#
+	  and the CLR that is binary compatible with Microsoft.NET.
+
+	  http://download.mono-project.com/sources/mono/
+
+if BR2_PACKAGE_MONO
+	config BR2_PACKAGE_MONO_20
+		bool "2.0 .Net Runtime"
+		help
+		  Version 2.0 of Mono .Net runtime
+	config BR2_PACKAGE_MONO_30
+		bool "3.0 .Net Runtime"
+		help
+		  Version 3.0 of Mono .Net runtime
+	config BR2_PACKAGE_MONO_40
+		bool "4.0 .Net Runtime"
+		help
+		  Version 4.0 of Mono .Net runtime
+	config BR2_PACKAGE_MONO_45
+		default y
+		bool "4.5 .Net Runtime"
+		help
+		  Version 4.5 of Mono .Net runtime
+endif
+
+comment "mono needs a toolchain w/ IPv6"
+	depends on !BR2_INET_IPV6
package/mono/mono-managed/mono-managed.mk new file +42 -0

42 lines not on this page · raw message

package/mono/mono-native/mono-native-001-fix_uclibc.patch new file +14 -0
new file mode 100644
index 0000000..c82f24b
@@ -0,0 +1,14 @@
+Signed-off-by: Angelo Compagnucci <[email protected]>
+
+diff -purN mono-native-3.8.0.orig/libgc/include/gc.h mono-native-3.8.0/libgc/include/gc.h
+--- mono-native-3.8.0.orig/libgc/include/gc.h	2014-10-07 15:00:21.259466731 +0200
++++ mono-native-3.8.0/libgc/include/gc.h	2014-10-07 15:05:25.560975681 +0200
+@@ -500,7 +500,7 @@ GC_API GC_PTR GC_malloc_atomic_ignore_of
+ #ifdef __linux__
+ # include <features.h>
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+-     && !defined(__ia64__)
++     && !defined(__ia64__) && !defined(__UCLIBC__)
+ #   ifndef GC_HAVE_BUILTIN_BACKTRACE
+ #     define GC_HAVE_BUILTIN_BACKTRACE
+ #   endif
package/mono/mono-native/mono-native.mk new file +31 -0
new file mode 100644
index 0000000..6c371d0
@@ -0,0 +1,31 @@
+#############################################################
+#
+# mono-native
+#
+#############################################################
+
+MONO_NATIVE_VERSION = $(MONO_VERSION)
+MONO_NATIVE_SITE = $(MONO_SITE)
+MONO_NATIVE_SOURCE = $(MONO_SOURCE)
+MONO_NATIVE_INSTALL_STAGING = $(MONO_INSTALL_STAGING)
+
+MONO_NATIVE_DEPENDENCIES += host-mono-managed
+
+# Disable managed code (mcs folder) from building
+MONO_NATIVE_CONF_OPTS = $(MONO_CONF_OPT) --disable-mcs-build
+
+define MONO_NATIVE_TWEAK_LIBC_NAME
+	$(SED) 's/libc.so.6/$(MONO_LIBC_NAME)/g' $(TARGET_DIR)/etc/mono/config
+endef
+
+ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
+	MONO_LIBC_NAME = libc.so.0
+else ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
+	MONO_LIBC_NAME = libc.so
+endif
+
+ifneq ($(MONO_LIBC_NAME),)
+	MONO_NATIVE_POST_INSTALL_TARGET_HOOKS += MONO_NATIVE_TWEAK_LIBC_NAME
+endif
+
+$(eval $(autotools-package))
package/mono/mono.mk new file +18 -0
new file mode 100644
index 0000000..541f9ad
@@ -0,0 +1,18 @@
+#############################################################
+#
+# mono
+#
+#############################################################
+
+MONO_VERSION = 3.10.0
+MONO_SITE = http://download.mono-project.com/sources/mono/
+MONO_SOURCE = mono-$(MONO_VERSION).tar.bz2
+MONO_INSTALL_STAGING = YES
+
+MONO_CONF_OPT = --disable-gtk-doc --with-mcs-docs=no \
+	--with-moonlight=no --disable-libraries --with-ikvm-native=no
+
+ifeq ($(BR2_PACKAGE_MONO),y)
+	include package/mono/*/*.mk
+	TARGETS += mono-native mono-managed
+endif
Signature · 1 line
2.1.1
#1 lore raw

PATCH v3 1/1 package/mono: new package

Dear Angelo Compagnucci,

Quoted 4 lines · Angelo Compagnucci

I tried to merge mono-managed and mono-native in a single package, but crosscompiling and compiling in the same folder without a clean makes a big mess, so I think these packages should remain splitted. Any hint appreciated!

I still don't understand why you think the build takes place in the same folder: the host and target variants of the same package are built in separate directories.

I'm working on the patches that use a single mono package. There are other issues with your patch: host-mono-managed automatically downloads monolite, which is bad, as it circumvents the download infrastructure of Buildroot. I'll show you an approach to fix that.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH v3 1/1 package/mono: new package

Hi Thomas,

2014-10-10 20:48 GMT+02:00 Thomas Petazzoni
<[email protected]>:

Quoted 7 lines

Dear Angelo Compagnucci,

On Fri, 10 Oct 2014 16:23:37 +0200, Angelo Compagnucci wrote:

I still don't understand why you think the build takes place in the same folder: the host and target variants of the same package are built in separate directories.

Well, this aspect is a little bit obsure for me, I'll rework the documentation to understand better.

Quoted 4 lines

I'm working on the patches that use a single mono package. There are other issues with your patch: host-mono-managed automatically downloads monolite, which is bad, as it circumvents the download infrastructure of Buildroot. I'll show you an approach to fix that.

Yes, it could be fixed, and if it's mandatory for accepting this patch, I will work on that!

Thank you!

Quoted 8 lines

Best regards,

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

Signature · 1 line
Profile: http://it.linkedin.com/in/compagnucciangelo
#3 lore raw

PATCH v3 1/1 package/mono: new package

Hi Thomas,

Quoted 4 lines
Quoted 4 lines

I'm working on the patches that use a single mono package. There are other issues with your patch: host-mono-managed automatically downloads monolite, which is bad, as it circumvents the download infrastructure of Buildroot. I'll show you an approach to fix that.

Another thing. I'm using this patch as a training to understand better how to write good buildroot packages. I hope to contribute more in the future! I really appreciate any hint and I prefer to write the patch myself!
So I will be really grateful if you can review this patch and point me to the right direction, step by step, if it's not to much a hassle for you!

Again, thank you for your time!

Quoted 12 lines
Quoted 7 lines

Best regards,

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

--
Profile: http://it.linkedin.com/in/compagnucciangelo

Signature · 1 line
Profile: http://it.linkedin.com/in/compagnucciangelo
#4 lore raw

PATCH v3 1/1 package/mono: new package

Angelo,

Quoted 8 lines · Angelo Compagnucci

Hi Thomas,

Quoted 4 lines
Quoted 4 lines

I'm working on the patches that use a single mono package. There are other issues with your patch: host-mono-managed automatically downloads monolite, which is bad, as it circumvents the download infrastructure of Buildroot. I'll show you an approach to fix that.

Quoted 8 lines

Another thing. I'm using this patch as a training to understand better how to write good buildroot packages. I hope to contribute more in the future! I really appreciate any hint and I prefer to write the patch myself!
So I will be really grateful if you can review this patch and point me to the right direction, step by step, if it's not to much a hassle for you!

For your reference, I've got a start on taking a submission from a few months back and making the build a single package. I'll send out the patch when I'm back in the office Monday. I never had a chance to completely finish and test it.

Thanks,
Matt

Quoted 17 lines

Again, thank you for your time!

Quoted 10 lines
Quoted 7 lines

Best regards,

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

Quoted 2 lines

--
Profile: http://it.linkedin.com/in/compagnucciangelo

Quoted 6 lines

--
Profile: http://it.linkedin.com/in/compagnucciangelo
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20141010/cd960aef/attachment.html>

#5 lore raw

PATCH v3 1/1 package/mono: new package

Hi Matthew,

Quoted 4 lines

For your reference, I've got a start on taking a submission from a few months back and making the build a single package. I'll send out the patch when I'm back in the office Monday. I never had a chance to completely finish and test it.

This is really unfortunate! I'm working on this patch for months now, but only received a partial review from Yann some months ago. I really want to became a buildroot contributor with something more substantial than a couple of bugs fixed.
In the weekend I still will complete the patch, I finally understand how to merge both packages in one and I'm making my definitive patch. Probably it will be trashed on monday, but who cares, I learned so much!

Thank you for your time!

Quoted 27 lines

Thanks,
Matt

Quoted 23 lines

Again, thank you for your time!

Quoted 10 lines
Quoted 7 lines

Best regards,

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

Quoted 2 lines

--
Profile: http://it.linkedin.com/in/compagnucciangelo

--
Profile: http://it.linkedin.com/in/compagnucciangelo
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Signature · 1 line
Profile: http://it.linkedin.com/in/compagnucciangelo
#6 lore raw

PATCH v3 1/1 package/mono: new package

On 11/10/14 09:25, Angelo Compagnucci wrote:
[snip]

Quoted 4 lines

I'm working on this patch for months now,
but only received a partial review from Yann some months ago. I really want to became a buildroot contributor with something more substantial than a couple of bugs fixed.

The problem is that mono is really complicated stuff to cross-compile, so
choosing that as your first package is a bit ambitious. Because it is so complicated, people are also afraid to review it. So bear with us please :-)

Regards,
Arnout

[snip]

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#7 lore raw

PATCH v3 1/1 package/mono: new package

Hi Arnout,

Quoted 3 lines

The problem is that mono is really complicated stuff to cross-compile, so
choosing that as your first package is a bit ambitious. Because it is so complicated, people are also afraid to review it. So bear with us please :-)

Of course! And again a big big big thank you for all of your support and time! I really hope that mono finds his way into buildroot, it's a so commonly used piece of software that I think it must be into buildroot.
Probably I'm a bit too ambitious, but my motto is "try harder"! So you will not get rid of me so easily!

There is no other way I can express my gratitude than contributing, so please support me until I became proficient, and you will not regret!

Sincerely, Angelo

Quoted 11 lines

Regards,
Arnout

[snip]
--

Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
Signature · 1 line
Profile: http://it.linkedin.com/in/compagnucciangelo
#8 lore raw

PATCH v3 1/1 package/mono: new package

In reply to Angelo Compagnucci

Dear Angelo Compagnucci,

Quoted 7 lines · Angelo Compagnucci

Another thing. I'm using this patch as a training to understand better how to write good buildroot packages. I hope to contribute more in the future! I really appreciate any hint and I prefer to write the patch myself!
So I will be really grateful if you can review this patch and point me to the right direction, step by step, if it's not to much a hassle for you!

Here are improved patches:

* One patch adding the host-monolite package, so that Mono doesn't download Monolite on its own.

* One patch adding the mono and host-mono packages.

It's still using the old Mono version, so you'll have to update that and check that it continues to work.

Best regards,

Thomas

Signature · 17 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-monolite-new-package.patch
Type: text/x-patch
Size: 1181 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20141011/42105c16/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-mono-new-package.patch
Type: text/x-patch
Size: 6364 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20141011/42105c16/attachment-0001.bin>
#9 lore raw

PATCH v3 1/1 package/mono: new package

Hi Thomas!

Quoted 9 lines

Here are improved patches:

* One patch adding the host-monolite package, so that Mono doesn't download Monolite on its own.

* One patch adding the mono and host-mono packages.

It's still using the old Mono version, so you'll have to update that and check that it continues to work.

Wow! Great work! I'll rework the patches with the latest mono version and adding proper licensing information.
I'll resubmit the patch as soon as possible!

Thank you for your time!

Quoted 7 lines

Best regards,

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

Signature · 1 line
Profile: http://it.linkedin.com/in/compagnucciangelo