[PATCH] libstdc++: Add _Float128 to_chars/from_chars support for x86, ia64 and ppc64le with glibc
Jonathan Wakely
jwakely@redhat.com
Mon Nov 7 17:48:42 GMT 2022
On Mon, 7 Nov 2022 at 16:11, Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Wed, 2 Nov 2022, Jakub Jelinek via Gcc-patches wrote:
>
> > APIs. So that one can build gcc against older glibc and then compile
> > user programs on newer glibc, the patch uses weak references unless
> > gcc is compiled against glibc 2.26+. strfromf128 unfortunately can't
>
> This support for older glibc doesn't actually seem to be working, on an
> older system with glibc 2.19 I'm seeing
>
> /scratch/jmyers/fsf/gcc-mainline/libstdc++-v3/src/c++17/floating_to_chars.cc:52:3: error: expected initializer before '__asm'
> 52 | __asm ("strfromf128");
> | ^~~~~
>
> and a series of subsequent errors.
This seems to "fix" it (not sure if it's right though):
#ifndef _GLIBCXX_HAVE_FLOAT128_MATH
extern "C" _Float128 __strtof128(const char*, char**)
__attribute__((__weak__));
#endif
extern "C" _Float128 __strtof128(const char*, char**)
__asm ("strtof128");
More information about the Libstdc++
mailing list