package/mono: fix linking options for locale_charset
PATCH 1/1 package/mono: fix linking options for locale_charset
* Adding a patch for proper locale_charset linking handling.
* With this patch there is no need anymore for forcing libiconv as dependency, mono will now check if locale is enabled or not and acts accordingly.
Fixes http://autobuild.buildroot.net/results/8d2cd5619ba4d9cec5c8ac7fef467f47abc18aea/
http://autobuild.buildroot.net/results/a3678744ded94906961430f3a4523cf1f1b0099b/
---
The patch was submitted upstream, I will care of remove it when it will included.
...glib-checking-for-locale_charset-function.patch | 28 ++++++++++++++++++++++ package/mono/Config.in | 1 - 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 package/mono/0005-eglib-checking-for-locale_charset-function.patch
package/mono/0005-eglib-checking-for-locale_charset-function.patch new file +28 -0
@@ -0,0 +1,28 @@ +From 026a8c44d332b3595814ce0aceba255467cd7b6d Mon Sep 17 00:00:00 2001 +From: Angelo Compagnucci <[email protected]> +Date: Sat, 5 Sep 2015 08:57:21 +0200 +Subject: [PATCH] eglib: checking for locale_charset function + +This patch checks if locale_charset function is availabe in +libiconv or libcharset and changes the linking options accordingly. + +Signed-off-by: Angelo Compagnucci <[email protected]> +--- + eglib/configure.ac | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/eglib/configure.ac b/eglib/configure.ac +index 9d094ea..5ea220e 100644 +--- a/eglib/configure.ac ++++ b/eglib/configure.ac +@@ -182,6 +182,7 @@ fi + AC_SUBST(G_HAVE_ISO_VARARGS) + + AC_CHECK_HEADERS(getopt.h sys/select.h sys/time.h sys/wait.h pwd.h langinfo.h iconv.h localcharset.h sys/types.h sys/resource.h) ++AC_CHECK_LIB([iconv], [locale_charset],[],[AC_CHECK_LIB([charset], [locale_charset],[LIBS+="-liconv -lcharset"])]) + AC_CHECK_HEADER(alloca.h, [HAVE_ALLOCA_H=1], [HAVE_ALLOCA_H=0]) + AC_SUBST(HAVE_ALLOCA_H) + +-- +1.9.1 +
package/mono/Config.in +0 -1
@@ -8,7 +8,6 @@ config BR2_PACKAGE_MONO depends on BR2_PACKAGE_MONO_ARCH_SUPPORTS depends on BR2_TOOLCHAIN_HAS_THREADS depends on !BR2_STATIC_LIBS - select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE help An open source, cross-platform, implementation of C# and the CLR that is binary compatible with Microsoft.NET.
Signature · 1 line
1.9.1
PATCH 1/1 package/mono: fix linking options for locale_charset
Dear Angelo Compagnucci,
Quoted 2 lines · Angelo Compagnucci
+ AC_CHECK_HEADERS(getopt.h
sys/select.hsys/time.hsys/wait.hpwd.hlanginfo.hiconv.hlocalcharset.hsys/types.hsys/resource.h) ++AC_CHECK_LIB([iconv], [locale_charset],[],[AC_CHECK_LIB([charset], [locale_charset],[LIBS+="-liconv -lcharset"])])
Why are you doing LIBS+="-liconv -lcharset" when locale_charset() is found is libcharset ?
Here is what the Git configure.ac is doing for the same problem:
# Define CHARSET_LIB if libiconv does not export the locale_charset symbol
# and libcharset does
CHARSET_LIB=
AC_CHECK_LIB([iconv], [locale_charset],
[CHARSET_LIB=-liconv],
[AC_CHECK_LIB([charset], [locale_charset],
[CHARSET_LIB=-lcharset])])
GIT_CONF_SUBST([CHARSET_LIB])package/mono/Config.in config BR2_PACKAGE_MONO · line 11
Quoted 9 lines
package/mono/Config.in +0
-1@@ -8,7 +8,6 @@ config BR2_PACKAGE_MONO depends on BR2_PACKAGE_MONO_ARCH_SUPPORTS depends on BR2_TOOLCHAIN_HAS_THREADS depends on !BR2_STATIC_LIBS - select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE
What guarantees you that if libiconv is not available, then libcharset will be? What will provide the locale_charset() function?
This really need a few more explanations.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/1 package/mono: fix linking options for locale_charset
Dear Thomas Petazzoni,
2015-09-20 15:23 GMT+02:00 Thomas Petazzoni
<[email protected]>:
Quoted 9 lines
Dear Angelo Compagnucci,
Quoted 2 lines · Angelo Compagnucci
+ AC_CHECK_HEADERS(getopt.h
sys/select.hsys/time.hsys/wait.hpwd.hlanginfo.hiconv.hlocalcharset.hsys/types.hsys/resource.h) ++AC_CHECK_LIB([iconv], [locale_charset],[],[AC_CHECK_LIB([charset], [locale_charset],[LIBS+="-liconv -lcharset"])])Why are you doing LIBS+="-liconv -lcharset" when
locale_charset()is found is libcharset ?
Cause it segfaults at runtime if only linked with -lcharset.
Quoted 11 lines
Here is what the Git configure.ac is doing for the same problem:
# Define
CHARSET_LIBif libiconv does not export thelocale_charsetsymbol# and libcharset does CHARSET_LIB= AC_CHECK_LIB([iconv], [locale_charset], [CHARSET_LIB=-liconv], [AC_CHECK_LIB([charset], [locale_charset], [CHARSET_LIB=-lcharset])]) GIT_CONF_SUBST([CHARSET_LIB])
Quoted 12 lines
package/mono/Config.in config BR2_PACKAGE_MONO · line 11
Quoted 9 lines
package/mono/Config.in +0
-1@@ -8,7 +8,6 @@ config BR2_PACKAGE_MONO depends on BR2_PACKAGE_MONO_ARCH_SUPPORTS depends on BR2_TOOLCHAIN_HAS_THREADS depends on !BR2_STATIC_LIBS - select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALEWhat guarantees you that if libiconv is not available, then libcharset will be? What will provide the
locale_charset()function?
Libcharest is only taken into account if libiconv is present but is not exporting the locale_charset function.
If libiconv is not available, mono will switch to an internal library, the appropriate logic is already present in various places in source code.
Quoted 9 lines
This really need a few more explanations.
Thanks!
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