+2020-05-11 Ian Lance Taylor <iant@golang.org>
+
+ PR libbacktrace/95012
+ * configure.ac: Check for getpagesize declaration.
+ * mmap.c: Declare getpagesize if necessary.
+ * mmapio.c: Likewise.
+ * configure: Regenerate.
+ * config.h.in: Regenerate.
+ * Makefile.in: Regenerate.
+
2020-05-09 Roland McGrath <mcgrathr@google.com>
* elf.c (elf_add): Bail early if there are no section headers at all.
@HAVE_DSYMUTIL_TRUE@%.dSYM: %
-@HAVE_DSYMUTIL_TRUE@ $(DSYMUTIL) %<
+@HAVE_DSYMUTIL_TRUE@ $(DSYMUTIL) $<
@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@elf_for_test.c: elf.c
@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@ SEARCH='^#define SYSTEM_BUILD_ID_DIR.*$$'; \
/* Define to 1 if you have the `clock_gettime' function. */
#undef HAVE_CLOCK_GETTIME
+/* Define to 1 if you have the declaration of `getpagesize', and to 0 if you
+ don't. */
+#undef HAVE_DECL_GETPAGESIZE
+
/* Define to 1 if you have the declaration of `strnlen', and to 0 if you
don't. */
#undef HAVE_DECL_STRNLEN
cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_STRNLEN $ac_have_decl
_ACEOF
+ac_fn_c_check_decl "$LINENO" "getpagesize" "ac_cv_have_decl_getpagesize" "$ac_includes_default"
+if test "x$ac_cv_have_decl_getpagesize" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETPAGESIZE $ac_have_decl
+_ACEOF
for ac_func in lstat readlink
do :
[Define to 1 if you have the fcntl function])
fi
-AC_CHECK_DECLS(strnlen)
+AC_CHECK_DECLS([strnlen, getpagesize])
AC_CHECK_FUNCS(lstat readlink)
# Check for getexecname function.
#include "backtrace.h"
#include "internal.h"
+#ifndef HAVE_DECL_GETPAGESIZE
+extern int getpagesize (void);
+#endif
+
/* Memory allocation on systems that provide anonymous mmap. This
permits the backtrace functions to be invoked from a signal
handler, assuming that mmap is async-signal safe. */
#include "backtrace.h"
#include "internal.h"
+#ifndef HAVE_DECL_GETPAGESIZE
+extern int getpagesize (void);
+#endif
+
#ifndef MAP_FAILED
#define MAP_FAILED ((void *)-1)
#endif