[PATCH] Fix libunwind build on ARM

Keith Packard keithp at keithp.com
Wed Jun 25 11:53:46 PDT 2014

Thierry Reding <thierry.reding at gmail.com> writes:

> 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).

I'm afraid this conflicts with the libunwind documentation which
explicitly states that -lunwind is the correct library to use for native

               Headerfile to include for native (same platform) unwinding.

              Header file to include when the unwind target runs on
              platform PLAT.  For example, to unwind an IA-64 program,
              the header file libunwind-ia64.h should be included.

               Linker-switch to add when building a program that does
              native (same platform) unwinding.

               Linker-switch to add when building a program that unwinds
              a program on platform PLAT.  For example, to
              (cross-)unwind an IA-64 program, the linker switch
              -lunwind-ia64 should be added. Note: multiple such
              switches may need to be specified for programs that can
              unwind programs on mul‐ tiple platforms.

It sounds like libunwind.so is just misbuilt on your platform. I just
checked libunwind.so on Debian's armel distro and it does explicitly
link to libgcc_s. I can't test that it works, of course, but at least
this problem isn't present.

If you want to supply a kludge-around for your broken platform, that'd
be awesome, but I don't think we should apply this patch, which runs
counter to the documentation and isn't needed by most people.

keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20140625/a75ec316/attachment-0001.sig>

More information about the xorg-devel mailing list