libbacktrace: declare getpagesize if necessary
authorIan Lance Taylor <iant@golang.org>
Mon, 11 May 2020 17:51:21 +0000 (10:51 -0700)
committerIan Lance Taylor <iant@golang.org>
Mon, 11 May 2020 17:51:59 +0000 (10:51 -0700)
libbacktrace/
PR libbacktrace/95012
* configure.ac: Check for getpagesize declaration.
* mmap.c: Declare getpagesize if necessary.
* mmapio.c: Likewise.

libbacktrace/ChangeLog
libbacktrace/Makefile.in
libbacktrace/config.h.in
libbacktrace/configure
libbacktrace/configure.ac
libbacktrace/mmap.c
libbacktrace/mmapio.c

index 88dee9983d3b198c929e882b48b302d037c1ca46..37678526893e73d47f588005a13cd82c27f3e055 100644 (file)
@@ -1,3 +1,13 @@
+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.
index 9381adebebce7fb8fa20024639b497a6eca3a1d7..3fbbb05a1006b50fa398f09c5205aaece90b74da 100644 (file)
@@ -2266,7 +2266,7 @@ uninstall-am:
 
 
 @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.*$$'; \
index f6e3cba18d00e0a65a2d404a55d6ad5ba8d25208..2303880b9b871591811893e64ddb3137dda2376b 100644 (file)
 /* 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
index 980c9d2bf8940f6bd7b263445571becfce998bb5..f6e35c2edee824091f2abec204a4e5df6d5c7212 100755 (executable)
 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 :
index 6f241c5bac09fe49b04e745ae3e2ef0f7442178a..7c073facbd8ded7b25d7c2d3c3ebece42184b336 100644 (file)
@@ -376,7 +376,7 @@ if test "$have_fcntl" = "yes"; then
            [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.
index dd7d519cc56c7778b7693a26f8e9f000575ec64f..6c8bd5d4a194019051933a8235034bfc9050a068 100644 (file)
@@ -42,6 +42,10 @@ POSSIBILITY OF SUCH DAMAGE.  */
 #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.  */
index 5dd39525ba1ca35d67300bb0ebd3bda977895177..69cd8065a494ebac43f6b362560415de619486ee 100644 (file)
@@ -40,6 +40,10 @@ POSSIBILITY OF SUCH DAMAGE.  */
 #include "backtrace.h"
 #include "internal.h"
 
+#ifndef HAVE_DECL_GETPAGESIZE
+extern int getpagesize (void);
+#endif
+
 #ifndef MAP_FAILED
 #define MAP_FAILED ((void *)-1)
 #endif