1From d5cbb4f43cc9c30100fbf18a3e0d1fb95e1c1b0a Mon Sep 17 00:00:00 2001
2From: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
3Date: Wed, 25 Nov 2015 10:50:00 +0000
4Subject: [PATCH] mdrestore, scrub: do not do dynamic linking of libtool
5 libraries
6
7As explained in commit ece49daeff1a3cad765e106d678c608925c9d768, use
8-static-libtool-libs instead of -static to allow fallback to the dynamic
9linking for libuuid only. Otherwise the build will fail like this:
10
11ld: attempted static link of dynamic object `/usr/lib/libuuid.so'
12
13Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
14[Sent upstream: https://www.spinics.net/lists/xfs/msg36149.html]
15[baruch: update for v4.15.1; extend to include scrub]
16Signed-off-by: Baruch Siach <baruch@tkos.co.il>
17[matt: update for v4.16.1; adjusted libunistring -> libicu]
18Signed-off-by: Matt Weber <matthew.weber@rockwellcollins.com>
19---
20 mdrestore/Makefile | 2 +-
21 scrub/Makefile     | 2 +-
22 2 files changed, 2 insertions(+), 2 deletions(-)
23
24diff --git a/mdrestore/Makefile b/mdrestore/Makefile
25index 136ae716d691..75ff1bad78e9 100644
26--- a/mdrestore/Makefile
27+++ b/mdrestore/Makefile
28@@ -10,7 +10,7 @@ CFILES = xfs_mdrestore.c
29
30 LLDLIBS = $(LIBXFS) $(LIBFROG) $(LIBRT) $(LIBPTHREAD) $(LIBUUID)
31 LTDEPENDENCIES = $(LIBXFS) $(LIBFROG)
32-LLDFLAGS = -static
33+LLDFLAGS = -static-libtool-libs
34
35 default: depend $(LTCOMMAND)
36
37diff --git a/scrub/Makefile b/scrub/Makefile
38index 063279400262..949f6fd8ba94 100644
39--- a/scrub/Makefile
40+++ b/scrub/Makefile
41@@ -70,7 +70,7 @@ xfs_scrub.c
42
43 LLDLIBS += $(LIBHANDLE) $(LIBFROG) $(LIBPTHREAD) $(LIBICU_LIBS) $(LIBRT)
44 LTDEPENDENCIES += $(LIBHANDLE) $(LIBFROG)
45-LLDFLAGS = -static
46+LLDFLAGS = -static-libtool-libs
47
48 ifeq ($(HAVE_MALLINFO),yes)
49 LCFLAGS += -DHAVE_MALLINFO
50--
512.16.2
52
53