diff options
author | Ian Lance Taylor <iant@golang.org> | 2020-05-11 10:51:21 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2020-05-11 10:51:59 -0700 |
commit | 47f4703c33c4936fd423c2a1180b2de144115d3d (patch) | |
tree | acf2ecd80239085761d7f60772a6605fd1c90b77 /libbacktrace | |
parent | ed07d68141f88ba05189b748ea8935baca9b16b1 (diff) | |
download | gcc-47f4703c33c4936fd423c2a1180b2de144115d3d.zip gcc-47f4703c33c4936fd423c2a1180b2de144115d3d.tar.gz gcc-47f4703c33c4936fd423c2a1180b2de144115d3d.tar.bz2 |
libbacktrace: declare getpagesize if necessary
libbacktrace/
PR libbacktrace/95012
* configure.ac: Check for getpagesize declaration.
* mmap.c: Declare getpagesize if necessary.
* mmapio.c: Likewise.
Diffstat (limited to 'libbacktrace')
-rw-r--r-- | libbacktrace/ChangeLog | 10 | ||||
-rw-r--r-- | libbacktrace/Makefile.in | 2 | ||||
-rw-r--r-- | libbacktrace/config.h.in | 4 | ||||
-rwxr-xr-x | libbacktrace/configure | 10 | ||||
-rw-r--r-- | libbacktrace/configure.ac | 2 | ||||
-rw-r--r-- | libbacktrace/mmap.c | 4 | ||||
-rw-r--r-- | libbacktrace/mmapio.c | 4 |
7 files changed, 34 insertions, 2 deletions
diff --git a/libbacktrace/ChangeLog b/libbacktrace/ChangeLog index 88dee99..3767852 100644 --- a/libbacktrace/ChangeLog +++ b/libbacktrace/ChangeLog @@ -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. diff --git a/libbacktrace/Makefile.in b/libbacktrace/Makefile.in index 9381ade..3fbbb05 100644 --- a/libbacktrace/Makefile.in +++ b/libbacktrace/Makefile.in @@ -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.*$$'; \ diff --git a/libbacktrace/config.h.in b/libbacktrace/config.h.in index f6e3cba..2303880 100644 --- a/libbacktrace/config.h.in +++ b/libbacktrace/config.h.in @@ -12,6 +12,10 @@ /* 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 diff --git a/libbacktrace/configure b/libbacktrace/configure index 980c9d2..f6e35c2 100755 --- a/libbacktrace/configure +++ b/libbacktrace/configure @@ -13166,6 +13166,16 @@ fi 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 : diff --git a/libbacktrace/configure.ac b/libbacktrace/configure.ac index 6f241c5..7c073fa 100644 --- a/libbacktrace/configure.ac +++ b/libbacktrace/configure.ac @@ -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. diff --git a/libbacktrace/mmap.c b/libbacktrace/mmap.c index dd7d519..6c8bd5d 100644 --- a/libbacktrace/mmap.c +++ b/libbacktrace/mmap.c @@ -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. */ diff --git a/libbacktrace/mmapio.c b/libbacktrace/mmapio.c index 5dd3952..69cd806 100644 --- a/libbacktrace/mmapio.c +++ b/libbacktrace/mmapio.c @@ -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 |