On Thu, 2011-08-18 at 21:20 -0700, Arun Sharma wrote:
> On Wed, Aug 17, 2011 at 7:43 AM, Sven Neumann <[email protected]> wrote:
> >> backtrace(3) is only needed for tests, as you noted. libunwind already 
> >> allows
> >> the backtrace(3) to come from libexecinfo, this was done for FreeBSD
> >> that also does not implement backtrace in libc. Requiring a library
> >> for testing is reasonable, IMO.
> >
> > Then perhaps the easiest solution is to add a configure option to skip
> > all tests. That would allow building on platforms where the tests don't
> > compile easily.
> 
> Is this the only build problem you had in the "tests" subdir or were
> there other breakages with your libc?

As far as I can see that was the only problem we had for the ARM
platform. And I was able to solve it by enabling backtrace support in
uCLibC. Still I would rather not enable backtrace support on the target
only to be able to compile a test program that is never going to be run.

> Does the patch below work for you?

No, I also had to make the build of 'test-varargs' depend on
HAVE_BACKTRACE. I'll attach the updated patch.


Thanks, Sven

diff --git a/configure.in b/configure.in
index c17b9da..0971bcb 100644
--- a/configure.in
+++ b/configure.in
@@ -276,6 +276,7 @@ PKG_MAINTAINER=pkg_maintainer
 old_LIBS="$LIBS"
 LIBS=""
 AC_SEARCH_LIBS(backtrace, execinfo)
+AM_CONDITIONAL(HAVE_BACKTRACE, test "x$ac_cv_search_backtrace" != xno)
 BACKTRACELIB="$LIBS"
 LIBS="$old_LIBS"
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 59ad3b3..8a298ca 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -46,9 +46,12 @@ endif #ARCH_IA64
 			test-async-sig test-flush-cache test-init-remote \
 			test-mem test-setjmp test-ptrace		 \
 			Ltest-nomalloc Ltest-nocalloc rs-race
- noinst_PROGRAMS_cdep = forker mapper test-ptrace-misc test-varargs	\
-			Gperf-simple Lperf-simple			\
-			Gperf-trace Lperf-trace
+ noinst_PROGRAMS_cdep = forker mapper test-ptrace-misc			 \
+			Gperf-simple Lperf-simple
+
+if HAVE_BACKTRACE
+ noinst_PROGRAMS_cdep += Gperf-trace Lperf-trace test-varargs
+endif
 
 if SUPPORT_CXX_EXCEPTIONS
  check_PROGRAMS_cdep += Ltest-cxx-exceptions
_______________________________________________
Libunwind-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/libunwind-devel

Reply via email to