when updating archlinux mingw-w64-gcc from 9.3.0 to 10.1.0 I noticed that libbacktrace fails to build because of an extra "-Werror" present during the compilation of libbacktrace that was not here for previous versions: libtool: compile: /home/xantares/projects/aur-scripts/mingw-w64-gcc/src/build-i686-w64-mingw32/./gcc/xgcc -B/home/xantares/projects/aur-scripts/mingw-w64-gcc/src/build-i686-w64-mingw32/./gcc/ -L/usr/i686-w64-mingw32/lib -L/usr/mingw/lib -isystem /usr/i686-w64-mingw32/include -isystem /usr/mingw/include -B/usr/i686-w64-mingw32/bin/ -B/usr/i686-w64-mingw32/lib/ -isystem /usr/i686-w64-mingw32/include -isystem /usr/i686-w64-mingw32/sys-include -DHAVE_CONFIG_H -I. -I/home/xantares/projects/aur-scripts/mingw-w64-gcc/src/gcc/libbacktrace -I /home/xantares/projects/aur-scripts/mingw-w64-gcc/src/gcc/libbacktrace/../include -I /home/xantares/projects/aur-scripts/mingw-w64-gcc/src/gcc/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=mmapio.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Werror -g -O2 -c /home/xantares/projects/aur-scripts/mingw-w64-gcc/src/gcc/libbacktrace/mmapio.c -DDLL_EXPORT -DPIC -o .libs/mmapio.o /home/xantares/projects/aur-scripts/mingw-w64-gcc/src/gcc/libbacktrace/mmapio.c: In function ‘backtrace_get_view’: /home/xantares/projects/aur-scripts/mingw-w64-gcc/src/gcc/libbacktrace/mmapio.c:69:14: error: implicit declaration of function ‘getpagesize’ [-Werror=implicit-function-declaration]
the full compilation script can be seen here: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=mingw-w64-gcc
Thanks for the bug report. I can't see any relevant change in libbacktrace. As far as I can tell the call to getpagesize has been there for a while, and the use of -Werror has been there for a while. Does mingw-w64-gcc have a getpagesize function? What header file declares it? Normally it is declared in <unistd.h>, but mmapio.c does #include that file.
mingw does not define getpagesize as far as I can tell with: $ grep -nr getpagesize /usr/i686-w64-mingw32/include/ but gcc seems to detect it (9.x and 10.x): checking for getpagesize... (cached) yes maybe it relies on its own provided getpagesize function: gcc/system.h:479:#if defined (HAVE_DECL_GETPAGESIZE) && !HAVE_DECL_GETPAGESIZE gcc/system.h:480:extern int getpagesize (void);
The master branch has been updated by Ian Lance Taylor <ian@gcc.gnu.org>: https://gcc.gnu.org/g:47f4703c33c4936fd423c2a1180b2de144115d3d commit r11-280-g47f4703c33c4936fd423c2a1180b2de144115d3d Author: Ian Lance Taylor <iant@golang.org> Date: Mon May 11 10:51:21 2020 -0700 libbacktrace: declare getpagesize if necessary libbacktrace/ PR libbacktrace/95012 * configure.ac: Check for getpagesize declaration. * mmap.c: Declare getpagesize if necessary. * mmapio.c: Likewise.
Thanks, should be fixed on master.