Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Larysch <fl@n621.de>
To: buildroot@buildroot.org
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Florian Larysch <fl@n621.de>
Subject: [Buildroot] [PATCH 1/1] package/flashrom: fix build on big-endian targets
Date: Mon, 13 Apr 2026 02:04:22 +0200	[thread overview]
Message-ID: <20260413000423.9275-1-fl@n621.de> (raw)

flashrom 1.7.0 fails to build on big-endian targets because of an errant
compile guard. Import the pending upstream patch that fixes it.

Fixes: https://autobuild.buildroot.org/results/d75/d75f5a555b7ad1a99ffe46298bf6f527f3bafbc9

Signed-off-by: Florian Larysch <fl@n621.de>
---
 ...hrom-fix-build-on-big-endian-targets.patch | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 package/flashrom/0001-libflashrom-fix-build-on-big-endian-targets.patch

diff --git a/package/flashrom/0001-libflashrom-fix-build-on-big-endian-targets.patch b/package/flashrom/0001-libflashrom-fix-build-on-big-endian-targets.patch
new file mode 100644
index 0000000000..f09a39d137
--- /dev/null
+++ b/package/flashrom/0001-libflashrom-fix-build-on-big-endian-targets.patch
@@ -0,0 +1,54 @@
+From 13c19fccd7946c692e587e308c916a1090d3592d Mon Sep 17 00:00:00 2001
+From: Florian Larysch <fl@n621.de>
+Date: Mon, 13 Apr 2026 01:40:52 +0200
+Subject: [PATCH] libflashrom: fix build on big-endian targets
+
+Commit f74f02e2 ("Add guard for compare_region_with_dump()") added
+little-endian-only compile guards to that function because it was only
+used on little-endian systems and caused -Wunused-function to trip on
+other targets.
+
+When b0b975d0 ("libflashrom: Add new layout_compare() function with
+test") introduced flashrom_layout_compare(), it included the new
+function within those guards too, but this isn't necessary:
+compare_region_with_dump() is not sensitive to endianess and adding that
+new dependent actually made the original reason for adding the guard
+obsolete.
+
+However, now building on big-endian architectures fails because
+cli_classic.c unconditionally refers to flashrom_layout_compare().
+
+Resolve this by simply removing the guard.
+
+Fixes: https://ticket.coreboot.org/issues/635
+
+Change-Id: If3e6828e6445e0708e1174728f91053e48a097ba
+Signed-off-by: Florian Larysch <fl@n621.de>
+Upstream: https://review.coreboot.org/c/flashrom/+/92156
+---
+ libflashrom.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/libflashrom.c b/libflashrom.c
+index 159e3924..503386fa 100644
+--- a/libflashrom.c
++++ b/libflashrom.c
+@@ -462,7 +462,6 @@ bool flashrom_flag_get(const struct flashrom_flashctx *const flashctx, const enu
+ 	}
+ }
+ 
+-#ifdef __FLASHROM_LITTLE_ENDIAN__
+ static int compare_region_with_dump(const struct romentry *const a, const struct romentry *const b)
+ {
+ 	if (a->region.start != b->region.start
+@@ -508,7 +507,6 @@ int flashrom_layout_compare(const struct flashrom_layout *layout1,
+ 
+ 	return 0;
+ }
+-#endif /* __FLASHROM_LITTLE_ENDIAN__ */
+ 
+ int flashrom_layout_read_from_ifd(struct flashrom_layout **const layout, struct flashctx *const flashctx,
+ 				  const void *const dump, const size_t len)
+-- 
+2.53.0
+
-- 
2.53.0

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

             reply	other threads:[~2026-04-13  0:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-13  0:04 Florian Larysch [this message]
2026-04-24 21:59 ` [Buildroot] [PATCH 1/1] package/flashrom: fix build on big-endian targets Julien Olivain via buildroot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260413000423.9275-1-fl@n621.de \
    --to=fl@n621.de \
    --cc=buildroot@buildroot.org \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox