From patchwork Mon Jan 20 08:38:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Porcedda X-Patchwork-Id: 312469 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 422112C009B for ; Mon, 20 Jan 2014 19:38:43 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 7A56E94054; Mon, 20 Jan 2014 08:38:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id t56H8xHk8Q-b; Mon, 20 Jan 2014 08:38:42 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id D4ACA9404D; Mon, 20 Jan 2014 08:38:41 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 0E25B1BF966 for ; Mon, 20 Jan 2014 08:38:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 09D8A9403B for ; Mon, 20 Jan 2014 08:38:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id L0HnFQkUWVNY for ; Mon, 20 Jan 2014 08:38:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by hemlock.osuosl.org (Postfix) with ESMTPS id 5F44194037 for ; Mon, 20 Jan 2014 08:38:39 +0000 (UTC) Received: by mail-pa0-f44.google.com with SMTP id kq14so6728649pab.17 for ; Mon, 20 Jan 2014 00:38:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=IkPJIWmRNxn7jvCR0YBDnZyoZOhAi8mO2rrDLARuTrg=; b=vlld8WCEBNKn73p/Zkd1q4OWn+Mli0DUiPWrxAzj2yld1+CgglcHCP+e+c3cS8zZrU BHzsaBPbrc4jYPM2HvFwEKJmHUTTDdKkP/V0zlSGN2oWi+lJXQ9hAslWg43rvzYa9NOf Qks4xf1ujv89b4hgiUJt/qjeDqFBOmv6cYurrH8fBXz8AudDOj86Y0qqPzqcRDmyu62J KpUudjop4/pHGtd/foODXIYTHK6NYctbqbEtsZyW+scNO4uHQZqpj6AilGiMcTB6LzPw 3eJ4E/xgVw+aOXxagOnjQqBSfIw1Fzk/9nEWNJxydcZXJ4AeF69IFOL67ax7SGZ2GwPV wkzA== X-Received: by 10.66.136.107 with SMTP id pz11mr17474177pab.118.1390207118753; Mon, 20 Jan 2014 00:38:38 -0800 (PST) Received: from ld2077.tmt.telital.com ([213.205.6.118]) by mx.google.com with ESMTPSA id sy10sm1542212pac.15.2014.01.20.00.38.37 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 20 Jan 2014 00:38:38 -0800 (PST) From: Fabio Porcedda To: buildroot@uclibc.org Date: Mon, 20 Jan 2014 09:38:34 +0100 Message-Id: <1390207114-2808-1-git-send-email-fabio.porcedda@gmail.com> X-Mailer: git-send-email 1.8.5.2 Subject: [Buildroot] [PATCH] lvm2: fix static building when BR2_PREFER_STATIC_LIB is used X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net To fix static building: - Add "--enable-static_link" to the configure options. - Because the shared executables don't build with BR2_PREFER_STATIC_LIB add a patch to disable it. Fixes: http://autobuild.buildroot.net/results/b0b/b0b386969459dda9c294f1ccb4927ca225fa6bdd/ Signed-off-by: Fabio Porcedda --- ...le-static_link-disable-building-of-shared.patch | 75 ++++++++++++++++++++++ package/lvm2/lvm2.mk | 4 ++ 2 files changed, 79 insertions(+) create mode 100644 package/lvm2/lvm2-Option-enable-static_link-disable-building-of-shared.patch diff --git a/package/lvm2/lvm2-Option-enable-static_link-disable-building-of-shared.patch b/package/lvm2/lvm2-Option-enable-static_link-disable-building-of-shared.patch new file mode 100644 index 0000000..7824edd --- /dev/null +++ b/package/lvm2/lvm2-Option-enable-static_link-disable-building-of-shared.patch @@ -0,0 +1,75 @@ +From 5c0c0bfcb876bc5a3a05e556854199ff7215d794 Mon Sep 17 00:00:00 2001 +From: Fabio Porcedda +Date: Mon, 20 Jan 2014 09:09:06 +0100 +Subject: [PATCH] Option --enable-static_link disable building of shared + executables + +Also build the static executables without the ".static" suffix so use +the same name of the shared executables. + +Signed-off-by: Fabio Porcedda +--- + tools/Makefile.in | 21 +++++++++++---------- + 1 file changed, 11 insertions(+), 10 deletions(-) + +diff --git a/tools/Makefile.in b/tools/Makefile.in +index f90cfae..3d3524a 100644 +--- a/tools/Makefile.in ++++ b/tools/Makefile.in +@@ -78,13 +78,10 @@ TARGETS_DM = dmsetup + + INSTALL_LVM_TARGETS = install_tools_dynamic + INSTALL_DMSETUP_TARGETS = install_dmsetup_dynamic ++ + INSTALL_CMDLIB_TARGETS = install_cmdlib_dynamic install_cmdlib_include + + ifeq ("@STATIC_LINK@", "yes") +- TARGETS += lvm.static +- TARGETS_DM += dmsetup.static +- INSTALL_LVM_TARGETS += install_tools_static +- INSTALL_DMSETUP_TARGETS += install_dmsetup_static + INSTALL_CMDLIB_TARGETS += install_cmdlib_static + endif + +@@ -121,28 +118,32 @@ LIBS += $(UDEV_LIBS) + + device-mapper: $(TARGETS_DM) + ++ifneq ("@STATIC_LINK@", "yes") + dmsetup: dmsetup.o $(top_builddir)/libdm/libdevmapper.$(LIB_SUFFIX) + $(CC) $(CFLAGS) $(LDFLAGS) -L$(top_builddir)/libdm \ + -o $@ dmsetup.o -ldevmapper $(LIBS) +- +-dmsetup.static: dmsetup.o $(interfacebuilddir)/libdevmapper.a ++else ++dmsetup: dmsetup.o $(interfacebuilddir)/libdevmapper.a + $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) \ + -o $@ dmsetup.o -ldevmapper $(STATIC_LIBS) $(LIBS) ++endif + + all: device-mapper + ++ifneq ("@STATIC_LINK@", "yes") + lvm: $(OBJECTS) lvm.o $(top_builddir)/lib/liblvm-internal.a + $(CC) $(CFLAGS) $(LDFLAGS) $(ELDFLAGS) -o $@ $(OBJECTS) lvm.o \ + $(LVMLIBS) $(READLINE_LIBS) $(LIBS) -rdynamic ++else ++lvm: $(OBJECTS) lvm-static.o $(top_builddir)/lib/liblvm-internal.a $(interfacebuilddir)/libdevmapper.a ++ $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) -o $@ \ ++ $(OBJECTS) lvm-static.o $(LVMLIBS) $(STATIC_LIBS) $(LIBS) ++endif + + ifeq ("@BUILD_LVMETAD@", "yes") + lvm: $(top_builddir)/libdaemon/client/libdaemonclient.a + endif + +-lvm.static: $(OBJECTS) lvm-static.o $(top_builddir)/lib/liblvm-internal.a $(interfacebuilddir)/libdevmapper.a +- $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) -o $@ \ +- $(OBJECTS) lvm-static.o $(LVMLIBS) $(STATIC_LIBS) $(LIBS) +- + liblvm2cmd.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o + cat $(top_builddir)/lib/liblvm-internal.a > $@ + $(AR) rs $@ $(OBJECTS) lvmcmdlib.o lvm2cmd.o +-- +1.8.5.2 + diff --git a/package/lvm2/lvm2.mk b/package/lvm2/lvm2.mk index 6566b32..35d5108 100644 --- a/package/lvm2/lvm2.mk +++ b/package/lvm2/lvm2.mk @@ -39,4 +39,8 @@ else LVM2_CONF_OPT += --disable-applib endif +ifeq ($(BR2_PREFER_STATIC_LIB),y) +LVM2_CONF_OPT += --enable-static_link +endif + $(eval $(autotools-package))