diff mbox

package/mono: fixing shared/static handling

Message ID 1418508052-25062-1-git-send-email-angelo.compagnucci@gmail.com
State Accepted
Commit 00129608c3f61705c723afa1d20a205b9aea73d4
Headers show

Commit Message

Angelo Compagnucci Dec. 13, 2014, 10 p.m. UTC
Mono should always be compiled with --enable-static, this patch forces
--enable-static also in case of shared only libraries.

Fixes:
http://autobuild.buildroot.net/results/e739d64011fb6a24ccbef136d75944f3bd2eba03/
http://autobuild.buildroot.net/results/7ebe6909da859507639f57da2d4fee46efc062d4/
http://autobuild.buildroot.net/results/03c2243080b026b0c6f4bb64e7dc8dc359f0c8c2/
http://autobuild.buildroot.net/results/406bf830ae84cf9ce4afd5a4ddc265197df42b44/
http://autobuild.buildroot.net/results/894a3e0627244b5e1980c3840629b4627999d252/
http://autobuild.buildroot.net/results/2dad2609834564060dc090919c128b45e289102e/
http://autobuild.buildroot.net/results/46de32cbe68b614763a72303490515f80cfe5bfd/
http://autobuild.buildroot.net/results/b167d2660ca37b896ceb8f1372d88eda6d6397d7/
http://autobuild.buildroot.net/results/17b6aee3d0aaf425412f9f5d89de665de9efedb8/
http://autobuild.buildroot.net/results/af9e5203299819085441fb6ee27e027d58f220b3/
http://autobuild.buildroot.net/results/138e5bd9bd0e2ad6de13278b446d1a48a9b64b17/
http://autobuild.buildroot.net/results/b77d52aaa5face5d5b8afe39f9a32a51b1df500f/

Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
---
 package/mono/mono.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Peter Korsgaard Dec. 13, 2014, 11:13 p.m. UTC | #1
>>>>> "Angelo" == Angelo Compagnucci <angelo.compagnucci@gmail.com> writes:

 > Mono should always be compiled with --enable-static, this patch forces
 > --enable-static also in case of shared only libraries.

Why? If it is really required, then mono should depend on
!BR2_SHARED_LIBS and show a comment to inform the user that it needs
static library support.

 > Fixes:
 > http://autobuild.buildroot.net/results/e739d64011fb6a24ccbef136d75944f3bd2eba03/
 > http://autobuild.buildroot.net/results/7ebe6909da859507639f57da2d4fee46efc062d4/
 > http://autobuild.buildroot.net/results/03c2243080b026b0c6f4bb64e7dc8dc359f0c8c2/
 > http://autobuild.buildroot.net/results/406bf830ae84cf9ce4afd5a4ddc265197df42b44/
 > http://autobuild.buildroot.net/results/894a3e0627244b5e1980c3840629b4627999d252/
 > http://autobuild.buildroot.net/results/2dad2609834564060dc090919c128b45e289102e/
 > http://autobuild.buildroot.net/results/46de32cbe68b614763a72303490515f80cfe5bfd/
 > http://autobuild.buildroot.net/results/b167d2660ca37b896ceb8f1372d88eda6d6397d7/
 > http://autobuild.buildroot.net/results/17b6aee3d0aaf425412f9f5d89de665de9efedb8/
 > http://autobuild.buildroot.net/results/af9e5203299819085441fb6ee27e027d58f220b3/
 > http://autobuild.buildroot.net/results/138e5bd9bd0e2ad6de13278b446d1a48a9b64b17/
 > http://autobuild.buildroot.net/results/b77d52aaa5face5d5b8afe39f9a32a51b1df500f/

 > Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
 > ---
 >  package/mono/mono.mk | 3 ++-
 >  1 file changed, 2 insertions(+), 1 deletion(-)

 > diff --git a/package/mono/mono.mk b/package/mono/mono.mk
 > index baf205a..3d50ac1 100644
 > --- a/package/mono/mono.mk
 > +++ b/package/mono/mono.mk
 > @@ -24,7 +24,8 @@ MONO_CONF_OPTS = --disable-gtk-doc \
 >  	--disable-libraries \
 >  	--with-ikvm-native=no \
 >  	--enable-minimal=aot,profiler,debug \
 > -	--disable-mcs-build
 > +	--disable-mcs-build \
 > +	--enable-static
 
 >  # The libraries have been built by the host-mono build. Since they are
 >  # architecture-independent, we simply copy them to the target.
 > -- 
 > 1.9.1

 > _______________________________________________
 > buildroot mailing list
 > buildroot@busybox.net
 > http://lists.busybox.net/mailman/listinfo/buildroot
Angelo Compagnucci Dec. 14, 2014, 8:33 a.m. UTC | #2
Hi Peter

2014-12-14 0:13 GMT+01:00 Peter Korsgaard <peter@korsgaard.com>:
>>>>>> "Angelo" == Angelo Compagnucci <angelo.compagnucci@gmail.com> writes:
>
>  > Mono should always be compiled with --enable-static, this patch forces
>  > --enable-static also in case of shared only libraries.
>
> Why? If it is really required, then mono should depend on
> !BR2_SHARED_LIBS and show a comment to inform the user that it needs
> static library support.

Mono doesn't really uses shared libraries at all, it ships its own
glibc (eglib) and its own libmono library, It should be compiled
statically for this reason, you can find further details here:
http://www.mono-project.com/docs/compiling-mono/unsupported-advanced-compile-options/#static-vs-dynamic-mono
.

