https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119396
--- Comment #3 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
As it seems, the following libgcc/Makefile.in rule injects dependencies:
$(patsubst %,%.vis,$(LIB1ASMFUNCS)): %.vis: %_s$(objext)
$(gen-hide-list)
Since the *_s. objects are added to lib1asmfuncs-s-o even when
enable_shared=no, this triggers to build the *_s.o objects.
I don't know what that vis stuff is all about and why it requires
shared objects in the dependency.
Wrapping
lib1asmfuncs-s-o = $(patsubst %,%_s$(objext),$(LIB1ASMFUNCS))
into ifeq($(enable_shared),yes) does not work because the first rule
needs these objects, so using ifeq on the 2nd rule stops with an error
because make cannot find the *_s.o files.