On Thu, Jul 14, 2005 at 04:10:14PM +0200, Bruno Haible wrote: > I propose to add a new module 'lock' to gnulib. It addresses these problems. > It will be used in gettext 0.15.
I looked through m4/lock.m4 to determine how you identify weak symbol support on a system: gl_have_weak=no AC_TRY_LINK([extern void xyzzy (); #pragma weak xyzzy], [xyzzy();], [gl_have_weak=yes]) I'm mainly interested with the vendor compiler, not GCC. $ cat weak.c extern void xyzzy (); #pragma weak xyzzy int main (void) { xyzzy(); } (Solaris 2.6, 7, 8, 9, 10/SPARC) $ cc weak.c (HP-UX 11.00, 11i) $ cc weak.c cc: "weak.c", line 2: warning 21: Undefined pragma "WEAK" ignored. /usr/ccs/bin/ld: Unsatisfied symbols: xyzzy (first referenced in weak.o) (code) (AIX 4.3.3, 5.1, 5.2) $ cc weak.c ld: 0711-317 ERROR: Undefined symbol: .xyzzy ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. (Tru64 UNIX 4.0D, 5.1) $ cc weak.c ld: Unresolved: xyzzy (IRIX 6.5) $ cc weak.c So, according to your test, #pragma weak supports weak symbols on Solaris and IRIX 6.5. However, in the case of pthread mutex'es, you should really test for working stubs in libc: http://lists.freedesktop.org/archives/cairo/2005-July/004465.html If you do so, you'll get a failure on IRIX 6.5 and a success on HP-UX 11.x. Some interesting references: http://gcc.gnu.org/ml/gcc-help/2005-07/msg00095.html http://groups-beta.google.com/group/comp.sys.sgi.admin/browse_thread/thread/4586067cd05bb6cb/d971cc2459ec0ded?q=pthread+group:comp.sys.sgi.admin+author:albert+author:chin&rnum=1&hl=en#d971cc2459ec0ded -- albert chin ([EMAIL PROTECTED]) _______________________________________________ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib