Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
broken pthread
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
zephred
n00b
n00b


Joined: 09 Nov 2002
Posts: 43
Location: Paris - France

PostPosted: Wed Jan 08, 2003 6:36 pm    Post subject: broken pthread Reply with quote

Hello all,

The pthread library does not seem to work with gcc version 3.2.1 and glibc-2.3.1-r2. This simple program (used in some configure test):
Code:

#include <pthread.h>
void* func(void *arg) { return arg; }
int main(void) { pthread_t tid; return pthread_create (&tid, NULL, func, (void *)NULL) ; }

compiled with gcc -pthread (and/or -lpthread) returns 11 (EAGAIN) instead of 0;

The new glib then cannot compile, as mplayer.

Could someone help me with this ?
Thanks.
Fred.
Back to top
View user's profile Send private message
zephred
n00b
n00b


Joined: 09 Nov 2002
Posts: 43
Location: Paris - France

PostPosted: Tue Jan 14, 2003 7:10 pm    Post subject: Reply with quote

Update (14/01/03) : I am still stuck with this problem, and do not want to update any new package before to have solved it...
The above exemple returns a proper 0 if I use a libpthread.a taken from the Mandrake 9.0 tree.
I tried to recompile the kernel (xfs-sources), removing the CONFIG_SMP=y (no need on a mono proc), then recompile glibc and gcc without any success...
Could at least someone try to compile the above test and tell me the result ?
Thanx,
Fred.
Back to top
View user's profile Send private message
wormie
n00b
n00b


Joined: 24 Aug 2002
Posts: 36

PostPosted: Wed Jan 15, 2003 3:51 am    Post subject: Reply with quote

This code returns 0 for me, both with -pthread and -lpthread.
I'm using the same gcc & glibc, with gentoo-sources 2.4.19-r10.
Back to top
View user's profile Send private message
zephred
n00b
n00b


Joined: 09 Nov 2002
Posts: 43
Location: Paris - France

PostPosted: Tue Jan 21, 2003 3:13 am    Post subject: Reply with quote

Thanks wormie for your test.
I appear to be the only one to have this problem, but I'll post anyway how I got out.
I edited the glibc-2.3.1-r2.ebuild to remove --enable-kernel=2.4.0 from the configure options, and commented out lines :
myconf="${myconf} --without-tls --without-__thread"
--with-gd=no
--without-cvs
--disable-profile
I set : --enable-add-ons --disable-sanity-checks

I now have threads available.
Fred.
Back to top
View user's profile Send private message
thomasjb
Apprentice
Apprentice


Joined: 26 May 2002
Posts: 176
Location: Beijing

PostPosted: Sun Feb 23, 2003 2:13 pm    Post subject: Reply with quote

zephred, i'm having the exact same problem as you. stumbled across it recently, when i tried to emerge ksplash-lm, mrproject and prozilla https://forums.gentoo.org/viewtopic.php?t=36977&highlight=. never ran into this problem before. i couldn't really say when it started and have no idea why. i'm glad you were able to get rid of the problem. could you please be so kind and let me know what your changes to the glibc ebuild actually do? thanks, i'd really appreciate it.
Back to top
View user's profile Send private message
zephred
n00b
n00b


Joined: 09 Nov 2002
Posts: 43
Location: Paris - France

PostPosted: Mon Feb 24, 2003 12:07 pm    Post subject: Reply with quote

Hi Thomas.
You'll find the ebuild I used there :
http://www2.iap.fr/users/magnard/glibc-2.3.1-r2.ebuild .

As I can remember, what made threads finally work was to get rid of --enable-kernel=2.4.0 , than is supposed to produce a code more optimized for 2.4 kernel family.

--disable-sanity-checks was asked at configure time, I don't remember why. The best way to solve this kind of problem is to manually untar and configure the package.

Threads are really usefull, and mandatory for stuffs like prozilla !

Good luck !
Fred.
Back to top
View user's profile Send private message
thomasjb
Apprentice
Apprentice


Joined: 26 May 2002
Posts: 176
Location: Beijing

PostPosted: Mon Feb 24, 2003 2:57 pm    Post subject: Reply with quote

thanks a lot, fred. i really appreciate your help!
Back to top
View user's profile Send private message
thomasjb
Apprentice
Apprentice


Joined: 26 May 2002
Posts: 176
Location: Beijing

PostPosted: Tue Feb 25, 2003 4:01 am    Post subject: Reply with quote

short update, fred. didn't get arount to use your ebuild the last couple days, and when i finally did an -u world last night, new versions of gcc and glibc got emerged. funny enough, with the new versions all apps that i couldn't get to compile before compile fine now. oh, well ...
Back to top
View user's profile Send private message
zephred
n00b
n00b


Joined: 09 Nov 2002
Posts: 43
Location: Paris - France

PostPosted: Tue Feb 25, 2003 10:04 am    Post subject: Reply with quote

Interesting... The latest ebuild available for glibc seems to be 2.3.1-r2 except 2.3.2_pre1 which still has ~x86. Is that the one you emerged ? Did you try to run the little program I gave at the beginning of this thread ? Its exit status ($status on csh) should be 0.
Back to top
View user's profile Send private message
thomasjb
Apprentice
Apprentice


Joined: 26 May 2002
Posts: 176
Location: Beijing

PostPosted: Tue Feb 25, 2003 5:33 pm    Post subject: Reply with quote

the one i emerged is 2.3.2_pre1. i didn't try the program you gave at the beginning of the thread, but with 2.3.2_pre1 emerged all the apps that wouldn't compile before compiled fine.
i'll try the program and let you know.
Back to top
View user's profile Send private message
nemiak
n00b
n00b


Joined: 04 Feb 2003
Posts: 19

PostPosted: Mon Mar 10, 2003 10:23 pm    Post subject: Reply with quote

I find that pthreads breaks when i upgrade to glibc 2.3.2.
Should i post a bugreport?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum