undefined reference to 'munmap' and 'mmap' building tor on Windows
Using MinGW64 version 4.7.3-- thread model win32-- running naively (no cross-compile) inside msys2, I tried to build the tor-0.2.8.9 source downloaded from torproject.org.
While configuring the build, I noticed I had to build and install libevent, openssl, and zlib, which I did. After that Configure didn't fail anymore, and I proceeded to build tor by issuing "make". It seemed to go pretty well until the linker wanted to build tor.exe. It failed and complained about undefined references. Here is the output after issuing the make command again.
make: Entering directory
/e/users/v/Desktop/nfolder/tor-0.2.8.9' CC src/common/compat.o src/common/compat.c: In function 'tor_mmap_file': src/common/compat.c:273:3: warning: implicit declaration of function 'getpagesize' [-Wimplicit-function-declaration] AR src/common/libor.a CC src/common/src_common_libor_testing_a-compat.o src/common/compat.c: In function 'tor_mmap_file': src/common/compat.c:273:3: warning: implicit declaration of function 'getpagesize' [-Wimplicit-function-declaration] AR src/common/libor-testing.a CCLD src/or/tor.exe src/common/libor.a(compat.o): In function tor_munmap_file':
e:\users\v\Desktop\nfolder\tor-0.2.8.9/src/common/compat.c:312: undefined reference to
munmap' src/common/libor.a(compat.o): In function tor_mmap_file':
e:\users\v\Desktop\nfolder\tor-0.2.8.9/src/common/compat.c:285: undefined reference to
mmap' collect2.exe: error: ld returned 1 exit status make: *** [src/or/tor.exe] Error 1 make: Leaving directory /e/users/v/Desktop/nfolder/tor-0.2.8.9'
make: *** [all] Error 2
I have googled around and have not found an answer to solve this problem.