From: Julian S. <js...@ac...> - 2003-04-06 13:14:24
|
Greetings, all. I'm trying to add support to V for R H 9, and it nearly works. I need a configure (autoconf, etc) check to establish whether V is being built on a system which uses NPTL (Native Posix Threads Library) as opposed to the older LinuxThreads library. So far R H 9 is the only distro I'm aware of that uses NPTL. Problem is: I have a set of patches which does appear to make V work on R H 9, but they break all other systems. So I need a configure test to distinguish NPTL-based systems from LinuxThreads-based systems. Anyone have a reliable check easily to hand? J |
From: Robert W. <rj...@du...> - 2003-04-06 18:48:07
|
> Anyone have a reliable check easily to hand? Yeugh. I don't know if this is reliable, but pthread_tryjoin_np is implemented in nptl but not in the original pthread stuff. Perhaps a check for that will let you know? It will certainly let you know if pthread_tryjoin_np is implemented, but you might allow yourself to infer from that that it's nptl... :-) Regards, Robert. --=20 Robert Walsh Amalgamated Durables, Inc. - "We don't make the things you buy." Email: rj...@du... |
From: Julian S. <js...@ac...> - 2003-04-06 23:37:25
|
On Sunday 06 April 2003 6:48 pm, Robert Walsh wrote: > > Anyone have a reliable check easily to hand? > > Yeugh. I don't know if this is reliable, but pthread_tryjoin_np is > implemented in nptl but not in the original pthread stuff. Perhaps a > check for that will let you know? It will certainly let you know if > pthread_tryjoin_np is implemented, but you might allow yourself to infer > from that that it's nptl... :-) Hmm. Sounds a plausible scheme, but ... On the one hand (on RH 9), nm /lib/tls/libpthread.so.0 | grep tryjoin shows pthread_tryjoin_np as an exported text symbol ("T"). On the other hand, you can't link against it: sewardj@localhost:~/VgHEAD/valgrind$ cat nptltest.c #include <pthread.h> extern int pthread_tryjoin_np; int main (int argc, char * argv ) { int* p = (int*)(& pthread_tryjoin_np); return 0; } sewardj@localhost:~/VgHEAD/valgrind$ gcc -o nptltest nptltest.c -lpthread /tmp/ccWjnvw9.o(.text+0x13): In function `main': : undefined reference to `pthread_tryjoin_np' collect2: ld returned 1 exit status Now what? If the symbol is in the DSO, why can't I link to it? Mystified. J |
From: Robert W. <rj...@du...> - 2003-04-07 06:07:39
|
> Now what? If the symbol is in the DSO, why can't I link to it? > Mystified. You seem to be saying "Mystified" a lot about the NPTL :-) This does seem strange, though. Are you sure you're picking up the correct library? Maybe you need to say "extern int pthread_join_np();" instead of just "extern int pthread_join_np;" (i.e. declare it as an external function and not variable.) I haven't checked, so this may be a red herring. BTW: my file-descriptor leakage support is almost ready. I'm just testing the "passing fds over a unix-domain socket" support at the moment. Sockets are weird. Regards, Robert. --=20 Robert Walsh Amalgamated Durables, Inc. - "We don't make the things you buy." Email: rj...@du... |
From: Biswapesh C. <bis...@tc...> - 2003-04-07 04:22:43
|
IIRC, the wine folks have a reasonable configure time check for NPTL in CVS, so maybe you can simply swipe their code ? Of course, the issue they are facing is that what if the program (wine/valgrind) is compiled with one kind of threading support and the binary shipped to a system with a different type of threading ? Basically, in that case, you need a runtime check as well. > On Sunday 06 April 2003 6:48 pm, Robert Walsh wrote: > > > Anyone have a reliable check easily to hand? > > > > Yeugh. I don't know if this is reliable, but pthread_tryjoin_np is > > implemented in nptl but not in the original pthread stuff. Perhaps a > > check for that will let you know? It will certainly let you know if > > pthread_tryjoin_np is implemented, but you might allow yourself to infer > > from that that it's nptl... :-) > > Hmm. Sounds a plausible scheme, but ... > > On the one hand (on RH 9), nm /lib/tls/libpthread.so.0 | grep tryjoin > shows pthread_tryjoin_np as an exported text symbol ("T"). > > On the other hand, you can't link against it: > > sewardj@localhost:~/VgHEAD/valgrind$ cat nptltest.c > > #include <pthread.h> > extern int pthread_tryjoin_np; > int main (int argc, char * argv ) > { > int* p = (int*)(& pthread_tryjoin_np); > return 0; > } > > sewardj@localhost:~/VgHEAD/valgrind$ gcc -o nptltest nptltest.c > -lpthread > /tmp/ccWjnvw9.o(.text+0x13): In function `main': > : undefined reference to `pthread_tryjoin_np' > collect2: ld returned 1 exit status > > Now what? If the symbol is in the DSO, why can't I link to it? > Mystified. > > J > > > > ------------------------------------------------------- > This SF.net email is sponsored by: ValueWeb: > Dedicated Hosting for just $79/mo with 500 GB of bandwidth! > No other company gives more support or power for your dedicated server > http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users -- Biswa. |
From: Robert W. <rj...@du...> - 2003-04-07 06:12:52
|
> IIRC, the wine folks have a reasonable configure time check for NPTL in > CVS, so maybe you can simply swipe their code ? I can't find that. I can see a --with-nptl switch, but no automated check. If doing it the automated way is too difficult, maybe having a --with-nptl switch is the way to go? Regards, Robert. --=20 Robert Walsh Amalgamated Durables, Inc. - "We don't make the things you buy." Email: rj...@du... |