public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/107693] New: undefined reference to `_ZSt8to_charsPcS_DF128_St12chars_formati' std::format does not work on x86_64-w64-mingw32
@ 2022-11-15  5:29 unlvsur at live dot com
  2022-11-15  8:06 ` [Bug libstdc++/107693] " unlvsur at live dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: unlvsur at live dot com @ 2022-11-15  5:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107693

            Bug ID: 107693
           Summary: undefined reference to
                    `_ZSt8to_charsPcS_DF128_St12chars_formati' std::format
                    does not work on x86_64-w64-mingw32
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: unlvsur at live dot com
  Target Milestone: ---

g++ -o fstream_std_format fstream_std_format.cc -Ofast -std=c++23 -s -flto
-march=native -I../../../include -static-libstdc++
lto-wrapper.exe: warning: using serial compilation of 2 LTRANS jobs
lto-wrapper.exe: note: see the '-flto' option documentation for more
information
d:/x86_64-windows-gnu/x86_64-w64-mingw32/bin/../lib/gcc/x86_64-w64-mingw32/13.0.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
C:\Users\unlvs\AppData\Local\Temp\ccc9ergr.ltrans0.ltrans.o:<artificial>:(.text+0x7243):
undefined reference to `_ZSt8to_charsPcS_DF128_'
d:/x86_64-windows-gnu/x86_64-w64-mingw32/bin/../lib/gcc/x86_64-w64-mingw32/13.0.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
C:\Users\unlvs\AppData\Local\Temp\ccc9ergr.ltrans0.ltrans.o:<artificial>:(.text+0x7906):
undefined reference to `_ZSt8to_charsPcS_DF128_St12chars_formati'
....

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libstdc++/107693] undefined reference to `_ZSt8to_charsPcS_DF128_St12chars_formati' std::format does not work on x86_64-w64-mingw32
  2022-11-15  5:29 [Bug libstdc++/107693] New: undefined reference to `_ZSt8to_charsPcS_DF128_St12chars_formati' std::format does not work on x86_64-w64-mingw32 unlvsur at live dot com
@ 2022-11-15  8:06 ` unlvsur at live dot com
  2022-11-15  9:42 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: unlvsur at live dot com @ 2022-11-15  8:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107693

--- Comment #1 from cqwrteur <unlvsur at live dot com> ---
Created attachment 53898
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53898&action=edit
error message

from the 

llvm-cxxfilt -n _ZSt8to_charsPcS_DF128_St12chars_format
std::to_chars(char*, char*, _Float128, std::chars_format)

It proves that it has the issue that relates to _Float128. (Probably because of
recent changes of GCC for _Float128 that still has not yet supported it for
charconv)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libstdc++/107693] undefined reference to `_ZSt8to_charsPcS_DF128_St12chars_formati' std::format does not work on x86_64-w64-mingw32
  2022-11-15  5:29 [Bug libstdc++/107693] New: undefined reference to `_ZSt8to_charsPcS_DF128_St12chars_formati' std::format does not work on x86_64-w64-mingw32 unlvsur at live dot com
  2022-11-15  8:06 ` [Bug libstdc++/107693] " unlvsur at live dot com
@ 2022-11-15  9:42 ` jakub at gcc dot gnu.org
  2022-11-15 10:55 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-11-15  9:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107693

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Can you retry without LTO, so that it is clearer where the undefined references
come from?  from_chars/to_chars is on Linux supported even for _Float128.
readelf -Wrs libstdc++.a | grep DF128_ | grep -v '\.text\.'
Relocation section
'.rela.gcc_except_table._ZNSt12_GLOBAL__N_117from_chars_strtodIDF128_EESt17from_chars_resultPKcS3_RT_St12chars_format'
at offset 0x67ce0 contains 2 entries:
0000000000013b0d  0000005400000001 R_X86_64_64            0000000000000000
.rodata._ZNSt12_GLOBAL__N_117from_chars_strtodIDF128_EESt17from_chars_resultPKcS3_RT_St12chars_format.str1.1
+ 0
0000000000014a08  0000005400000001 R_X86_64_64            0000000000000000
.rodata._ZNSt12_GLOBAL__N_117from_chars_strtodIDF128_EESt17from_chars_resultPKcS3_RT_St12chars_format.str1.1
+ 0
0000000000000861  0000005800000002 R_X86_64_PC32          0000000000000000
.gcc_except_table._ZNSt12_GLOBAL__N_117from_chars_strtodIDF128_EESt17from_chars_resultPKcS3_RT_St12chars_format
+ 0
00000000000008b5  0000005800000002 R_X86_64_PC32          0000000000000000
.gcc_except_table._ZNSt12_GLOBAL__N_117from_chars_strtodIDF128_EESt17from_chars_resultPKcS3_RT_St12chars_format
+ 14
    84: 0000000000000000     0 SECTION LOCAL  DEFAULT   81
