On 05/04/2010 22:55, Eric Blake wrote: > [moving to the cygwin list from bug-gnulib] > > On 04/05/2010 03:48 PM, Bruno Haible wrote: >>> Failures on Cygwin 1.7.2 >>> ------------------------ >>> >>> Starting test_cond .../bin/sh: line 5: 4200 Aborted >>> FAIL: test-cond.exe >>> >>> Starting test_lock .../bin/sh: line 5: 2296 Aborted >>> FAIL: test-lock.exe >>> >>> Starting test_tls .../bin/sh: line 5: 2656 Aborted >>> FAIL: test-tls.exe >> These were all due to the fact that gcc 4.3.x on Cygwin 1.7.2 >> accepts "#pragma weak foo", but the symbol foo then evaluates >> to the NULL address, even if foo is defined in libc. > > Dave, are weak symbols something that should work on cygwin with new > enough binutils/gcc? Or is this an indicator of a gcc bug, for silently > accepting #pragma weak foo that it can't support?
Weak symbols work on Cygwin, but the semantics of undefined weak symbols aren't identical to ELF platforms: a weak reference won't pull in an archive member that wouldn't otherwise be linked; the implications in relation to import libraries should be fairly obvious. Also, I haven't actually verified that "#pragma weak" is hooked up to DTRT in the same way as using a weak attribute on a declaration (but also have no particular reason to suspect it wouldn't work). cheers, DaveK -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple