[PATCH] libstdc++: ifdef rtti specific function __throw_ios_failure() by __cpp_rtti

Jonathan Wakely jwakely@redhat.com
Fri Feb 12 14:45:05 GMT 2021


On 12/02/21 12:31 +0100, Mirko Vogt wrote:
>On 2/12/21 11:30 AM, Jonathan Wakely wrote:
>>This patch is wrong.
>
>Indeed, thanks for checking.
>
>>If you simply disable that function definition
>>for !__cpp_rtti then you'll get linker errors from fstream.tcc when
>>that function is called.
>>
>>/usr/bin/ld: /home/jwakely/src/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so: undefined reference to `std::__throw_ios_failure(char const*, int)'
>
>Funny enough that doesn't occur for my use case - builds fine. However 
>building with a toolchain for bare metal, potentially resulting in 
>disabling e.g. fstream.
>
>>
>>>This was done correctly for the c++98 part and probably just forgotten
>>>for c++11.
>>
>>This has nothing to do with C++98, it's relted to the gcc4-compatible
>>ABI versus the cxx11 ABI.
>
>Urgs, yeah, that last chunk for cxx98 expands a different macro to 
>include that definition - not the rtti ifdef. Misread and wrongly took 
>over.
>
>>
>>I added a better patch to
>>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99077

I've committed that patch to master now (and will backport it to
gcc-10 and gcc-9 soon). Thanks for finding the bug.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 2652 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210212/aeff40a8/attachment-0001.bin>


More information about the Gcc-patches mailing list