Bug 95012 - [mingw/gcc10.1] mmapio.c:69:14: error: implicit declaration of function ‘getpagesize’
Summary: [mingw/gcc10.1] mmapio.c:69:14: error: implicit declaration of function ‘getp...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libbacktrace (show other bugs)
Version: 10.1.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-08 14:53 UTC by xantares09
Modified: 2020-05-11 17:55 UTC (History)
2 users (show)

See Also:
Host: i686-w64-mingw32
Target: i686-w64-mingw32
Build: x86_64-pc-linux-gnu
Known to work: 9.3.0
Known to fail: 10.1.0
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description xantares09 2020-05-08 14:53:10 UTC
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]
Comment 1 xantares09 2020-05-08 14:56:38 UTC
the full compilation script can be seen here:
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=mingw-w64-gcc
Comment 2 Ian Lance Taylor 2020-05-10 03:46:50 UTC
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.
Comment 3 xantares09 2020-05-10 07:08:29 UTC
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);
Comment 4 GCC Commits 2020-05-11 17:52:09 UTC
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.
Comment 5 Ian Lance Taylor 2020-05-11 17:55:38 UTC
Thanks, should be fixed on master.