[PATCH] ld: Build and install only unversioned libdep

H.J. Lu hjl.tools@gmail.com
Thu Dec 17 15:22:52 GMT 2020


On Thu, Dec 17, 2020 at 7:10 AM Howard Chu <hyc@symas.com> wrote:
>
> H.J. Lu wrote:
> > On Wed, Dec 16, 2020 at 6:50 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> >>
> >> Remove libdep.*a, libdep.so and libdep.so.0 since only libdep.so.0.0.0
> >> is needed.
> >>
> >>         PR ld/27082
> >>         * Makefile.am (install-data-local): Depend on
> >>         $(install-bfdpluginLTLIBRARIES).  Remove libdep.*a, libdep.so
> >>         and libdep.so.0.
> >
> > Here is the updated patch to build and install only unversioned libdep.
> > Ok for master?
> >
> > --- a/ld/Makefile.am
> > +++ b/ld/Makefile.am
> > @@ -1001,7 +1001,11 @@ libldtestplug4_la_LDFLAGS = -no-undefined -rpath /nowhere
> >  bfdplugindir = $(libdir)/bfd-plugins
> >  bfdplugin_LTLIBRARIES = libdep.la
> >  libdep_la_SOURCES = libdep_plugin.c
> > -libdep_la_LDFLAGS = -no-undefined -rpath /nowhere
> > +libdep_la_LDFLAGS = -no-undefined -rpath /nowhere -module -avoid-version
> > +libdep_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
> > +     --tag=disable-static \
> > +     $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
> > +     $(libdep_la_LDFLAGS) $(LDFLAGS) -o $@
>
> Should be able to just add --tag=disable-static to libdep_la_LDFLAGS, and not
> need a custom _LINK rule, right?

I tried it.  But it is ignored by libtool and libdep.a is still generated.

-- 
H.J.


More information about the Binutils mailing list