btrfs-progs: build: apply LDFLAGS to libbtrfsutil.so

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 <slyfox@gentoo.org>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Sergei Trofimovich 2019-05-19 08:51:28 +01:00 committed by David Sterba
parent 66cb960705
commit 8cd7e198ad
1 changed files with 6 additions and 1 deletions

View File

@ -102,6 +102,11 @@ LDFLAGS = $(SUBST_LDFLAGS) \
$(DEBUG_LDFLAGS_INTERNAL) \ $(DEBUG_LDFLAGS_INTERNAL) \
$(EXTRA_LDFLAGS) $(EXTRA_LDFLAGS)
LIBBTRFSUTIL_LDFLAGS = $(SUBST_LDFLAGS) \
-rdynamic -L$(TOPDIR) \
$(DEBUG_LDFLAGS_INTERNAL) \
$(EXTRA_LDFLAGS)
LIBS = $(LIBS_BASE) LIBS = $(LIBS_BASE)
LIBBTRFS_LIBS = $(LIBS_BASE) LIBBTRFS_LIBS = $(LIBS_BASE)
@ -428,7 +433,7 @@ libbtrfsutil/%.o: libbtrfsutil/%.c
libbtrfsutil.so.$(libbtrfsutil_version): $(libbtrfsutil_objects) libbtrfsutil.so.$(libbtrfsutil_version): $(libbtrfsutil_objects)
@echo " [LD] $@" @echo " [LD] $@"
$(Q)$(CC) $(LIBBTRFSUTIL_CFLAGS) $(libbtrfsutil_objects) \ $(Q)$(CC) $(LIBBTRFSUTIL_CFLAGS) $(libbtrfsutil_objects) $(LIBBTRFSUTIL_LDFLAGS) \
-shared -Wl,-soname,libbtrfsutil.so.$(libbtrfsutil_major) -o $@ -shared -Wl,-soname,libbtrfsutil.so.$(libbtrfsutil_major) -o $@
libbtrfsutil.a: $(libbtrfsutil_objects) libbtrfsutil.a: $(libbtrfsutil_objects)