Glib failing thread test

IRIX/Nekoware development, porting and related topics.
Forum rules
Any posts concerning pirated software or offering to buy/sell/trade commercial software are subject to removal.
User avatar
praetor242
Posts: 202
Joined: Thu Feb 23, 2017 5:41 pm
Location: Arlington, TX

Glib failing thread test

Unread postby praetor242 » Thu Apr 13, 2017 12:25 pm

I'm trying to get glib 2.52 compiled, but it fails one of it's tests when it configures. It's a test looking for pthread.h. I've tried passing -lpthread to gcc and --enable-thread=posix to ./configure, but no love. I talked to the glib devs on IRC (which are really nice guys) and they pointed me to the particular test that is failing.

https://github.com/GNOME/glib/blob/master/configure.ac#L1852-L1865

But they said I'd have to modify the test to pass on IRIX, but C is not my best language :(

Any ideas how to get it to pass?
Image - trajan - R5000 180Mhz - 128 MB RAM - 147GB HDD
Image - hadrian - R5000 180Mhz - 128 MB RAM - 76 GB HDD

User avatar
foetz
Moderator
Moderator
Posts: 6529
Joined: Mon Apr 14, 2003 4:34 am
Contact:

Re: Glib failing thread test

Unread postby foetz » Thu Apr 13, 2017 12:42 pm

look into configure.log for the exact error

User avatar
praetor242
Posts: 202
Joined: Thu Feb 23, 2017 5:41 pm
Location: Arlington, TX

Re: Glib failing thread test

Unread postby praetor242 » Thu Apr 13, 2017 12:47 pm

This is where it fails in ./configure

#include <pthread.h>
| int
| main ()
| {
| pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
| ;
| return 0;
| }
configure:26696: result: none available
configure:26698: error: No thread implementation found.
Image - trajan - R5000 180Mhz - 128 MB RAM - 147GB HDD
Image - hadrian - R5000 180Mhz - 128 MB RAM - 76 GB HDD

User avatar
foetz
Moderator
Moderator
Posts: 6529
Joined: Mon Apr 14, 2003 4:34 am
Contact:

Re: Glib failing thread test

Unread postby foetz » Thu Apr 13, 2017 5:49 pm

check the compile line. it's likely using the wrong libs

User avatar
praetor242
Posts: 202
Joined: Thu Feb 23, 2017 5:41 pm
Location: Arlington, TX

Re: Glib failing thread test

Unread postby praetor242 » Thu Apr 13, 2017 7:25 pm

It says it's using pthread.h, and there is a pthread.h in /usr/include. Not sure what I should change it to.
Image - trajan - R5000 180Mhz - 128 MB RAM - 147GB HDD
Image - hadrian - R5000 180Mhz - 128 MB RAM - 76 GB HDD

User avatar
foetz
Moderator
Moderator
Posts: 6529
Joined: Mon Apr 14, 2003 4:34 am
Contact:

Re: Glib failing thread test

Unread postby foetz » Thu Apr 13, 2017 8:52 pm

nothing, have a look at the configure.log again and search for the link line

jpstewart
Donor
Donor
Posts: 427
Joined: Tue Sep 21, 2010 3:31 pm
Location: Southwestern Ontario, Canada

Re: Glib failing thread test

Unread postby jpstewart » Fri Apr 14, 2017 1:11 pm

I don't think the configure script will figure out the right libraries/flags needed for pthreads on IRIX. Rather than trying to patch the configure script, I'd just manually add '-lpthread' to either LIBS or LDFLAGS before configuring:

Code: Select all

LIBS="$LIBS -lpthread" ./configure ...