Before the new shared/static handling, --enable-static was always
passed as a configure option.

Sincerely, Angelo
Peter Korsgaard Dec. 14, 2014, 12:16 p.m. UTC | #3
>>>>> "Angelo" == Angelo Compagnucci <angelo.compagnucci@gmail.com> writes:

 > Hi Peter
 > 2014-12-14 0:13 GMT+01:00 Peter Korsgaard <peter@korsgaard.com>:
 >>>>>>> "Angelo" == Angelo Compagnucci <angelo.compagnucci@gmail.com> writes:
 >> 
 >> > Mono should always be compiled with --enable-static, this patch forces
 >> > --enable-static also in case of shared only libraries.
 >> 
 >> Why? If it is really required, then mono should depend on
 >> !BR2_SHARED_LIBS and show a comment to inform the user that it needs
 >> static library support.

 > Mono doesn't really uses shared libraries at all, it ships its own
 > glibc (eglib)

I don't know much about mono, but does this 'eglib' refer to the (GNU)
C-library or the GNOME glib?

From here it sounds like the latter:
http://www.mono-project.com/archived/eglib/

 > and its own libmono library, It should be compiled
 > statically for this reason, you can find further details here:
 > http://www.mono-project.com/docs/compiling-mono/unsupported-advanced-compile-options/#static-vs-dynamic-mono
 > Before the new shared/static handling, --enable-static was always
 > passed as a configure option.

As far as I read that, they *RECOMMEND* that you link it statically.,
but it should also work when linking dynamically.

 > Before the new shared/static handling, --enable-static was always
 > passed as a configure option.

Indeed. The point of the new handling is to ensure that only the shared
variant is built (so save build time).

With that said, I did a quick test and I couldn't get it to work with
--with-static_mono=no, and as it isn't supported by upstream just
sticking with static might be the best approach.

Looking at how E.G. Debian does it, it seems like they also link
mono(-sgen) statically:

https://packages.debian.org/jessie/mono-runtime-sgen

They do provide a libmono package:

https://packages.debian.org/jessie/libmono-2.0-1

But none of the other mono packages seem to use it, so it's presumably
for embedding mono in an application:

apt-cache rdepends libmono-2.0-1
libmono-2.0-1
Reverse Depends:
  libmono-2.0-1:i386
  mono-complete
Peter Korsgaard Dec. 14, 2014, 5:04 p.m. UTC | #4
>>>>> "Angelo" == Angelo Compagnucci <angelo.compagnucci@gmail.com> writes:

 > Mono should always be compiled with --enable-static, this patch forces
 > --enable-static also in case of shared only libraries.

 > Fixes:
 > http://autobuild.buildroot.net/results/e739d64011fb6a24ccbef136d75944f3bd2eba03/
 > http://autobuild.buildroot.net/results/7ebe6909da859507639f57da2d4fee46efc062d4/
 > http://autobuild.buildroot.net/results/03c2243080b026b0c6f4bb64e7dc8dc359f0c8c2/
 > http://autobuild.buildroot.net/results/406bf830ae84cf9ce4afd5a4ddc265197df42b44/
 > http://autobuild.buildroot.net/results/894a3e0627244b5e1980c3840629b4627999d252/
 > http://autobuild.buildroot.net/results/2dad2609834564060dc090919c128b45e289102e/
 > http://autobuild.buildroot.net/results/46de32cbe68b614763a72303490515f80cfe5bfd/
 > http://autobuild.buildroot.net/results/b167d2660ca37b896ceb8f1372d88eda6d6397d7/
 > http://autobuild.buildroot.net/results/17b6aee3d0aaf425412f9f5d89de665de9efedb8/
 > http://autobuild.buildroot.net/results/af9e5203299819085441fb6ee27e027d58f220b3/
 > http://autobuild.buildroot.net/results/138e5bd9bd0e2ad6de13278b446d1a48a9b64b17/
 > http://autobuild.buildroot.net/results/b77d52aaa5face5d5b8afe39f9a32a51b1df500f/

 > Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
 > ---
 >  package/mono/mono.mk | 3 ++-
 >  1 file changed, 2 insertions(+), 1 deletion(-)

 > diff --git a/package/mono/mono.mk b/package/mono/mono.mk
 > index baf205a..3d50ac1 100644
 > --- a/package/mono/mono.mk
 > +++ b/package/mono/mono.mk
 > @@ -24,7 +24,8 @@ MONO_CONF_OPTS = --disable-gtk-doc \
 >  	--disable-libraries \
 >  	--with-ikvm-native=no \
 >  	--enable-minimal=aot,profiler,debug \
 > -	--disable-mcs-build
 > +	--disable-mcs-build \
 > +	--enable-static


Committed, thanks.
diff mbox

Patch

diff --git a/package/mono/mono.mk b/package/mono/mono.mk
index baf205a..3d50ac1 100644
--- a/package/mono/mono.mk
+++ b/package/mono/mono.mk
@@ -24,7 +24,8 @@  MONO_CONF_OPTS = --disable-gtk-doc \
 	--disable-libraries \
 	--with-ikvm-native=no \
 	--enable-minimal=aot,profiler,debug \
-	--disable-mcs-build
+	--disable-mcs-build \
+	--enable-static
 
 # The libraries have been built by the host-mono build. Since they are
 # architecture-independent, we simply copy them to the target.