[patch] libstdc++/configure: strengthen the check for availability of pthread_rwlock_t

Jérôme Lambourg lambourg@adacore.com
Tue Dec 17 09:09:00 GMT 2019


Hello,

This patch to libstdc++ configure ensures that pthread_rwlock_t is used only
when pthread is used for gthreads implementation.

The original issue is that VxWorks comes with its native tasking layer and an
optional pthread layer built above it. As pthread is an optional feature of the
kernel it may not be available on the target board.

Now, even being optional, the headers are present in the development
environment, and are in particular partially available when including the main
vxWorks.h header, and so are detected automatically as available by libstdc++.

This patch will thus refine the check and will make configure try to use
pthread_rwlock_t only when the gthr library already relies on pthread.

This was of course tested with vxworks targets, and we also verified that this
does not impact Linux (that uses pthread) or Windows (that does not use
pthread).

Best regards,
- Jerome

2019-12-16  Jerome Lambourg  <lambourg@adacore.com>

libstdc++
	* acinclude.m4 (_GLIBCXX_USE_PTHREAD_RWLOCK_T): Checks that _PTHREADS
	is defined after including gthr.h.
	* configure: Regenerate.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pthread_rwlock_libstdcxx_configure.patch
Type: application/octet-stream
Size: 2462 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20191217/9ea5aadc/attachment.obj>


More information about the Gcc-patches mailing list