From patchwork Sun Oct 12 07:50:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 398906 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 53A111400F4 for ; Sun, 12 Oct 2014 18:50:40 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 7C07F92106; Sun, 12 Oct 2014 07:50:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5MAGgrwh+Tmz; Sun, 12 Oct 2014 07:50:37 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id EA058920BE; Sun, 12 Oct 2014 07:50:36 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 7AC781BFA9F for ; Sun, 12 Oct 2014 07:50:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 76351954B0 for ; Sun, 12 Oct 2014 07:50:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id optA-Nzwi9gE for ; Sun, 12 Oct 2014 07:50:33 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wg0-f44.google.com (mail-wg0-f44.google.com [74.125.82.44]) by hemlock.osuosl.org (Postfix) with ESMTPS id 7D702954AF for ; Sun, 12 Oct 2014 07:50:33 +0000 (UTC) Received: by mail-wg0-f44.google.com with SMTP id y10so6568235wgg.15 for ; Sun, 12 Oct 2014 00:50:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ui0vMYyhfMn04THGVrx80tfmiXGYaMYsgglUP18Nf7w=; b=jaWA8AFxhymbrVQbHg71nhm8j3OEBHaOhEuTyeLT/DZ3qZmAdpTRv59taQg713svk5 2tIeakhZU8m6pl0Gsi2i7Ctw1PGhvWNbIRxNQo97NVK1milO+W0UIOfaHPwJNhgRCKHF 3W8ojHrbk7YoLWV9FpgHb2JlwhRNdMWScF9cu7Nbi3QchhyCiYHUZZZZhaeZ6pqrrOoU U9y/KdSaRVm4++m85CozefxTfZr/Wx8W3RY7ky9AxdPauCxxberpSvYcu0GGzcQ/p1QH 9m4rQU7GZ5ZaaktFA+bI0F7Wjt+AFsNIOzFuCMaLrxKf/0o+/E+wSZs8bWxaIhhtYx1+ GRcg== X-Received: by 10.194.234.66 with SMTP id uc2mr13892395wjc.26.1413100231833; Sun, 12 Oct 2014 00:50:31 -0700 (PDT) Received: from localhost.localdomain ([89.202.204.147]) by mx.google.com with ESMTPSA id h4sm12456273wjb.9.2014.10.12.00.50.30 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 12 Oct 2014 00:50:30 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Sun, 12 Oct 2014 09:50:08 +0200 Message-Id: <1413100208-12776-3-git-send-email-angelo.compagnucci@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1413100208-12776-1-git-send-email-angelo.compagnucci@gmail.com> References: <1413100208-12776-1-git-send-email-angelo.compagnucci@gmail.com> Subject: [Buildroot] [PATCH 2/2] package/mono: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This patch adds the complete Mono implementation. This patch builds both the native and managed parts. Signed-off-by: Angelo Compagnucci --- package/Config.in | 1 + package/mono/Config.in | 39 ++++++++++++ package/mono/mono-001-gc-fix-uclibc.patch | 16 +++++ package/mono/mono-002-support-uclibc-musl.patch | 25 ++++++++ package/mono/mono.mk | 74 +++++++++++++++++++++++ 5 files changed, 155 insertions(+) create mode 100644 package/mono/Config.in create mode 100644 package/mono/mono-001-gc-fix-uclibc.patch create mode 100644 package/mono/mono-002-support-uclibc-musl.patch create mode 100644 package/mono/mono.mk diff --git a/package/Config.in b/package/Config.in index ea89c96..92cf4b8 100644 --- a/package/Config.in +++ b/package/Config.in @@ -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 diff --git a/package/mono/Config.in b/package/mono/Config.in new file mode 100644 index 0000000..de2d68b --- /dev/null +++ b/package/mono/Config.in @@ -0,0 +1,39 @@ +config BR2_PACKAGE_MONO_ARCH_SUPPORTS + bool + default y if (BR2_arm || BR2_armeb || BR2_i386 || BR2_mips || \ + BR2_mipsel || BR2_powerpc || BR2_sparc || BR2_x86_64) + +config BR2_PACKAGE_MONO + bool "mono" + select BR2_STRIP_none + depends on BR2_PACKAGE_MONO_ARCH_SUPPORTS + 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_35 + bool "3.5 .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 diff --git a/package/mono/mono-001-gc-fix-uclibc.patch b/package/mono/mono-001-gc-fix-uclibc.patch new file mode 100644 index 0000000..951d568 --- /dev/null +++ b/package/mono/mono-001-gc-fix-uclibc.patch @@ -0,0 +1,16 @@ +Disable backtrace on not supprted uclibc. + +Signed-off-by: Angelo Compagnucci + +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 + # 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 diff --git a/package/mono/mono-002-support-uclibc-musl.patch b/package/mono/mono-002-support-uclibc-musl.patch new file mode 100644 index 0000000..48a3493 --- /dev/null +++ b/package/mono/mono-002-support-uclibc-musl.patch @@ -0,0 +1,25 @@ +Adjust libc.so path depending on C library being used + +By default, on Linux systems, Mono assumes that the C library is +libc.so.6. While this is true for glibc, it is not true for uClibc and +Musl based systems. This patch adds support for such systems. + +Signed-off-by: Thomas Petazzoni + +Index: b/configure.ac +=================================================================== +--- a/configure.ac ++++ b/configure.ac +@@ -2973,6 +2973,12 @@ + SQLITE="libsqlite.so" + SQLITE3="libsqlite3.so" + ;; ++ *-*-*uclibc*) ++ LIBC="libc.so.0" ++ ;; ++ *-*-*musl*) ++ LIBC="libc.so" ++ ;; + *-*-*linux*) + AC_PATH_X + dlsearch_path=`(libtool --config ; echo eval echo \\$sys_lib_dlsearch_path_spec) | sh` diff --git a/package/mono/mono.mk b/package/mono/mono.mk new file mode 100644 index 0000000..621ad96 --- /dev/null +++ b/package/mono/mono.mk @@ -0,0 +1,74 @@ +############################################################# +# +# mono +# +############################################################# + +MONO_VERSION = 3.10.0 +MONO_SITE = http://download.mono-project.com/sources/mono/ +MONO_SOURCE = mono-$(MONO_VERSION).tar.bz2 +MONO_LICENSE = Dual license LGPL, commercial +MONO_LICENSE_FILES = LICENSE +MONO_INSTALL_STAGING = YES + +# patching configure.ac +MONO_AUTORECONF = YES + +# Disable managed code (mcs folder) from building +MONO_CONF_OPTS = --disable-gtk-doc \ + --with-mcs-docs=no \ + --with-moonlight=no \ + --disable-libraries \ + --with-ikvm-native=no \ + --enable-minimal=aot,profiler,debug \ + --disable-mcs-build + +ifeq ($(BR2_PACKAGE_MONO_20),y) + ASSEMBLY_INCLUDED += $(HOST_DIR)/usr/lib/mono/2.0 +endif + +ifeq ($(BR2_PACKAGE_MONO_35),y) + ASSEMBLY_INCLUDED += $(HOST_DIR)/usr/lib/mono/3.5 +endif + +ifeq ($(BR2_PACKAGE_MONO_40),y) + ASSEMBLY_INCLUDED += $(HOST_DIR)/usr/lib/mono/4.0 +endif + +ifeq ($(BR2_PACKAGE_MONO_45),y) + ASSEMBLY_INCLUDED += $(HOST_DIR)/usr/lib/mono/4.5 +endif + +ifneq ($(ASSEMBLY_INCLUDED),) +define MONO_INSTALL_LIBS + rsync -av --exclude=*.so --exclude=*.mdb --exclude=[0-9].[0-9] \ + $(HOST_DIR)/usr/lib/mono $(TARGET_DIR)/usr/lib/ + rsync -av --exclude=*.so --exclude=*.mdb $(ASSEMBLY_INCLUDED) \ + $(TARGET_DIR)/usr/lib/mono/ +endef +MONO_DEPENDENCIES += host-mono +MONO_POST_INSTALL_TARGET_HOOKS += MONO_INSTALL_LIBS +endif + +HOST_MONO_CONF_OPTS = --disable-gtk-doc \ + --with-mcs-docs=no \ + --with-moonlight=no \ + --disable-libraries \ + --with-ikvm-native=no \ + --enable-minimal=aot,profiler,debug \ + --enable-static + +HOST_MONO_DEPENDENCIES = host-monolite + +define HOST_MONO_SETUP_MONOLITE + rm -rf $(@D)/mcs/class/lib/monolite + (cd $(@D)/mcs/class/lib; ln -s $(HOST_DIR)/usr/lib/monolite monolite) +endef + +HOST_MONO_POST_CONFIGURE_HOOKS += HOST_MONO_SETUP_MONOLITE + +$(eval $(autotools-package)) + +ifneq ($(ASSEMBLY_INCLUDED),) +$(eval $(host-autotools-package)) +endif