Qt open source compile fails on gmake
-
I am building qt open source to be used for cross-compile. The configure command works fine, and gmake starts but fails as shown below. This makes no sense since the pthread.h is included and defines the macro being sought. There must be something else going on. Can someone suggest how to fix this?
gmake[3]: Entering directory '/root/raspi/qt-build/qtbase/src/3rdparty/pcre2' /root/raspi/arm-gnu-toolchain-12.2.mpacbti-rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-gcc -c -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 --sysroot=/root/raspi/sysroot -O2 -fPIC -std=gnu11 -fvisibility=hidden -w -fno-exceptions -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS -DPCRE2_CODE_UNIT_WIDTH=16 -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DHAVE_CONFIG_H -DQT_NO_DYNAMIC_CAST -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I/root/raspi/qt-everywhere-src-5.15.9/qtbase/src/3rdparty/pcre2 -I. -I/root/raspi/qt-everywhere-src-5.15.9/qtbase/src/3rdparty/pcre2/src -I/root/raspi/qt-everywhere-src-5.15.9/qtbase/mkspecs/devices/linux-rasp-pi3-g++ -o .obj/pcre2_jit_compile.o /root/raspi/qt-everywhere-src-5.15.9/qtbase/src/3rdparty/pcre2/src/pcre2_jit_compile.c In file included from /root/raspi/qt-everywhere-src-5.15.9/qtbase/src/3rdparty/pcre2/src/sljit/sljitLir.c:260, from /root/raspi/qt-everywhere-src-5.15.9/qtbase/src/3rdparty/pcre2/src/pcre2_jit_compile.c:79: /root/raspi/qt-everywhere-src-5.15.9/qtbase/src/3rdparty/pcre2/src/sljit/sljitUtils.c:41:41: error: 'PTHREAD_MUTEX_INITIALIZER' undeclared here (not in a function) 41 | static pthread_mutex_t allocator_lock = PTHREAD_MUTEX_INITIALIZER; | ^~~~~~~~~~~~~~~~~~~~~~~~~ /root/raspi/qt-everywhere-src-5.15.9/qtbase/src/3rdparty/pcre2/src/sljit/sljitUtils.c:77:10: fatal error: sys/mman.h: No such file or directory 77 | #include <sys/mman.h> | ^~~~~~~~~~~~ compilation terminated.A couple of lines from the source file causing the first error are as follows:
#include <pthread.h> static pthread_mutex_t allocator_lock = PTHREAD_MUTEX_INITIALIZER;So the error makes no sense to me. How can this fail? And the second error makes no sense since the mman.h file exists where it is supposed to.