public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Jonathan Wakely <jwakely@redhat.com>,
	Thomas Rodgers <rodgert@appliantology.com>
Cc: David Edelsohn <dje.gcc@gmail.com>,
	gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org
Subject: Re: GCC 11.1 Release Candidate available from gcc.gnu.org
Date: Wed, 21 Apr 2021 10:56:22 +0200	[thread overview]
Message-ID: <20210421085622.GY1179226@tucnak> (raw)
In-Reply-To: <45de03629a536c0000c9b47bb79d6601@appliantology.com>

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  <jakub@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
--- libstdc++-v3/configure.jj	2021-04-09 10:18:15.701265030 +0200
+++ libstdc++-v3/configure	2021-04-21 10:52:06.730259672 +0200
@@ -75836,7 +75836,7 @@ fi
 
   if test $ac_have_posix_semaphore = yes ; then
 
-$as_echo "#define _GLIBCXX_HAVE_POSIX_SEMAPHORE 1" >>confdefs.h
+$as_echo "#define HAVE_POSIX_SEMAPHORE 1" >>confdefs.h
 
   fi
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_have_posix_semaphore" >&5
--- libstdc++-v3/config.h.in.jj	2020-12-17 16:06:39.808526661 +0100
+++ libstdc++-v3/config.h.in	2021-04-21 10:52:09.709226370 +0200
@@ -291,6 +291,10 @@
 /* Define to 1 if you have the `posix_memalign' function. */
 #undef HAVE_POSIX_MEMALIGN
 
+/* Define to 1 if POSIX Semaphores with sem_timedwait are available in
+   <semaphore.h>. */
+#undef HAVE_POSIX_SEMAPHORE
+
 /* Define to 1 if you have the `powf' function. */
 #undef HAVE_POWF
 
@@ -818,10 +822,6 @@
 /* Define if gthreads library is available. */
 #undef _GLIBCXX_HAS_GTHREADS
 
-/* Define to 1 if POSIX Semaphores with sem_timedwait are available in
-   <semaphore.h>. */
-#undef _GLIBCXX_HAVE_POSIX_SEMAPHORE
-
 /* Define to 1 if a full hosted library is built, or 0 if freestanding. */
 #undef _GLIBCXX_HOSTED
 


	Jakub


       reply	other threads:[~2021-04-21  8:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210420152439.GR1179226@tucnak>
     [not found] ` <CAGWvnykjEBYoK=poyfSWy84Eix__GJ-NJ50QSc99ji-UM8n+Wg@mail.gmail.com>
     [not found]   ` <6ac731c557415b46b04613d9b908df2f@appliantology.com>
     [not found]     ` <CAGWvnymcuXzvrBEm6rrTvXzRyoCYgx0vUm2nUBMWA29aQZc4uQ@mail.gmail.com>
     [not found]       ` <a69622f7cc24e6e311d5099b9899e798@appliantology.com>
     [not found]         ` <CAGWvnykWuuxtDKen5AXfX5k__UsChmvJAhp5-vC6O5LFnhqjBQ@mail.gmail.com>
     [not found]           ` <CAGWvnykNJ0VqcMcFfBrQUTTFOk_J2PVj2Ci5jNZu55sbnc7Y9w@mail.gmail.com>
     [not found]             ` <45de03629a536c0000c9b47bb79d6601@appliantology.com>
2021-04-21  8:56               ` Jakub Jelinek [this message]
2021-04-21  9:05                 ` Jonathan Wakely
2021-04-21 11:38               ` Jonathan Wakely
2021-04-21 12:12                 ` Jonathan Wakely
2021-04-21 14:16                   ` Thomas Rodgers
2021-04-21 14:23                   ` David Edelsohn
2021-04-21 14:30                   ` Jonathan Wakely
2021-04-22 12:27                     ` Jonathan Wakely
2021-04-22 12:30                       ` Jakub Jelinek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210421085622.GY1179226@tucnak \
    --to=jakub@redhat.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jwakely@redhat.com \
    --cc=libstdc++@gcc.gnu.org \
    --cc=rodgert@appliantology.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).