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

--- Comment #11 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #10)
> BTW, yet another option  would be to just
> LIBM=
> case $host in
> *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
>   # These system don't have libm, or don't need it
>   ;;
> *)
>   LIBM=-lm
>   ;;
> esac
> AC_SUBST([LIBM])
> i.e. copy&paste libtool AC_CHECK_LIBM without that AC_CHECK_LIB part (and
> without *-ncr-sysv* entry which we don't support in GCC AFAIK), so something
> in between using -lm unconditionally and not using it on targets which don't
> really need it.

yes that seems a better solution - I was about to write:

Seeing your comment #7, I think that the bare metal is a red herring (it just
happened to be the reporter) - actually the issue is the unconditional
GCC_NO_EXECUTABLES, which means that the macro would fail for any build != host
case.

I suppose also that means that build != host == target for mingw or other
targets that do not use '-lm' will also be wrong - so a proper fix is needed
sometime.

Reply via email to