Am 21.03.25 um 15:21 schrieb Richard Biener:
On Fri, Mar 21, 2025 at 2:38 PM Georg-Johann Lay <a...@gjlay.de> wrote:
Am 21.03.25 um 08:58 schrieb Richard Biener:
On Thu, Mar 20, 2025 at 8:05 PM Georg-Johann Lay via Gcc
<gcc@gcc.gnu.org> wrote:
For avr, there is no support for shared objects, yet
when building libgcc, for each module.o there is also module_s.o
that's build with -DSHARED.
How can this be turned off?
What doesn't word is to configure with --disable-shared, and even
without turning it off by hand, there is no use for module_s.o stuff.
--disable-shared should work and ideally also avoid building the object
files. It sounds like a missed opportunity in libgcc/Makefile.in - that
already guards pieces with ifeq ($(enable_shared),yes), but obviously
not some bits that trigger building the shared objects ...
But where in Makefile.in?
I have no idea - it just looks like there is things that are supposed to
prevent building shared objects. You'd have to figure why it doesn't
work for you (in full).
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.
Johann
There is this sequence that deals with
LIB1ASMFUNCS + shared:
lib1asmfuncs-s-o = $(patsubst %,%_s$(objext),$(LIB1ASMFUNCS))
$(lib1asmfuncs-s-o): %_s$(objext): $(srcdir)/config/$(LIB1ASMSRC)
$(gcc_s_compile) -DL$* -xassembler-with-cpp -c $<
ifeq ($(enable_shared),yes)
libgcc-s-objects += $(lib1asmfuncs-s-o)
endif
Not adding the objects to libgcc-s-objects should be enough. No?
Johann
These objects are just boosting the build time for the > 60 multilib
variants by 100%.
What also doesn't work it to set libgcc-s-objects to empty in t-avr.
Thanks, Johann