libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libunwind-devel] [PATCH] Link libunwind to libgcc_s rather than libgcc


From: Thierry Reding
Subject: [Libunwind-devel] [PATCH] Link libunwind to libgcc_s rather than libgcc
Date: Fri, 27 Jun 2014 08:40:33 +0200

From: Thierry Reding <address@hidden>

For some architectures, -lgcc and -lgcc_s are not equivalent. On ARM for
example, libgcc_s.so.1 contains some symbols needed by libunwind which
are not present in libgcc.

This causes the following link error when building the X.Org X server
with libunwind support:

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

Linking against libgcc_s explicitly solves this problem.

Signed-off-by: Thierry Reding <address@hidden>
---
Note: Interestingly the libunwind-arm.so that's built on ARM does link
to libgcc_s explicitly, though I wasn't able to figure out where that
comes from. Perhaps libtool is doing something magic here. Keith also
reported that on Debian armel libunwind.so properly links to libgcc_s,
but inspecting the build scripts didn't yield anything useful. I know
that Debian used to patch libtool fairly heavily in the past but looking
at some of the patches they currently carry[0] the Debian libtool does
not seem to be doing anything extra clevel to figure out that it needs
to link to libgcc_s rather than libgcc. I suspect that this could also
be caused by patches to gcc, but I haven't looked that far.

[0]: http://sources.debian.net/src/libtool/2.4.2-1.7/debian/patches/
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 4e2fd236df0d..a77cf01eed2f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -307,7 +307,7 @@ else
 fi
 
 if test x$GCC = xyes -a x$intel_compiler != xyes -a x$qcc_compiler != xyes; 
then
-  LIBCRTS="-lgcc"
+  LIBCRTS="-lgcc_s"
 fi
 
 AC_MSG_CHECKING([for __builtin___clear_cache])
-- 
2.0.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]