GNOME Bugzilla – Bug 141256
-pthread is used for Interix, but we really need -D_REENTRANT/-lpthread
Last modified: 2018-05-24 10:31:38 UTC
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" ;;
Verified the behavior for version of gcc here (using -junk). GLIB_CHECK_COMPILE_WARNINGS() in acglib.m4 may be useful in coming up with a fix.
*** Bug 147413 has been marked as a duplicate of this bug. ***
hmm, what configure test are we talking about here ? The one starting with for flag in pthread pthreads; do ? If so, I don't fully understand the problem. I tried adding "junk" before pthread, and it still came up with -pthread, since it failed to link...
FYI: my patch in 652285 fixes this.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/20.