On 8/28/24 6:22 AM, Jason Merrill wrote:
On 8/28/24 6:09 AM, Jonathan Wakely wrote:
On Wed, 28 Aug 2024 at 10:58, Jason Merrill <ja...@redhat.com> wrote:
On 8/28/24 5:55 AM, Jonathan Wakely wrote:
On Wed, 28 Aug 2024 at 10:54, Jason Merrill wrote:
Tested x86_64-pc-linux-gnu, OK for trunk?
Redefining that macro to invalidate PCH is a bit of a hack, but it's
what we have for now, so OK for trunk, thanks.
If it's just to invalidate PCH, do we want to #undef instead?
It might not even be necessary now, since r14-3276-g91315f23ba127e
removed any -include bits/stdc++.h from the flags. I'd need to look
into that though.
I suppose it could still find some random other PCH corresponding to the
first #include, though that seems very unlikely.
Does
anything care about the actual value of the macro?
No, I don't think so.
But #undef would only work if it comes after including
<bits/c++config.h>, so we'd need to force an include of that into the
flags.
I meant #undef before #define in c++config.h so we get the normal value.
Like so. Do you prefer this or the original patch?
From 23ca36704bf621359b91b3694decffc50af09776 Mon Sep 17 00:00:00 2001
From: Jason Merrill <ja...@redhat.com>
Date: Tue, 27 Aug 2024 13:15:38 -0400
Subject: [PATCH] libstdc++: avoid __GLIBCXX__ redefinition
To: gcc-patches@gcc.gnu.org
testsuite/lib/dg-options.exp defines __GLIBCXX__ to 9999999; avoid a macro
redefinition warning in that case.
libstdc++-v3/ChangeLog:
* include/bits/c++config: Avoid redefining __GLIBCXX__.
---
libstdc++-v3/include/bits/c++config | 1 +
1 file changed, 1 insertion(+)
diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config
index 0f0cc7cd659..54d455be226 100644
--- a/libstdc++-v3/include/bits/c++config
+++ b/libstdc++-v3/include/bits/c++config
@@ -36,6 +36,7 @@
#define _GLIBCXX_RELEASE
// The datestamp of the C++ library in compressed ISO date format.
+#undef __GLIBCXX__ /* The testsuite defines it to 99999999 to block PCH. */
#define __GLIBCXX__
// Macros for various attributes.
--
2.46.0