[PATCH v3 2/3] debuginfod: create libdebuginfod.so.1 before libdebuginfod.so

Dmitry V. Levin ldv@altlinux.org
Wed Dec 9 00:13:12 GMT 2020


This would allow to switch from "libdebuginfod-" VERSION ".so"
to DEBUGINFOD_SONAME in __libdwfl_debuginfod_init, and to remove the
fall back to dlopen of "libdebuginfod.so" which is no longer needed.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---
 debuginfod/ChangeLog   |  5 +++++
 debuginfod/Makefile.am | 11 ++++++-----
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog
index 6eff25cc..3db34b4a 100644
--- a/debuginfod/ChangeLog
+++ b/debuginfod/ChangeLog
@@ -1,3 +1,8 @@
+2020-12-08  Dmitry V. Levin  <ldv@altlinux.org>
+
+	* Makefile.am [LIBDEBUGINFOD]: Create libdebuginfod.so.1 first, turn
+	libdebuginfod.so into symlink.
+
 2020-11-30  Dmitry V. Levin  <ldv@altlinux.org>
 
 	* Makefile.am (libdebuginfod.so): Replace $@.$(VERSION) with
diff --git a/debuginfod/Makefile.am b/debuginfod/Makefile.am
index 931a0eb9..13afcd2a 100644
--- a/debuginfod/Makefile.am
+++ b/debuginfod/Makefile.am
@@ -99,20 +99,21 @@ libdebuginfod_so_LDLIBS =
 else
 libdebuginfod_so_LDLIBS = $(libcurl_LIBS)
 endif
-libdebuginfod.so: $(srcdir)/libdebuginfod.map $(libdebuginfod_so_LIBS)
+$(LIBDEBUGINFOD_SONAME): $(srcdir)/libdebuginfod.map $(libdebuginfod_so_LIBS)
 	$(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \
 		-Wl,--soname,$(LIBDEBUGINFOD_SONAME) \
 		-Wl,--version-script,$<,--no-undefined \
 		-Wl,--whole-archive $(libdebuginfod_so_LIBS) -Wl,--no-whole-archive \
 		$(libdebuginfod_so_LDLIBS)
 	@$(textrel_check)
-	$(AM_V_at)ln -fs $@ $(LIBDEBUGINFOD_SONAME)
-endif
 
-if LIBDEBUGINFOD
+libdebuginfod.so: $(LIBDEBUGINFOD_SONAME)
+	ln -fs $< $@
+
 install: install-am libdebuginfod.so
 	$(mkinstalldirs) $(DESTDIR)$(libdir)
-	$(INSTALL_PROGRAM) libdebuginfod.so $(DESTDIR)$(libdir)/libdebuginfod-$(PACKAGE_VERSION).so
+	$(INSTALL_PROGRAM) $(LIBDEBUGINFOD_SONAME) \
+		$(DESTDIR)$(libdir)/libdebuginfod-$(PACKAGE_VERSION).so
 	ln -fs libdebuginfod-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/$(LIBDEBUGINFOD_SONAME)
 	ln -fs libdebuginfod-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libdebuginfod.so
 
-- 
ldv


More information about the Elfutils-devel mailing list