[Buildroot] [PATCH 1/1] package/swupdate: fix static build without lua

Fabrice Fontaine fontaine.fabrice at gmail.com
Fri Mar 8 18:19:03 UTC 2019


Hello Thomas,
Le jeu. 7 mars 2019 à 22:43, Thomas Petazzoni
<thomas.petazzoni at bootlin.com> a écrit :
>
> Hello Fabrice,
>
> On Mon,  4 Mar 2019 22:47:20 +0100
> Fabrice Fontaine <fontaine.fabrice at gmail.com> wrote:
>
> > diff --git a/package/swupdate/0001-Makefile-fix-static-build.patch b/package/swupdate/0001-Makefile-fix-static-build.patch
> > new file mode 100644
> > index 0000000000..56901f9871
> > --- /dev/null
> > +++ b/package/swupdate/0001-Makefile-fix-static-build.patch
> > @@ -0,0 +1,62 @@
> > +From 15a324f8c67548f219256a5a75ba8123cc5bdac6 Mon Sep 17 00:00:00 2001
> > +From: Fabrice Fontaine <fontaine.fabrice at gmail.com>
> > +Date: Mon, 4 Mar 2019 21:51:36 +0100
> > +Subject: [PATCH] Makefile: fix static build
> > +
> > +Don't build and install lua_swupdate.so if HAVE_LUA isn't set to y
> > +otherwise build will fail if the toolchain only suports building static
> > +libraries
> > +
> > +Fixes:
> > + - http://autobuild.buildroot.org/results/c11c4d26983e0347d96f3dda62e6d72b031967bb
> > +
> > +Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
> > +[Upstream status: https://github.com/sbabic/swupdate/pull/49]
> > +---
> > + Makefile | 12 +++++++++---
> > + 1 file changed, 9 insertions(+), 3 deletions(-)
> > +
> > +diff --git a/Makefile b/Makefile
> > +index cfeb9a6..cac99b5 100644
> > +--- a/Makefile
> > ++++ b/Makefile
> > +@@ -369,11 +369,15 @@ tools-bins     := $(patsubst $(tools-y)/%.c,$(tools-y)/%,$(wildcard $(tools-y)/*.c))
> > + tools-bins-unstr:= $(patsubst %,%_unstripped,$(tools-bins))
> > + tools-all   := $(tools-objs)
> > +
> > ++ifeq ($(HAVE_LUA),y)
> > ++lua_swupdate        := lua_swupdate.so
> > ++endif
>
> I am a bit confused. How could lua_swupdate.so build at all (even in
> shared library configurations) when HAVE_LUA is not enabled ?
>
> I see the patch has been applied upstream, so I guess it is correct,
> but still that confuses me a bit. Or maybe lua_swupdate.so doesn't link
> with Lua ?
The issue (fixed by the patch) is that swudpate always tries to build
lua_swupdate.so even if there is no object files in this shared
library when CONFIG_LUA is not set.

Here is an extract of bindings/Makefile (see
https://github.com/sbabic/swupdate/commit/624904cc18003fae413011563dac83a333f10509):
obj-$(CONFIG_LUA) += auxiliar.o lua_swupdate.o

>
> Thanks,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

Best Regards,

Fabrice


More information about the buildroot mailing list