[PATCH] Fix libunwind build on ARM

Thierry Reding thierry.reding at gmail.com
Wed Jun 25 07:02:56 PDT 2014


From: Thierry Reding <treding at nvidia.com>

Building the X server with libunwind support on ARM currently yields
these errors at link time:

	  CCLD     Xorg
	/usr/lib/libunwind.so: undefined reference to `__aeabi_unwind_cpp_pr0'
	/usr/lib/libunwind.so: undefined reference to `__aeabi_unwind_cpp_pr1'

This is caused by the configure script looking for the libunwind.pc file
which ends up pulling in -lunwind. On ARM that library doesn't link with
libgcc_s.so where the above symbols are defined, hence the link failure.

If instead the configure script looks for libunwind-generic.pc, then the
-lunwind-generic library is pulled in (it's a symlink to libunwind-arm),
which in turn pulls in -lunwind and -lgcc_s (via DT_NEEDED entries).

Signed-off-by: Thierry Reding <treding at nvidia.com>
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 2daa6beecade..063f0c631e77 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1687,7 +1687,7 @@ AC_SUBST(SHA1_CFLAGS)
 PKG_CHECK_MODULES([XSERVERCFLAGS], [$REQUIRED_MODULES $REQUIRED_LIBS])
 PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS])
 
-PKG_CHECK_MODULES(LIBUNWIND, libunwind, [HAVE_LIBUNWIND=yes], [HAVE_LIBUNWIND=no])
+PKG_CHECK_MODULES(LIBUNWIND, libunwind-generic, [HAVE_LIBUNWIND=yes], [HAVE_LIBUNWIND=no])
 if test "x$LIBUNWIND" = "xauto"; then
     LIBUNWIND="$HAVE_LIBUNWIND"
 fi
-- 
2.0.0



More information about the xorg-devel mailing list