Hi all, I'm currently trying to build an ARM cross-compiler that supports OpenMP under Cygwin (release version 1.5.25-15). For this I took the gcc-4.2.4 and configured the system in the following way (see the whole build approach below): ../gcc-4.2.4/configure --target=arm-elf --prefix=/usr/cross/ --with-gnu-as --with-gnu-ld --with-newlib --with-headers=/usr/cross/arm-elf/include --enable-libgomp Unfortunately the build stops with the following error message (BTW: The same error occurs taking the latest gcc-4.3.2): [...] checking what to include in gstdint.h... stdint.h (already complete) configure: error: Pthreads are required to build libgomp make[1]: *** [configure-target-libgomp] Error 1 Therefore I tried the '--enable-threads=lib' option whereas I first took '--enable-threads=win32' and then alternatively '--enable-threads=posix'. But both options ran into errors with the "gthr-win32.h" and the "gthr-posix.h" respectively (see details below). I'd be thankful for any hint I can get to make the compiler run! Thanks in advance! BR, Sebastian #################################################################################### ARM cross-compiler build approach: mkdir cross cd /usr/cross mkdir build-binutils mkdir build-gcc mkdir build-newlib export TARGET=arm-elf export PREFIX=/usr/cross export PATH=$PATH:$PREFIX/bin cd build-binutils ../binutils-2.18/configure --target=$TARGET --prefix=$PREFIX make all install cd build-gcc ../gcc-4.2.4/configure --target=$TARGET --prefix=$PREFIX --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --with-newlib --without-headers --disable-shared make all-gcc install-gcc cd build-newlib ../newlib-1.16.0/configure --target=$TARGET --prefix=$PREFIX make all install cd build-gcc ../gcc-4.2.4/configure --target=$TARGET --prefix=$PREFIX --with-gnu-as --with-gnu-ld --with-newlib --with-headers=/usr/cross/arm-elf/include --enable-libgomp [alternatively: ../gcc-4.2.4/configure --target=$TARGET --prefix=$PREFIX --with-gnu-as --with-gnu-ld --with-newlib --with-headers=/usr/cross/arm-elf/include --enable-libgomp --enable-threads=win32 or ../gcc-4.2.4/configure --target=$TARGET --prefix=$PREFIX --with-gnu-as --with-gnu-ld --with-newlib --with-headers=/usr/cross/arm-elf/include --enable-libgomp --enable-threads=posix] make all install #################################################################################### error with '--enable-threads=posix': [...] /usr/cross/build-gcc/./gcc/xgcc -B/usr/cross/build-gcc/./gcc/ -B/usr/cross/arm-elf/bin/ -B/usr/cross/arm-elf/lib/ -isystem /usr/cross/arm-elf/include -isystem /usr/cross/arm-elf/sys-include -O2 -O2 -g -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fno-inline -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I../../gcc-4.2.4/gcc -I../../gcc-4.2.4/gcc/. -I../../gcc-4.2.4/gcc/../include -I../../gcc-4.2.4/gcc/../libcpp/include -I../../gcc-4.2.4/gcc/../libdecnumber -I../libdecnumber -fexceptions -c ../../gcc-4.2.4/gcc/unwind-dw2.c -o libgcc/./unwind-dw2.o In file included from ./gthr-default.h:1, from ../../gcc-4.2.4/gcc/gthr.h:114, from ../../gcc-4.2.4/gcc/unwind-dw2.c:42: ../../gcc-4.2.4/gcc/gthr-posix.h:46: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__gthread_key_t' ../../gcc-4.2.4/gcc/gthr-posix.h:47: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__gthread_once_t' ../../gcc-4.2.4/gcc/gthr-posix.h:48: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__gthread_mutex_t' ../../gcc-4.2.4/gcc/gthr-posix.h:49: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__gthread_recursive_mutex_t' ../../gcc-4.2.4/gcc/gthr-posix.h:92: error: 'pthread_once' undeclared here (not in a function) ../../gcc-4.2.4/gcc/gthr-posix.h:92: warning: type defaults to 'int' in declaration of '__gthrw_pthread_once' ../../gcc-4.2.4/gcc/gthr-posix.h:93: error: 'pthread_getspecific' undeclared here (not in a function) ../../gcc-4.2.4/gcc/gthr-posix.h:93: warning: type defaults to 'int' in declaration of '__gthrw_pthread_getspecific' ../../gcc-4.2.4/gcc/gthr-posix.h:94: error: 'pthread_setspecific' undeclared here (not in a function) ../../gcc-4.2.4/gcc/gthr-posix.h:94: warning: type defaults to 'int' in declaration of '__gthrw_pthread_setspecific' ../../gcc-4.2.4/gcc/gthr-posix.h:95: error: 'pthread_create' undeclared here (not in a function) ../../gcc-4.2.4/gcc/gthr-posix.h:95: warning: type defaults to 'int' in declaration of '__gthrw_pthread_create' ../../gcc-4.2.4/gcc/gthr-posix.h:96: error: 'pthread_cancel' undeclared here (not in a function) ../../gcc-4.2.4/gcc/gthr-posix.h:96: warning: type defaults to 'int' in declaration of '__gthrw_pthread_cancel' ../../gcc-4.2.4/gcc/gthr-posix.h:97: error: 'pthread_mutex_lock' undeclared here (not in a function) ../../gcc-4.2.4/gcc/gthr-posix.h:97: warning: type defaults to 'int' in declaration of '__gthrw_pthread_mutex_lock' ../../gcc-4.2.4/gcc/gthr-posix.h:98: error: 'pthread_mutex_trylock' undeclared here (not in a function) ../../gcc-4.2.4/gcc/gthr-posix.h:98: warning: type defaults to 'int' in declaration of '__gthrw_pthread_mutex_trylock' ../../gcc-4.2.4/gcc/gthr-posix.h:99: error: 'pthread_mutex_unlock' undeclared here (not in a function) ../../gcc-4.2.4/gcc/gthr-posix.h:99: warning: type defaults to 'int' in declaration of '__gthrw_pthread_mutex_unlock' ../../gcc-4.2.4/gcc/gthr-posix.h:100: error: 'pthread_mutex_init' undeclared here (not in a function) ../../gcc-4.2.4/gcc/gthr-posix.h:100: warning: type defaults to 'int' in declaration of '__gthrw_pthread_mutex_init' ../../gcc-4.2.4/gcc/gthr-posix.h:103: error: 'pthread_key_create' undeclared here (not in a function) ../../gcc-4.2.4/gcc/gthr-posix.h:103: warning: type defaults to 'int' in declaration of '__gthrw_pthread_key_create' ../../gcc-4.2.4/gcc/gthr-posix.h:104: error: 'pthread_key_delete' undeclared here (not in a function) ../../gcc-4.2.4/gcc/gthr-posix.h:104: warning: type defaults to 'int' in declaration of '__gthrw_pthread_key_delete' ../../gcc-4.2.4/gcc/gthr-posix.h:105: error: 'pthread_mutexattr_init' undeclared here (not in a function) ../../gcc-4.2.4/gcc/gthr-posix.h:105: warning: type defaults to 'int' in declaration of '__gthrw_pthread_mutexattr_init' ../../gcc-4.2.4/gcc/gthr-posix.h:106: error: 'pthread_mutexattr_settype' undeclared here (not in a function) ../../gcc-4.2.4/gcc/gthr-posix.h:106: warning: type defaults to 'int' in declaration of '__gthrw_pthread_mutexattr_settype' ../../gcc-4.2.4/gcc/gthr-posix.h:107: error: 'pthread_mutexattr_destroy' undeclared here (not in a function) ../../gcc-4.2.4/gcc/gthr-posix.h:107: warning: type defaults to 'int' in declaration of '__gthrw_pthread_mutexattr_destroy' ../../gcc-4.2.4/gcc/gthr-posix.h:572: error: expected ')' before '*' token ../../gcc-4.2.4/gcc/gthr-posix.h:581: error: expected ')' before '*' token ../../gcc-4.2.4/gcc/gthr-posix.h:587: error: expected ')' before 'key' ../../gcc-4.2.4/gcc/gthr-posix.h:593: error: expected ')' before 'key' ../../gcc-4.2.4/gcc/gthr-posix.h:599: error: expected ')' before 'key' ../../gcc-4.2.4/gcc/gthr-posix.h:605: error: expected ')' before '*' token ../../gcc-4.2.4/gcc/gthr-posix.h:614: error: expected ')' before '*' token ../../gcc-4.2.4/gcc/gthr-posix.h:623: error: expected ')' before '*' token ../../gcc-4.2.4/gcc/gthr-posix.h:633: error: expected ')' before '*' token ../../gcc-4.2.4/gcc/gthr-posix.h:654: error: expected ')' before '*' token ../../gcc-4.2.4/gcc/gthr-posix.h:660: error: expected ')' before '*' token ../../gcc-4.2.4/gcc/gthr-posix.h:666: error: expected ')' before '*' token make[3]: *** [libgcc/./unwind-dw2.o] Error 1 make[3]: Leaving directory `/usr/cross/build-gcc/gcc' make[2]: *** [stmp-multilib] Error 2 make[2]: Leaving directory `/usr/cross/build-gcc/gcc' make[1]: *** [all-gcc] Error 2 make[1]: Leaving directory `/usr/cross/build-gcc' make: *** [all] Error 2 #################################################################################### error with '--enable-threads=win32': [...] /usr/cross/build-gcc/./gcc/xgcc -B/usr/cross/build-gcc/./gcc/ -B/usr/cross/arm-elf/bin/ -B/usr/cross/arm-elf/lib/ -isystem /usr/cross/arm-elf/include -isystem /usr/cross/arm-elf/sys-include -O2 -O2 -g -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fno-inline -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I../../gcc-4.2.4/gcc -I../../gcc-4.2.4/gcc/. -I../../gcc-4.2.4/gcc/../include -I../../gcc-4.2.4/gcc/../libcpp/include -I../../gcc-4.2.4/gcc/../libdecnumber -I../libdecnumber -fexceptions -c ../../gcc-4.2.4/gcc/unwind-dw2.c -o libgcc/./unwind-dw2.o In file included from ./gthr-default.h:1, from ../../gcc-4.2.4/gcc/gthr.h:114, from ../../gcc-4.2.4/gcc/unwind-dw2.c:42: ../../gcc-4.2.4/gcc/gthr-win32.h:528:21: error: windows.h: No such file or directory In file included from ./gthr-default.h:1, from ../../gcc-4.2.4/gcc/gthr.h:114, from ../../gcc-4.2.4/gcc/unwind-dw2.c:42: ../../gcc-4.2.4/gcc/gthr-win32.h: In function '__gthread_once': ../../gcc-4.2.4/gcc/gthr-win32.h:541: warning: implicit declaration of function 'InterlockedIncrement' ../../gcc-4.2.4/gcc/gthr-win32.h:544: error: 'TRUE' undeclared (first use in this function) ../../gcc-4.2.4/gcc/gthr-win32.h:544: error: (Each undeclared identifier is reported only once ../../gcc-4.2.4/gcc/gthr-win32.h:544: error: for each function it appears in.) ../../gcc-4.2.4/gcc/gthr-win32.h:554: warning: implicit declaration of function 'Sleep' ../../gcc-4.2.4/gcc/gthr-win32.h: In function '__gthread_key_create': ../../gcc-4.2.4/gcc/gthr-win32.h:568: error: 'DWORD' undeclared (first use in this function) ../../gcc-4.2.4/gcc/gthr-win32.h:568: error: expected ';' before 'tls_index' ../../gcc-4.2.4/gcc/gthr-win32.h:569: error: 'tls_index' undeclared (first use in this function) ../../gcc-4.2.4/gcc/gthr-win32.h:579: warning: implicit declaration of function 'GetLastError' ../../gcc-4.2.4/gcc/gthr-win32.h:565: warning: unused parameter 'dtor' ../../gcc-4.2.4/gcc/gthr-win32.h: In function '__gthread_key_delete': ../../gcc-4.2.4/gcc/gthr-win32.h:586: warning: implicit declaration of function 'TlsFree' ../../gcc-4.2.4/gcc/gthr-win32.h: In function '__gthread_getspecific': ../../gcc-4.2.4/gcc/gthr-win32.h:592: error: 'DWORD' undeclared (first use in this function) ../../gcc-4.2.4/gcc/gthr-win32.h:592: error: expected ';' before 'lasterror' ../../gcc-4.2.4/gcc/gthr-win32.h:595: error: 'lasterror' undeclared (first use in this function) ../../gcc-4.2.4/gcc/gthr-win32.h:597: warning: implicit declaration of function 'TlsGetValue' ../../gcc-4.2.4/gcc/gthr-win32.h:597: warning: assignment makes pointer from integer without a cast ../../gcc-4.2.4/gcc/gthr-win32.h:599: warning: implicit declaration of function 'SetLastError' ../../gcc-4.2.4/gcc/gthr-win32.h: In function '__gthread_setspecific': ../../gcc-4.2.4/gcc/gthr-win32.h:607: warning: implicit declaration of function 'TlsSetValue' ../../gcc-4.2.4/gcc/gthr-win32.h: In function '__gthread_mutex_init_function': ../../gcc-4.2.4/gcc/gthr-win32.h:614: warning: implicit declaration of function 'CreateSemaphore' ../../gcc-4.2.4/gcc/gthr-win32.h:614: warning: assignment makes pointer from integer without a cast ../../gcc-4.2.4/gcc/gthr-win32.h: In function '__gthread_mutex_lock': ../../gcc-4.2.4/gcc/gthr-win32.h:625: warning: implicit declaration of function 'WaitForSingleObject' ../../gcc-4.2.4/gcc/gthr-win32.h:625: error: 'INFINITE' undeclared (first use in this function) ../../gcc-4.2.4/gcc/gthr-win32.h:625: error: 'WAIT_OBJECT_0' undeclared (first use in this function) ../../gcc-4.2.4/gcc/gthr-win32.h:631: warning: implicit declaration of function 'InterlockedDecrement' ../../gcc-4.2.4/gcc/gthr-win32.h: In function '__gthread_mutex_trylock': ../../gcc-4.2.4/gcc/gthr-win32.h:645: warning: implicit declaration of function 'InterlockedCompareExchange' ../../gcc-4.2.4/gcc/gthr-win32.h: In function '__gthread_mutex_unlock': ../../gcc-4.2.4/gcc/gthr-win32.h:659: warning: implicit declaration of function 'ReleaseSemaphore' ../../gcc-4.2.4/gcc/gthr-win32.h: In function '__gthread_recursive_mutex_init_function': ../../gcc-4.2.4/gcc/gthr-win32.h:670: warning: assignment makes pointer from integer without a cast ../../gcc-4.2.4/gcc/gthr-win32.h: In function '__gthread_recursive_mutex_lock': ../../gcc-4.2.4/gcc/gthr-win32.h:678: error: 'DWORD' undeclared (first use in this function) ../../gcc-4.2.4/gcc/gthr-win32.h:678: error: expected ';' before 'me' ../../gcc-4.2.4/gcc/gthr-win32.h:682: error: 'me' undeclared (first use in this function) ../../gcc-4.2.4/gcc/gthr-win32.h:689: error: 'INFINITE' undeclared (first use in this function) ../../gcc-4.2.4/gcc/gthr-win32.h:689: error: 'WAIT_OBJECT_0' undeclared (first use in this function) ../../gcc-4.2.4/gcc/gthr-win32.h: In function '__gthread_recursive_mutex_trylock': ../../gcc-4.2.4/gcc/gthr-win32.h:710: error: 'DWORD' undeclared (first use in this function) ../../gcc-4.2.4/gcc/gthr-win32.h:710: error: expected ';' before 'me' ../../gcc-4.2.4/gcc/gthr-win32.h:714: error: 'me' undeclared (first use in this function) make[3]: *** [libgcc/./unwind-dw2.o] Error 1 make[3]: Leaving directory `/usr/cross/build-gcc/gcc' make[2]: *** [stmp-multilib] Error 2 make[2]: Leaving directory `/usr/cross/build-gcc/gcc' make[1]: *** [all-gcc] Error 2 make[1]: Leaving directory `/usr/cross/build-gcc' make: *** [all] Error 2