From 8cd7e198adaf4be2298d36e0721eda661b5f996b Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 19 May 2019 08:51:28 +0100 Subject: [PATCH] btrfs-progs: build: apply LDFLAGS to libbtrfsutil.so MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit libbtrfs.so already has user's LDFLAGS applied. The change also applies those to libbtrfsutil.so. A separate variable is used for that though it currently only copies LDFLAGS. This is to make it obvious that libbtrfsutils is a standalone library. Reported-by: Michał Górny Bug: https://bugs.gentoo.org/686284 Pull-request: #172 Signed-off-by: Sergei Trofimovich Signed-off-by: David Sterba --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2861b6a1..09c87263 100644 --- a/Makefile +++ b/Makefile @@ -102,6 +102,11 @@ LDFLAGS = $(SUBST_LDFLAGS) \ $(DEBUG_LDFLAGS_INTERNAL) \ $(EXTRA_LDFLAGS) +LIBBTRFSUTIL_LDFLAGS = $(SUBST_LDFLAGS) \ + -rdynamic -L$(TOPDIR) \ + $(DEBUG_LDFLAGS_INTERNAL) \ + $(EXTRA_LDFLAGS) + LIBS = $(LIBS_BASE) LIBBTRFS_LIBS = $(LIBS_BASE) @@ -428,7 +433,7 @@ libbtrfsutil/%.o: libbtrfsutil/%.c libbtrfsutil.so.$(libbtrfsutil_version): $(libbtrfsutil_objects) @echo " [LD] $@" - $(Q)$(CC) $(LIBBTRFSUTIL_CFLAGS) $(libbtrfsutil_objects) \ + $(Q)$(CC) $(LIBBTRFSUTIL_CFLAGS) $(libbtrfsutil_objects) $(LIBBTRFSUTIL_LDFLAGS) \ -shared -Wl,-soname,libbtrfsutil.so.$(libbtrfsutil_major) -o $@ libbtrfsutil.a: $(libbtrfsutil_objects)