.rodata._ZNSt12_GLOBAL__N_117from_chars_strtodIDF128_EESt17from_chars_resultPKcS3_RT_St12chars_format.str1.1
    87: 0000000000000000   730 FUNC    LOCAL  DEFAULT   84
_ZNSt12_GLOBAL__N_117from_chars_strtodIDF128_EESt17from_chars_resultPKcS3_RT_St12chars_format
    88: 0000000000000000     0 SECTION LOCAL  DEFAULT   86
.gcc_except_table._ZNSt12_GLOBAL__N_117from_chars_strtodIDF128_EESt17from_chars_resultPKcS3_RT_St12chars_format
    89: 0000000000000000    26 FUNC    LOCAL  DEFAULT   82
_ZNSt12_GLOBAL__N_117from_chars_strtodIDF128_EESt17from_chars_resultPKcS3_RT_St12chars_format.cold
   182: 0000000000000000     9 FUNC    GLOBAL DEFAULT   88
_ZSt10from_charsPKcS0_RDF128_St12chars_format
0000000000029bb0  0000004700000001 R_X86_64_64            0000000000000000
.rodata._ZSt29__floating_to_chars_precisionIDF128_ESt15to_chars_resultPcS1_T_St12chars_formati.str1.1
+ 0
0000000000029c0d  0000004700000001 R_X86_64_64            0000000000000000
.rodata._ZSt29__floating_to_chars_precisionIDF128_ESt15to_chars_resultPcS1_T_St12chars_formati.str1.1
+ 0
0000000000037ed9  0000006300000001 R_X86_64_64            0000000000000000
.rodata._ZSt28__floating_to_chars_shortestIDF128_ESt15to_chars_resultPcS1_T_St12chars_format.part.0.str1.1
+ 0
0000000000037f25  0000006300000001 R_X86_64_64            0000000000000000
.rodata._ZSt28__floating_to_chars_shortestIDF128_ESt15to_chars_resultPcS1_T_St12chars_format.part.0.str1.1
+ 0
00000000000007dd  0000007300000002 R_X86_64_PC32          0000000000000000
.gcc_except_table._ZSt8to_charsPcS_DF128_ + 0
00000000000007f9  0000007500000002 R_X86_64_PC32          0000000000000000
.gcc_except_table._ZSt8to_charsPcS_DF128_St12chars_format + 0
000000000000081d  0000007700000002 R_X86_64_PC32          0000000000000000
.gcc_except_table._ZSt8to_charsPcS_DF128_St12chars_formati + 0
     9: 0000000000000000   670 FUNC    LOCAL  DEFAULT   14
_ZSt22__handle_special_valueIDF128_ESt8optionalISt15to_chars_resultEPcS3_T_St12chars_formati
    70: 0000000000000000  1997 FUNC    LOCAL  DEFAULT   69
_ZSt23__floating_to_chars_hexIDF128_ESt15to_chars_resultPcS1_T_St8optionalIiE.isra.0
    71: 0000000000000000     0 SECTION LOCAL  DEFAULT   71
.rodata._ZSt29__floating_to_chars_precisionIDF128_ESt15to_chars_resultPcS1_T_St12chars_formati.str1.1
    73: 0000000000000000  1731 FUNC    LOCAL  DEFAULT   72
_ZSt29__floating_to_chars_precisionIDF128_ESt15to_chars_resultPcS1_T_St12chars_formati
    99: 0000000000000000     0 SECTION LOCAL  DEFAULT   92
.rodata._ZSt28__floating_to_chars_shortestIDF128_ESt15to_chars_resultPcS1_T_St12chars_format.part.0.str1.1
   101: 0000000000000000  5211 FUNC    LOCAL  DEFAULT   93
_ZSt28__floating_to_chars_shortestIDF128_ESt15to_chars_resultPcS1_T_St12chars_format.part.0
   115: 0000000000000000     0 SECTION LOCAL  DEFAULT  114
.gcc_except_table._ZSt8to_charsPcS_DF128_
   117: 0000000000000000     0 SECTION LOCAL  DEFAULT  117
.gcc_except_table._ZSt8to_charsPcS_DF128_St12chars_format
   119: 0000000000000000     0 SECTION LOCAL  DEFAULT  120
.gcc_except_table._ZSt8to_charsPcS_DF128_St12chars_formati
   252: 0000000000000000    20 FUNC    GLOBAL DEFAULT  112
_ZSt8to_charsPcS_DF128_
   255: 0000000000000000    47 FUNC    GLOBAL DEFAULT  115
