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

            Bug ID: 121718
           Summary: [16 Regression] _Decimal128 now requires -lm, fails to
                    link gdb (mpfr is underlinked against fesetenv())
                    since r16-3448-g50064b2898edfb
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcc
          Assignee: unassigned at gcc dot gnu.org
          Reporter: slyfox at gcc dot gnu.org
  Target Milestone: ---

Noticed the problem as `gdb` ./configure failure to locate gmp/mpfr.

Minimal reproducer:

// $ cat a.c
_Decimal128 d(_Decimal128 a, _Decimal128 b) { return a / b; }

$ gcc a.c -o liba.so -fPIC -shared -Wl,--no-undefined
ld: libgcc.a(bid128_div.o): in function `__bid128_div':
(.text+0x1c1c): undefined reference to `fegetround'
ld: (.text+0x1eb3): undefined reference to `fesetround'

I suspect a new dependency is an effect of r16-3448-g50064b2898edfb "Fix
_Decimal128 arithmetic error under FE_UPWARD.".

Should `gcc` start implicitly providing `-lm` along with `libgcc`?

Reply via email to