On Tue, Mar 22, 2011 at 08:51:22AM -0700, Arun Sharma wrote: > On Tue, Mar 22, 2011 at 8:04 AM, Lassi Tuura <[email protected]> wrote: > > > +/* Initialise memory validation method. On linux kernels <2.6.21, > > + mincore() returns incorrect value for MAP_PRIVATE mappings, > > + such as stacks. If mincore() was available at compile time, > > + check if we can actually use it. If not, use msync() instead. */ > > +PROTECTED void > > +tdep_init_mem_validate (void) > > +{ > > +#ifdef HAVE_MINCORE > > + unsigned char present; > > + if (mincore (&present, 1, &present) == 0) > > + { > > + Debug(1, "using mincore to validate memory\n"); > > + mem_validate_func = mincore_validate; > > + } > > You might want to write to "present" to improve the chances that > mincore() finds the page in core. Otherwise looks good. Konstantin: > hope this doesn't break FreeBSD.
It looks so, I will retest after the change is committed. Currently, to get libunwind to build and package on FreeBSD, I need the following change: commit e7e3f15af5125a9dd0e95f4a1f31e7cb31001bbb Author: Konstantin Belousov <[email protected]> Date: Tue Mar 22 21:26:31 2011 +0200 Fix build and distribution on the FreeBSD. diff --git a/configure.in b/configure.in index c0cdd9c..db664c9 100644 --- a/configure.in +++ b/configure.in @@ -263,6 +263,12 @@ PKG_MINOR=pkg_minor PKG_EXTRA=pkg_extra PKG_MAINTAINER=pkg_maintainer +old_LIBS="$LIBS" +LIBS="" +AC_SEARCH_LIBS(backtrace, execinfo) +BACKTRACELIB="$LIBS" +LIBS="$old_LIBS" + AC_SUBST(build_arch) AC_SUBST(target_os) AC_SUBST(arch) @@ -276,6 +282,7 @@ AC_SUBST(PKG_MAINTAINER) AC_SUBST(enable_cxx_exceptions) AC_SUBST(enable_debug_frame) AC_SUBST(DLLIB) +AC_SUBST(BACKTRACELIB) AC_CONFIG_FILES(Makefile src/Makefile tests/Makefile tests/check-namespace.sh doc/Makefile doc/common.tex include/libunwind-common.h) diff --git a/src/Makefile.am b/src/Makefile.am index 7c1505a..68470ea 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -488,6 +488,7 @@ EXTRA_DIST = $(libunwind_la_SOURCES_arm) \ $(libunwind_la_SOURCES_ia64) \ $(libunwind_la_SOURCES_mips) \ $(libunwind_la_SOURCES_x86) \ + $(libunwind_la_SOURCES_os_freebsd) \ $(libunwind_la_SOURCES_os_linux) \ $(libunwind_la_SOURCES_os_hpux) \ $(libunwind_la_SOURCES_common) \ diff --git a/tests/Makefile.am b/tests/Makefile.am index 11f4f30..383f096 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -133,6 +133,7 @@ test_proc_info_LDADD = $(LIBUNWIND) test_static_link_LDADD = $(LIBUNWIND) test_strerror_LDADD = $(LIBUNWIND) rs_race_LDADD = $(LIBUNWIND) -lpthread +test_varargs_LDADD = @BACKTRACELIB@ Gtest_bt_LDADD = $(LIBUNWIND) Gtest_concurrent_LDADD = $(LIBUNWIND) -lpthread
pgpOlFLMoRQ5V.pgp
Description: PGP signature
_______________________________________________ Libunwind-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/libunwind-devel
