This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Mitigate PR85222 a bit
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Fri, 6 Apr 2018 11:39:38 +0200 (CEST)
- Subject: [PATCH] Mitigate PR85222 a bit
The following allows people configuring the gcc-4 compatible ABI
as the default ABI to retain compatibility with old programs
catching ios_base::failure by matching the abi version thrown
to the configured default ABI.
This doesn't really fix the PR but it makes behavior between
the dual-ABI with default gcc-4 compatible consistent with that
of the non-dual-ABI which is what I had expected.
Whether an ABI break is really desired for the case of a c++11
default ABI is still questionable and any programs that differ
from the default ABI choice will now be broken (compared to
those differing from c++11).
Bootstrapped on x86_64-unknown-linux-gnu, ok for trunk? Ok for
the GCC 7 branch?
I'm not sure if we want to revert r245167 after this? I'm
re-running the testsuite with a gcc4-compatible ABI right now.
At least with a "real" fix we should be able to run the affected
tests twice, once with the new and once with the old ABI.
Thanks,
Richard.
2018-04-06 Richard Biener <rguenther@suse.de>
PR libstdc++/85222
* src/c++11/ios.cc: Remove hard define of _GLIBCXX_USE_CXX11_ABI to 1.
Instead use the configured default ABI to decide the ABI version
of ios_base::failure thrown by __throw_ios_failure.
Index: libstdc++-v3/src/c++11/ios.cc
===================================================================
--- libstdc++-v3/src/c++11/ios.cc (revision 258812)
+++ libstdc++-v3/src/c++11/ios.cc (working copy)
@@ -26,9 +26,8 @@
// ISO C++ 14882: 27.4 Iostreams base classes
//
-// Determines the version of ios_base::failure thrown by __throw_ios_failure.
-// If !_GLIBCXX_USE_DUAL_ABI this will get undefined automatically.
-#define _GLIBCXX_USE_CXX11_ABI 1
+// The ABI version of ios_base::failure thrown by __throw_ios_failure
+// is determined by the default ABI version choosed at configure time
#include <ios>
#include <limits>