On 21/04/21 10:56 +0200, Jakub Jelinek via Libstdc++ wrote:
On Tue, Apr 20, 2021 at 10:12:33PM -0700, Thomas Rodgers wrote:
I think the attached patch (also in BZ) addresses the issue in
bits/semaphore_base.h, but I'm going to defer to Jonathan on why the macro
name is being transformed incorrectly in the first place.
Jonathan's call, but for me it looks much better to fix up the
macro name on the configure side.
The include/Makefile.am sed is:
sed -e 's/HAVE_/_GLIBCXX_HAVE_/g' \
-e 's/PACKAGE/_GLIBCXX_PACKAGE/g' \
-e 's/VERSION/_GLIBCXX_VERSION/g' \
-e 's/WORDS_/_GLIBCXX_WORDS_/g' \
-e 's/_DARWIN_USE_64_BIT_INODE/_GLIBCXX_DARWIN_USE_64_BIT_INODE/g' \
-e 's/_FILE_OFFSET_BITS/_GLIBCXX_FILE_OFFSET_BITS/g' \
-e 's/_LARGE_FILES/_GLIBCXX_LARGE_FILES/g' \
-e 's/ICONV_CONST/_GLIBCXX_ICONV_CONST/g' \
-e '/[ ]_GLIBCXX_LONG_DOUBLE_COMPAT[ ]/d' \
-e '/[ ]_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT[ ]/d' \
< ${CONFIG_HEADER} >> $@ ;\
so for many macros one needs _GLIBCXX_ prefixes already in configure,
as can be seen in grep AC_DEFINE.*_GLIBCXX configure.ac acinclude.m4
But _GLIBCXX_HAVE_POSIX_SEMAPHORE is the only one that shouldn't have
that prefix because the sed is adding that.
E.g. on i686-linux, I see
grep _GLIBCXX__GLIBCXX c++config.h
#define _GLIBCXX__GLIBCXX_HAVE_POSIX_SEMAPHORE 1
that proves it is the only broken one.
So, I think the right fix is:
2021-04-21 Jakub Jelinek <ja...@redhat.com>
PR libstdc++/100164
* acinclude.m4: For POSIX semaphores AC_DEFINE HAVE_POSIX_SEMAPHORE
rather than _GLIBCXX_HAVE_POSIX_SEMAPHORE.
* configure: Regenerated.
* config.h.in: Regenerated.
--- libstdc++-v3/acinclude.m4.jj 2020-12-16 14:42:46.501084530 +0100
+++ libstdc++-v3/acinclude.m4 2021-04-21 10:51:52.450419650 +0200
@@ -4097,7 +4097,7 @@ AC_DEFUN([GLIBCXX_CHECK_GTHREADS], [
[ac_have_posix_semaphore=no])
if test $ac_have_posix_semaphore = yes ; then
- AC_DEFINE(_GLIBCXX_HAVE_POSIX_SEMAPHORE,
+ AC_DEFINE(HAVE_POSIX_SEMAPHORE,
1,
[Define to 1 if POSIX Semaphores with sem_timedwait are available in
<semaphore.h>.])
fi
Yes, this is correct. Please push.