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

            Bug ID: 113700
           Summary: libgcc_s does not include symbols for _Float16 and
                    __bf16 on Solaris/Illumos even though gcc generates
                    code for _Float16 and __bf16
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcc
          Assignee: unassigned at gcc dot gnu.org
          Reporter: youremailsarecrap at gmail dot com
  Target Milestone: ---

Created attachment 57277
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57277&action=edit
_Float16 and __bf16 that breaks on Illumos

When compiling the code included in the .ii
files on illumos the output claims that it
can't find the symbols __extendhfdf2,
__extendbfsf2 and __truncsfbf2 .

Command line and output:

g++ -march=native -shared -shared-libgcc -fPIC -Wl,--no-undefined -o
f16-bf16.so f16-bf16.cc
Undefined                       first referenced
 symbol                             in file
__extendhfdf2                       f16-bf16.so-f16-bf16.o
__extendbfsf2                       f16-bf16.so-f16-bf16.o
__truncsfbf2                        f16-bf16.so-f16-bf16.o
ld: fatal: symbol referencing errors. No output written to f16-bf16.so
collect2: error: ld returned 1 exit status

The -Wl,--no-undefined is used here to not have create a executable that links
to the so files
to cause the error.

-march=native is used since sse2 seems to be needed for f16 and bf16 on x86
platforms if I
understand the half-precision doc in gcc correctly, I used a system with sse2
when compiling this.

My own fix, that may not be correct:
I tried to add the gcc12 and up parts of
libgcc/config/i386/libgcc-glibc.ver to
libgcc/config/i386/libgcc-sol2.ver rebuilt
gcc and then it linked correctly.
Some maintainer could take a look at that.

Reply via email to