-pthread is used for Interix, but we really need -D_REENTRANT/-lpthread
Submitted by Todd Vierling
Link to original bug (#141256)
Description
For some reason, the test for use of -pthread in configure.in "succeeds" on Interix 3.5, even though the option is invalid:
===== $ gcc -v Reading specs from /opt/gcc.3.3/lib/gcc-lib/i586-pc-interix3/3.3/specs Configured with: : (reconfigured) : (reconfigured) /dev/fs/C/gnu2.intel/egcs.source//configure --verbose --prefix=/opt/gcc.3.3 --disable-shared --with-stabs --enable-nls --with-local-prefix=/opt/gcc.3.3 --with-gnu-as --with-gnu-ld --enable-targets=i586-pc-interix3 --enable-threads=posix Thread model: posix gcc version 3.3
$ touch foo.c $ gcc -pthread -c foo.c && echo success gcc: unrecognized option `-pthread' success
Sadly this means that the OS-specifics block which follows is not executed, so I have to hack in a separate case/esac outside that "if" block so that the invalid "-pthread" option is replaced. I'm not sure where the appropriate place is to fix this, but in any case, the proper pattern and settings which need to override the "-pthread" detection are:
-interix) G_THREAD_CFLAGS="-D_REENTRANT" G_THREAD_LIBS="-lpthread" ;;