package/mono: add libunwind optional dependency
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Wed, 15 May 2019 20:47:21 +0000 (22:47 +0200)
committerArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Sun, 27 Oct 2019 18:27:56 +0000 (19:27 +0100)
Add libunwind dependency as well as a patch to link with it

Fixes:
 - http://autobuild.buildroot.net/results/dbd64c89815d393a4e28b312d74fd80ee6de92da

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
package/mono/0003-configure.ac-checks-for-libunwind.patch [new file with mode: 0644]
package/mono/mono.mk

diff --git a/package/mono/0003-configure.ac-checks-for-libunwind.patch b/package/mono/0003-configure.ac-checks-for-libunwind.patch
new file mode 100644 (file)
index 0000000..8ff6b2f
--- /dev/null
@@ -0,0 +1,40 @@
+From 4dc1d1fe553f3a8ad00919324419aba54675239e Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Wed, 15 May 2019 22:30:01 +0200
+Subject: [PATCH] configure.ac: checks for libunwind
+
+_Unwind_GetIP is used in build_stack_trace however this function can be
+provided by libunwind so check for it to avoid the following build
+failure:
+
+/home/buildroot/autobuild/run/instance-1/output/host/lib/gcc/arm-buildroot-linux-musleabihf/7.4.0/../../../../arm-buildroot-linux-musleabihf/bin/ld: ./.libs/libmini.a(libmini_la-mini-exceptions.o): in function `build_stack_trace':
+/home/buildroot/autobuild/run/instance-1/output/build/mono-5.20.1.27/mono/mini/mini-exceptions.c:365: undefined reference to `_Unwind_GetIP'
+collect2: error: ld returned 1 exit status
+
+Fixes:
+ - http://autobuild.buildroot.net/results/dbd64c89815d393a4e28b312d74fd80ee6de92da
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ configure.ac | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index d724f9e2d27..c3067246f08 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2206,6 +2206,11 @@ if test x$host_win32 = xno; then
+       dnl *****************************
+       AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
++      dnl *****************************
++      dnl *** Checks for libunwind ***
++      dnl ****************************
++      AC_CHECK_LIB(unwind, _Unwind_GetIP, LIBS="$LIBS -lunwind")
++
+       case "$host" in
+               *-*-*freebsd*)
+                       dnl *****************************
+-- 
+2.20.1
+
index 96b9c636897a80eeb0a7dc9a0c90621ed79e490d..a65963a25922b3c28799b500b7b907146250cf88 100644 (file)
@@ -40,7 +40,9 @@ ifeq ($(BR2_PACKAGE_LIBICONV),y)
 MONO_DEPENDENCIES += libiconv
 endif
 
-MONO_DEPENDENCIES += host-mono
+MONO_DEPENDENCIES += \
+       host-mono \
+       $(if $(BR2_PACKAGE_LIBUNWIND),libunwind)
 
 ## Mono managed