[PATCH] PR libstdc++/85222 allow catching iostream errors as gcc4-compatible ios::failure

Jonathan Wakely jwakely.gcc@gmail.com
Fri Apr 13 10:19:00 GMT 2018


Darwin has double underscores at the start of mangled names, so this
fixes the sed command to be more flexible.

Committed to trunk and gcc-7-branch.
-------------- next part --------------
commit f80944837b4c21016d826bff5f497ceda85b9894
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Apr 13 10:44:08 2018 +0100

    Fix __iosfail_type_info hack to work on darwin
    
            * src/c++11/Makefile.am: Rewrite sed rule to be less fragile and to
            handle mangled names starting with double underscores on darwin.
            * src/c++11/Makefile.in: Regenerate.

diff --git a/libstdc++-v3/src/c++11/Makefile.am b/libstdc++-v3/src/c++11/Makefile.am
index 8d524b67232..12bc004a2ea 100644
--- a/libstdc++-v3/src/c++11/Makefile.am
+++ b/libstdc++-v3/src/c++11/Makefile.am
@@ -128,10 +128,7 @@ hashtable_c++0x.o: hashtable_c++0x.cc
 
 if ENABLE_DUAL_ABI
 # Rewrite the type info for __ios_failure.
-rewrite_ios_failure_typeinfo = sed -e '/^_ZTISt13__ios_failure:$$/{' \
-	-e 'n' \
-	-e 's/_ZTVN10__cxxabiv120__si_class_type_infoE/_ZTVSt19__iosfail_type_info/' \
-	-e '}'
+rewrite_ios_failure_typeinfo = sed -e '/^_*_ZTISt13__ios_failure:/,_ZTVN10__cxxabiv120__si_class_type_infoE/s/_ZTVN10__cxxabiv120__si_class_type_infoE/_ZTVSt19__iosfail_type_info/'
 
 cxx11-ios_failure-lt.s: cxx11-ios_failure.cc
 	$(LTCXXCOMPILE) -S $< -o tmp-cxx11-ios_failure-lt.s


More information about the Libstdc++ mailing list