kumquat-buildroot/package/xfsprogs/0001-mdrestore-do-not-do-dynamic-linking-of-libtool-libra.patch
Baruch Siach a81601589e xfsprogs: fix build with libunistring
The latest xfsprogs bump to version 4.15.1 added an optional dependency
on libunistring. Make sure we build libunistring before xfsprogs.

xfsprogs also added -lunistring to its make dependency. This does not
work very well with cross compilation because make does not know about
sysroot. Add a patch to remove this dependency.

To make shared only link with libunistring work, we also need to extend
the -static-libtool-libs patch to cover xfs_scrub as well.

Fixes:
http://autobuild.buildroot.net/results/66e/66e425b00a06f928be0951ac4196190fe88b0f62/
http://autobuild.buildroot.net/results/1cd/1cde87d1daf3c6009220ff47512794cef6a2938f/
http://autobuild.buildroot.net/results/8ba/8ba4e94cfbb8a5cbb166423a671bdbcdf535f86b/

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2018-03-23 16:31:58 +01:00

51 lines
1.6 KiB
Diff

From d5cbb4f43cc9c30100fbf18a3e0d1fb95e1c1b0a Mon Sep 17 00:00:00 2001
From: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Date: Wed, 25 Nov 2015 10:50:00 +0000
Subject: [PATCH] mdrestore, scrub: do not do dynamic linking of libtool
libraries
As explained in commit ece49daeff1a3cad765e106d678c608925c9d768, use
-static-libtool-libs instead of -static to allow fallback to the dynamic
linking for libuuid only. Otherwise the build will fail like this:
ld: attempted static link of dynamic object `/usr/lib/libuuid.so'
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
[Sent upstream: https://www.spinics.net/lists/xfs/msg36149.html]
[baruch: update for v4.15.1; extend to include scrub]
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
mdrestore/Makefile | 2 +-
scrub/Makefile | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/mdrestore/Makefile b/mdrestore/Makefile
index 136ae716d691..75ff1bad78e9 100644
--- a/mdrestore/Makefile
+++ b/mdrestore/Makefile
@@ -10,7 +10,7 @@ CFILES = xfs_mdrestore.c
LLDLIBS = $(LIBXFS) $(LIBFROG) $(LIBRT) $(LIBPTHREAD) $(LIBUUID)
LTDEPENDENCIES = $(LIBXFS) $(LIBFROG)
-LLDFLAGS = -static
+LLDFLAGS = -static-libtool-libs
default: depend $(LTCOMMAND)
diff --git a/scrub/Makefile b/scrub/Makefile
index 063279400262..949f6fd8ba94 100644
--- a/scrub/Makefile
+++ b/scrub/Makefile
@@ -70,7 +70,7 @@ xfs_scrub.c
LLDLIBS += $(LIBHANDLE) $(LIBFROG) $(LIBPTHREAD) $(LIBUNISTRING) $(LIBRT)
LTDEPENDENCIES += $(LIBHANDLE) $(LIBFROG) $(LIBUNISTRING) $(LIBRT)
-LLDFLAGS = -static
+LLDFLAGS = -static-libtool-libs
ifeq ($(HAVE_MALLINFO),yes)
LCFLAGS += -DHAVE_MALLINFO
--
2.16.2