From: H.J. Lu Date: Fri, 18 Dec 2020 12:30:47 +0000 (-0800) Subject: ld: Build and install only unversioned libdep X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=eba7b68cb023add7bdcbcc79ac6f3ce8e50952e1;p=binutils-gdb.git ld: Build and install only unversioned libdep Build only unversioned libdep and remove the installed libdep.la since only a single libdep.so is needed. PR ld/27082 * Makefile.am (libdep_la_LDFLAGS): Add -module -avoid-version. (libdep_la_LINK): New. (install-data-local): Depend on $(install-bfdpluginLTLIBRARIES) and remove libdep.la. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 392165b978a..05eaadad3b4 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,12 @@ +2020-12-18 H.J. Lu + + PR ld/27082 + * Makefile.am + (libdep_la_LDFLAGS): Add -module -avoid-version. + (libdep_la_LINK): New. + (install-data-local): Depend on $(install-bfdpluginLTLIBRARIES) + and remove libdep.la. + 2020-12-18 H.J. Lu PR ld/27091 diff --git a/ld/Makefile.am b/ld/Makefile.am index 2f59ee61697..73144e730a1 100644 --- 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 $@ # DOCUMENTATION TARGETS # Manual configuration file; not usually attached to normal configuration, @@ -1060,11 +1064,12 @@ install-exec-local: ld-new$(EXEEXT) install-binPROGRAMS fi; \ fi -install-data-local: +install-data-local: install-bfdpluginLTLIBRARIES $(mkinstalldirs) $(DESTDIR)$(scriptdir)/ldscripts for f in ldscripts/* ; do \ $(INSTALL_DATA) $$f $(DESTDIR)$(scriptdir)/$$f ; \ done + rm -f $(DESTDIR)$(bfdplugindir)/libdep.la # Stuff that should be included in a distribution. The diststuff # target is run by the taz target in ../Makefile.in. diff --git a/ld/Makefile.in b/ld/Makefile.in index c744701e0e4..178ae49009d 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in @@ -170,16 +170,13 @@ LTLIBRARIES = $(bfdplugin_LTLIBRARIES) $(noinst_LTLIBRARIES) libdep_la_LIBADD = am_libdep_la_OBJECTS = libdep_plugin.lo libdep_la_OBJECTS = $(am_libdep_la_OBJECTS) +libldtestplug_la_LIBADD = +am_libldtestplug_la_OBJECTS = libldtestplug_la-testplug.lo +libldtestplug_la_OBJECTS = $(am_libldtestplug_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = -libdep_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libdep_la_LDFLAGS) $(LDFLAGS) -o $@ -libldtestplug_la_LIBADD = -am_libldtestplug_la_OBJECTS = libldtestplug_la-testplug.lo -libldtestplug_la_OBJECTS = $(am_libldtestplug_la_OBJECTS) libldtestplug_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(libldtestplug_la_CFLAGS) $(CFLAGS) \ @@ -1023,7 +1020,12 @@ 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 $@ + MAINTAINERCLEANFILES = configdoc.texi ld.1 ld.info # We want to reconfigure if configure.host or configure.tgt changes. @@ -1146,7 +1148,7 @@ clean-noinstLTLIBRARIES: } libdep.la: $(libdep_la_OBJECTS) $(libdep_la_DEPENDENCIES) $(EXTRA_libdep_la_DEPENDENCIES) - $(AM_V_CCLD)$(libdep_la_LINK) -rpath $(bfdplugindir) $(libdep_la_OBJECTS) $(libdep_la_LIBADD) $(LIBS) + $(AM_V_GEN)$(libdep_la_LINK) -rpath $(bfdplugindir) $(libdep_la_OBJECTS) $(libdep_la_LIBADD) $(LIBS) libldtestplug.la: $(libldtestplug_la_OBJECTS) $(libldtestplug_la_DEPENDENCIES) $(EXTRA_libldtestplug_la_DEPENDENCIES) $(AM_V_CCLD)$(libldtestplug_la_LINK) $(libldtestplug_la_OBJECTS) $(libldtestplug_la_LIBADD) $(LIBS) @@ -2655,11 +2657,12 @@ install-exec-local: ld-new$(EXEEXT) install-binPROGRAMS fi; \ fi -install-data-local: +install-data-local: install-bfdpluginLTLIBRARIES $(mkinstalldirs) $(DESTDIR)$(scriptdir)/ldscripts for f in ldscripts/* ; do \ $(INSTALL_DATA) $$f $(DESTDIR)$(scriptdir)/$$f ; \ done + rm -f $(DESTDIR)$(bfdplugindir)/libdep.la diststuff: info $(EXTRA_DIST) # Both info (ld.info) and ld.1 depend on configdoc.texi.