After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 141256 - -pthread is used for Interix, but we really need -D_REENTRANT/-lpthread
-pthread is used for Interix, but we really need -D_REENTRANT/-lpthread
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gthread
unspecified
Other other
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
: 147413 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-04-28 02:56 UTC by Todd Vierling
Modified: 2018-05-24 10:31 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Todd Vierling 2004-04-28 02:56:02 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"
    ;;
Comment 1 Owen Taylor 2004-07-10 15:29:57 UTC
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.
Comment 2 Owen Taylor 2004-07-12 14:20:38 UTC
*** Bug 147413 has been marked as a duplicate of this bug. ***
Comment 3 Matthias Clasen 2005-07-26 03:18:37 UTC
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...

Comment 4 Markus Duft 2011-06-10 13:03:19 UTC
FYI: my patch in 652285 fixes this.
Comment 5 GNOME Infrastructure Team 2018-05-24 10:31:38 UTC
-- 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.