_ZSt8to_charsPcS_DF128_St12chars_format
   256: 0000000000000000    18 FUNC    GLOBAL DEFAULT  118
_ZSt8to_charsPcS_DF128_St12chars_formati
But the intent was that this would be only enabled if long double is the mode
as _Float128, or for powerpc64le-linux (where it is enabled for some time
already),
or on x86/ia64 if on glibc:
// For now we only support __float128 when it's the powerpc64 __ieee128 type.
#if defined _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT && __FLT128_MANT_DIG__ == 113
// Define overloads of std::to_chars for __float128.
# define FLOAT128_TO_CHARS 1
using F128_type = __float128;
#elif __FLT128_MANT_DIG__ == 113 && __LDBL_MANT_DIG__ != 113 \
      && defined(__GLIBC_PREREQ)
# define FLOAT128_TO_CHARS 1
using F128_type = _Float128;
#else
using F128_type = void;
#endif

So, does mingw predefine __GLIBC_PREREQ somewhere or how comes this is enabled
at all for you?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libstdc++/107693] undefined reference to `_ZSt8to_charsPcS_DF128_St12chars_formati' std::format does not work on x86_64-w64-mingw32
  2022-11-15  5:29 [Bug libstdc++/107693] New: undefined reference to `_ZSt8to_charsPcS_DF128_St12chars_formati' std::format does not work on x86_64-w64-mingw32 unlvsur at live dot com
  2022-11-15  8:06 ` [Bug libstdc++/107693] " unlvsur at live dot com
  2022-11-15  9:42 ` jakub at gcc dot gnu.org
@ 2022-11-15 10:55 ` redi at gcc dot gnu.org
  2022-11-15 14:29 ` cvs-commit at gcc dot gnu.org
  2022-11-15 14:32 ` redi at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2022-11-15 10:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107693

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED
   Target Milestone|---                         |13.0
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-11-15

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
It's just a bug in the macro definitions in <format>, we don't have
std::to_chars for _Float128 for mingw so shouldn't try to support it in
std::format.

I have a patch already.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libstdc++/107693] undefined reference to `_ZSt8to_charsPcS_DF128_St12chars_formati' std::format does not work on x86_64-w64-mingw32
  2022-11-15  5:29 [Bug libstdc++/107693] New: undefined reference to `_ZSt8to_charsPcS_DF128_St12chars_formati' std::format does not work on x86_64-w64-mingw32 unlvsur at live dot com
                   ` (2 preceding siblings ...)
  2022-11-15 10:55 ` redi at gcc dot gnu.org
@ 2022-11-15 14:29 ` cvs-commit at gcc dot gnu.org
  2022-11-15 14:32 ` redi at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-11-15 14:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107693

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:ce86d9678b7f3d914133a035fbf8088504d8bad8

commit r13-4059-gce86d9678b7f3d914133a035fbf8088504d8bad8
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Nov 15 13:44:38 2022 +0000

    libstdc++: Fix detection of std::format support for __float128 [PR107693]

    std::format gives linker errors on targets that define __float128 but
    do not support using it with std::to_chars. This improves the handling
    of 128-bit flaoting-point types so they are disabled if unsupportable.

    libstdc++-v3/ChangeLog:

            PR libstdc++/107693
            * include/std/format (_GLIBCXX_FORMAT_F128): Define to 2 when
            basic_format_arg needs to use its _M_f128 member.
            (__extended_floating_point, __floating_point): Replace with ...
            (__formattable_floating_point): New concept.
            * testsuite/std/format/functions/format.cc: Check whether
            __float128 is supported. Also test _Float128.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libstdc++/107693] undefined reference to `_ZSt8to_charsPcS_DF128_St12chars_formati' std::format does not work on x86_64-w64-mingw32
  2022-11-15  5:29 [Bug libstdc++/107693] New: undefined reference to `_ZSt8to_charsPcS_DF128_St12chars_formati' std::format does not work on x86_64-w64-mingw32 unlvsur at live dot com
                   ` (3 preceding siblings ...)
  2022-11-15 14:29 ` cvs-commit at gcc dot gnu.org
@ 2022-11-15 14:32 ` redi at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2022-11-15 14:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107693

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed. __float128 is not formattable on this target.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-11-15 14:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-15  5:29 [Bug libstdc++/107693] New: undefined reference to `_ZSt8to_charsPcS_DF128_St12chars_formati' std::format does not work on x86_64-w64-mingw32 unlvsur at live dot com
2022-11-15  8:06 ` [Bug libstdc++/107693] " unlvsur at live dot com
2022-11-15  9:42 ` jakub at gcc dot gnu.org
2022-11-15 10:55 ` redi at gcc dot gnu.org
2022-11-15 14:29 ` cvs-commit at gcc dot gnu.org
2022-11-15 14:32 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).