All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/swupdate: workaround runtime update failure
@ 2023-11-23 17:39 Giulio Benetti
  2023-11-24 21:59 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 4+ messages in thread
From: Giulio Benetti @ 2023-11-23 17:39 UTC (permalink / raw)
  To: buildroot
  Cc: Giulio Benetti, Jim Reinhart, Matthew Maron, James Autry,
	Giulio Benetti

From: Giulio Benetti <giulio.benetti+tekvox@benettiengineering.com>

If SWUpdate is built using -Os optimization it will fail to update using
Mongoose webserver randomly and always while using option
installed-directly in .swu file generation. So let's workaround the bug
by building with -O3.

Reported upstream:
https://groups.google.com/g/swupdate/c/oHMihNw8ZHA

Cc: Jim Reinhart <jimr@tekvox.com>
Cc: James Autry <jautry@tekvox.com>
Cc: Matthew Maron <matthewm@tekvox.com>
Signed-off-by: Giulio Benetti <giulio.benetti+tekvox@benettiengineering.com>
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 package/swupdate/swupdate.mk | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/package/swupdate/swupdate.mk b/package/swupdate/swupdate.mk
index ea4a5a62e5..7801be07ce 100644
--- a/package/swupdate/swupdate.mk
+++ b/package/swupdate/swupdate.mk
@@ -217,10 +217,19 @@ endif
 SWUPDATE_KCONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_SWUPDATE_CONFIG))
 SWUPDATE_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig
 
+SWUPDATE_CFLAGS = $(TARGET_CFLAGS)
+
+# Workaround update failure showing up with -Os
+# Reported here:
+# https://groups.google.com/g/swupdate/c/oHMihNw8ZHA
+ifeq ($(BR2_OPTIMIZE_S),y)
+SWUPDATE_CFLAGS += -O3
+endif
+
 SWUPDATE_MAKE_OPTS = \
 	SWU_VER="$(SWUPDATE_VERSION) (Buildroot $(BR2_VERSION_FULL))" \
 	CROSS_COMPILE="$(TARGET_CROSS)" \
-	CONFIG_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
+	CONFIG_EXTRA_CFLAGS="$(SWUPDATE_CFLAGS)" \
 	CONFIG_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)"
 
 define SWUPDATE_KCONFIG_FIXUP_CMDS
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-11-29 21:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-23 17:39 [Buildroot] [PATCH] package/swupdate: workaround runtime update failure Giulio Benetti
2023-11-24 21:59 ` Thomas Petazzoni via buildroot
2023-11-25  0:24   ` Giulio Benetti
2023-11-29 21:38     ` Thomas Petazzoni via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.