(Of course, exact syntax will depend on which shell you're using.)

Or, as foetz suggests, post the exact compile/link line that's failing and we'll help you diagnose it.
:Indigo2IMP: :Octane: :Indigo: :O3x0:
Sun SPARCstation 20, Blade 2500, T5240
HP C8000

User avatar
praetor242
Posts: 202
Joined: Thu Feb 23, 2017 5:41 pm
Location: Arlington, TX

Re: Glib failing thread test

Unread postby praetor242 » Sun Apr 16, 2017 12:50 pm

I have to add "-L/usr/local/lib" or else configure doesn't see gettext. But when I add "-lpthread" to LDFLAGS, it no longer sees gettext. Not sure why :( this is so aggravating. I know what the fix for this is, but it's not cooperating D:
Image - trajan - R5000 180Mhz - 128 MB RAM - 147GB HDD
Image - hadrian - R5000 180Mhz - 128 MB RAM - 76 GB HDD

User avatar
praetor242
Posts: 202
Joined: Thu Feb 23, 2017 5:41 pm
Location: Arlington, TX

Re: Glib failing thread test

Unread postby praetor242 » Mon Apr 17, 2017 6:12 pm

I've put the full config.log on github for you guys to look at.

It's at https://gist.github.com/gwfisher/e1426d7bd9795195dab88596657b5cc2

I've tried adding -lpthread to LDFLAGS, and still no love :( I've tried it with MIPSPro and gcc 4.7 and it keeps telling me it can't find a threading implementation. Not sure.
Image - trajan - R5000 180Mhz - 128 MB RAM - 147GB HDD
Image - hadrian - R5000 180Mhz - 128 MB RAM - 76 GB HDD

User avatar
foetz
Moderator
Moderator
Posts: 6529
Joined: Mon Apr 14, 2003 4:34 am
Contact:

Re: Glib failing thread test

Unread postby foetz » Mon Apr 17, 2017 8:02 pm

that's the gcc log but the mipspro log would be the interesting one

User avatar
praetor242
Posts: 202
Joined: Thu Feb 23, 2017 5:41 pm
Location: Arlington, TX

Re: Glib failing thread test

Unread postby praetor242 » Mon Apr 17, 2017 8:05 pm

I can post a mipspro one, but it gives a ton of warnings.
Image - trajan - R5000 180Mhz - 128 MB RAM - 147GB HDD
Image - hadrian - R5000 180Mhz - 128 MB RAM - 76 GB HDD

User avatar
praetor242
Posts: 202
Joined: Thu Feb 23, 2017 5:41 pm
Location: Arlington, TX

Re: Glib failing thread test

Unread postby praetor242 » Mon Apr 17, 2017 8:56 pm

Here is the MIPSPro version. Configure runs fine with MIPSPro. It finds the threading libraries, but when you gmake it, it won't compile.

https://gist.github.com/gwfisher/b1451516cd8f34b5358630ef6f5411fd
Image - trajan - R5000 180Mhz - 128 MB RAM - 147GB HDD
Image - hadrian - R5000 180Mhz - 128 MB RAM - 76 GB HDD

User avatar
foetz
Moderator
Moderator
Posts: 6529
Joined: Mon Apr 14, 2003 4:34 am
Contact:

Re: Glib failing thread test

Unread postby foetz » Tue Apr 18, 2017 11:09 am

praetor242 wrote:Here is the MIPSPro version. Configure runs fine with MIPSPro. It finds the threading libraries, but when you gmake it, it won't compile.

okay then we'd need to see those errors

jpstewart
Donor
Donor
Posts: 427
Joined: Tue Sep 21, 2010 3:31 pm
Location: Southwestern Ontario, Canada

Re: Glib failing thread test

Unread postby jpstewart » Tue Apr 18, 2017 12:58 pm

I'm not surprised current GLib won't build with MIPS Pro. I encountered problems three years ago with GLib 2.31 (and up). I mentioned it briefly in an old post. Personally, I wouldn't bother trying to build GLib with MIPS Pro anymore, to be frank.

However, it should work with GCC. The log from praetor242 shows GCC having "unknown type name" errors in GCC's own include-fixed/pthread.h header. The specific error message suggests that praetor242 is using a GCC package (with "fixed" headers) from a newer version of IRIX than what is installed and running on his machine. Those missing types are not defined on my 6.5.22 machines, but are defined on the one that's running 6.5.29. (I don't know exactly where in between they were added.) So it looks to me like praetor242 is (inadvertently) mixing headers from two IRIX versions: his own, and those on which GCC was built.

That can be fixed by upgrading the build system to the same version of IRIX on which GCC was compiled, or compiling his own GCC on his current version of IRIX. If one wants to get really creative, it's theoretically possible to alter the installed GCC "fixed" headers to match the running system, but who knows what else that might break.

In short, it's just a mis-match between two versions of pthread.h.
:Indigo2IMP: :Octane: :Indigo: :O3x0:
Sun SPARCstation 20, Blade 2500, T5240
HP C8000

User avatar
praetor242
Posts: 202
Joined: Thu Feb 23, 2017 5:41 pm
Location: Arlington, TX

Re: Glib failing thread test

Unread postby praetor242 » Tue Apr 18, 2017 3:23 pm

That makes sense jpstewart. I'll compile my own GCC. My O2 is running 6.5.22. But yeah, no amount of futzing with MIPSPro will get it to work. I talked to the glib devs and they said it's best to just build it with gcc (and then gave me a million reasons why)

Thanks!
Image - trajan - R5000 180Mhz - 128 MB RAM - 147GB HDD
Image - hadrian - R5000 180Mhz - 128 MB RAM - 76 GB HDD


Return to “SGI: Development”

Who is online

Users browsing this forum: No registered users and 1 guest