https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112963
--- Comment #2 from Iain Sandoe <iains at gcc dot gnu.org> --- r14-4825-g6a6d3817afa02b, (adding @rpath support) was not intended to change the behaviour of libc handling, but as noted a rebase error left that in (probably because both changes acted on the link). So the unwanted part of change removed the unconditional '-lm' from the link line and replaced it with $(LIBM) which was derived from the AC_CHECK_LIBM (which apparently breaks bare metal). When I reverted the use of AC_CHECK_LIBM in r14-4863-g538dcde872a, I should also have reverted the use of $(LIBM) to -lm in libquadmath_la_LDFLAGS. so I need to set up to test the following on the various targets - does this fix it for you? diff --git a/libquadmath/Makefile.am b/libquadmath/Makefile.am index 0d02c95e738..2aaa0f95b5b 100644 --- a/libquadmath/Makefile.am +++ b/libquadmath/Makefile.am @@ -42,7 +42,7 @@ libquadmath_darwin_rpath = -Wc,-nodefaultrpaths libquadmath_darwin_rpath += -Wl,-rpath,@loader_path endif libquadmath_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` \ - $(version_arg) $(lt_host_flags) $(LIBM) $(libquadmath_darwin_rpath) + $(version_arg) $(lt_host_flags) -lm $(libquadmath_darwin_rpath) libquadmath_la_DEPENDENCIES = $(version_dep) $(libquadmath_la_LIBADD) nodist_libsubinclude_HEADERS = quadmath.h quadmath_weak.h diff --git a/libquadmath/Makefile.in b/libquadmath/Makefile.in index dbcafb57e5b..8d4ea034c15 100644 --- a/libquadmath/Makefile.in +++ b/libquadmath/Makefile.in @@ -466,7 +466,7 @@ AUTOMAKE_OPTIONS = foreign info-in-builddir @BUILD_LIBQUADMATH_TRUE@@ENABLE_DARWIN_AT_RPATH_TRUE@libquadmath_darwin_rpath = -Wc,-nodefaultrpaths \ @BUILD_LIBQUADMATH_TRUE@@ENABLE_DARWIN_AT_RPATH_TRUE@ -Wl,-rpath,@loader_path @BUILD_LIBQUADMATH_TRUE@libquadmath_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` \ -@BUILD_LIBQUADMATH_TRUE@ $(version_arg) $(lt_host_flags) $(LIBM) $(libquadmath_darwin_rpath) +@BUILD_LIBQUADMATH_TRUE@ $(version_arg) $(lt_host_flags) -lm $(libquadmath_darwin_rpath) @BUILD_LIBQUADMATH_TRUE@libquadmath_la_DEPENDENCIES = $(version_dep) $(libquadmath_la_LIBADD) @BUILD_LIBQUADMATH_TRUE@nodist_libsubinclude_HEADERS = quadmath.h quadmath_weak.h