Skip to contentSkip to conversation

package/kexec: fix powerpc build

PATCH Applied Bernd Kuhls 2 participants 3 messages May 24 – May 29

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/kexec: fix powerpc build

Added two upstream commits to fix build errors on powerpc.

The build error also occurs with kexec 2.0.30 on the 2025.02.x branch so a backport to LTS branches should be considered:
https://autobuild.buildroot.net/results/2ec/2ec0d85c658f8264fcc4eef2deb6c67671e3e7ae/

Fixes:
https://autobuild.buildroot.net/results/53b/53bafc454533aeafc21116a99d87391b3049e12a/

---
 ...ix-function-signature-of-comparefunc.patch | 42 +++++++++++++++
 ...rations-in-read-memory_region_limits.patch | 54 +++++++++++++++++++
 2 files changed, 96 insertions(+)
 create mode 100644 package/kexec/0001-kexec-tools-powerpc-Fix-function-signature-of-comparefunc.patch
 create mode 100644 package/kexec/0002-kexec-tools-powerpc-Fix-pointer-declarations-in-read-memory_region_limits.patch
package/kexec/0001-kexec-tools-powerpc-Fix-function-signature-of-comparefunc.patch new file +42 -0
new file mode 100644
index 0000000000..809e91e939
@@ -0,0 +1,42 @@
+From b89799f7f20d4b2476e99e95e6795450f2f1c111 Mon Sep 17 00:00:00 2001
+From: John Paul Adrian Glaubitz <[email protected]>
+Date: Wed, 22 Oct 2025 13:44:12 +0200
+Subject: kexec-tools: powerpc: Fix function signature of comparefunc()
+
+Fixes the following build error on 32-bit PowerPC:
+
+kexec/arch/ppc/fs2dt.c: In function 'putnode':
+kexec/arch/ppc/fs2dt.c:338:51: error: passing argument 4 of 'scandir' from incompatible pointer type [-Wincompatible-pointer-types]
+  338 |         numlist = scandir(pathname, &namelist, 0, comparefunc);
+      |                                                   ^~~~~~~~~~~
+      |                                                   |
+      |                                                   int (*)(const void *, const void *)
+
+Signed-off-by: John Paul Adrian Glaubitz <[email protected]>
+Reviewed-by: Khalid Aziz <[email protected]>
+Signed-off-by: Simon Horman <[email protected]>
+
+Upstream: https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/commit/?id=b89799f7f20d4b2476e99e95e6795450f2f1c111
+
+Signed-off-by: Bernd Kuhls <[email protected]>
+---
+ kexec/arch/ppc/fs2dt.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/kexec/arch/ppc/fs2dt.c b/kexec/arch/ppc/fs2dt.c
+index fed499b..d03b995 100644
+--- a/kexec/arch/ppc/fs2dt.c
++++ b/kexec/arch/ppc/fs2dt.c
+@@ -292,7 +292,8 @@ static void putprops(char *fn, struct dirent **nlist, int numlist)
+  * Compare function used to sort the device-tree directories
+  * This function will be passed to scandir.
+  */
+-static int comparefunc(const void *dentry1, const void *dentry2)
++static int comparefunc(const struct dirent **dentry1,
++		       const struct dirent **dentry2)
+ {
+ 	char *str1 = (*(struct dirent **)dentry1)->d_name;
+ 	char *str2 = (*(struct dirent **)dentry2)->d_name;
+-- 
+cgit 1.3-korg
+
package/kexec/0002-kexec-tools-powerpc-Fix-pointer-declarations-in-read-memory_region_limits.patch new file +54 -0

54 lines not on this page · raw message

Signature · 6 lines
2.47.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 10 lines · Bernd Kuhls

Added two upstream commits to fix build errors on powerpc.

The build error also occurs with kexec 2.0.30 on the 2025.02.x branch so a backport to LTS branches should be considered:
https://autobuild.buildroot.net/results/2ec/2ec0d85c658f8264fcc4eef2deb6c67671e3e7ae/

Fixes:
https://autobuild.buildroot.net/results/53b/53bafc454533aeafc21116a99d87391b3049e12a/

Applied to master, thanks.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw
In reply to Bernd Kuhls

In reply of:

Quoted 10 lines

Added two upstream commits to fix build errors on powerpc.

The build error also occurs with kexec 2.0.30 on the 2025.02.x branch so a backport to LTS branches should be considered:
https://autobuild.buildroot.net/results/2ec/2ec0d85c658f8264fcc4eef2deb6c67671e3e7ae/

Fixes:
https://autobuild.buildroot.net/results/53b/53bafc454533aeafc21116a99d87391b3049e12a/

Applied to 2025.02.x & 2026.02.x. Thanks

Quoted 122 lines
---
 ...ix-function-signature-of-comparefunc.patch | 42 +++++++++++++++
 ...rations-in-read-memory_region_limits.patch | 54 +++++++++++++++++++
 2 files changed, 96 insertions(+)
 create mode 100644 package/kexec/0001-kexec-tools-powerpc-Fix-function-signature-of-comparefunc.patch
 create mode 100644 package/kexec/0002-kexec-tools-powerpc-Fix-pointer-declarations-in-read-memory_region_limits.patch
package/kexec/0001-kexec-tools-powerpc-Fix-function-signature-of-comparefunc.patch new file +42 -0
new file mode 100644
index 0000000000..809e91e939
@@ -0,0 +1,42 @@
+From b89799f7f20d4b2476e99e95e6795450f2f1c111 Mon Sep 17 00:00:00 2001
+From: John Paul Adrian Glaubitz <[email protected]>
+Date: Wed, 22 Oct 2025 13:44:12 +0200
+Subject: kexec-tools: powerpc: Fix function signature of comparefunc()
+
+Fixes the following build error on 32-bit PowerPC:
+
+kexec/arch/ppc/fs2dt.c: In function 'putnode':
+kexec/arch/ppc/fs2dt.c:338:51: error: passing argument 4 of 'scandir' from incompatible pointer type [-Wincompatible-pointer-types]
+  338 |         numlist = scandir(pathname, &namelist, 0, comparefunc);
+      |                                                   ^~~~~~~~~~~
+      |                                                   |
+      |                                                   int (*)(const void *, const void *)
+
+Signed-off-by: John Paul Adrian Glaubitz <[email protected]>
+Reviewed-by: Khalid Aziz <[email protected]>
+Signed-off-by: Simon Horman <[email protected]>
+
+Upstream: https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/commit/?id=b89799f7f20d4b2476e99e95e6795450f2f1c111
+
+Signed-off-by: Bernd Kuhls <[email protected]>
+---
+ kexec/arch/ppc/fs2dt.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/kexec/arch/ppc/fs2dt.c b/kexec/arch/ppc/fs2dt.c
+index fed499b..d03b995 100644
+--- a/kexec/arch/ppc/fs2dt.c
++++ b/kexec/arch/ppc/fs2dt.c
+@@ -292,7 +292,8 @@ static void putprops(char *fn, struct dirent **nlist, int numlist)
+  * Compare function used to sort the device-tree directories
+  * This function will be passed to scandir.
+  */
+-static int comparefunc(const void *dentry1, const void *dentry2)
++static int comparefunc(const struct dirent **dentry1,
++		       const struct dirent **dentry2)
+ {
+ 	char *str1 = (*(struct dirent **)dentry1)->d_name;
+ 	char *str2 = (*(struct dirent **)dentry2)->d_name;
+-- 
+cgit 1.3-korg
+
package/kexec/0002-kexec-tools-powerpc-Fix-pointer-declarations-in-read-memory_region_limits.patch new file +54 -0
new file mode 100644
index 0000000000..ed6c7bb392
@@ -0,0 +1,54 @@
+From 8ac3a7e08957fcb3fa59c9fc4e9c283b9a072ce6 Mon Sep 17 00:00:00 2001
+From: John Paul Adrian Glaubitz <[email protected]>
+Date: Wed, 22 Oct 2025 13:44:13 +0200
+Subject: kexec-tools: powerpc: Fix pointer declarations in
+ read_memory_region_limits()
+
+Fixes the following two build errors on 32-bit PowerPC:
+
+kexec/arch/ppc/kexec-ppc.c: In function 'read_memory_region_limits':
+kexec/arch/ppc/kexec-ppc.c:106:11: error: assignment to 'long long unsigned int *' from incompatible pointer type 'long unsigned int *' [-Wincompatible-pointer-types]
+  106 |         p = (unsigned long*)buf;
+      |           ^
+
+kexec/arch/ppc/kexec-ppc.c: In function 'read_memory_region_limits':
+kexec/arch/ppc/kexec-ppc.c:112:19: error: assignment to 'long unsigned int *' from incompatible pointer type 'long long unsigned int *' [-Wincompatible-pointer-types]
+  112 |                 p = (unsigned long long *)p + 1;
+      |                   ^
+
+Signed-off-by: John Paul Adrian Glaubitz <[email protected]>
+Reviewed-by: Khalid Aziz <[email protected]>
+Signed-off-by: Simon Horman <[email protected]>
+
+Upstream: https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/patch/?id=8ac3a7e08957fcb3fa59c9fc4e9c283b9a072ce6
+
+Signed-off-by: Bernd Kuhls <[email protected]>
+---
+ kexec/arch/ppc/kexec-ppc.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/kexec/arch/ppc/kexec-ppc.c b/kexec/arch/ppc/kexec-ppc.c
+index d3dad0f..e173433 100644
+--- a/kexec/arch/ppc/kexec-ppc.c
++++ b/kexec/arch/ppc/kexec-ppc.c
+@@ -91,7 +91,7 @@ int read_memory_region_limits(int fd, unsigned long long *start,
+ 				unsigned long long *end)
+ {
+ 	char buf[MAXBYTES];
+-	unsigned long *p;
++	unsigned long long *p;
+ 	unsigned long nbytes = dt_address_cells + dt_size_cells;
+ 
+ 	if (lseek(fd, 0, SEEK_SET) == -1) {
+@@ -103,7 +103,7 @@ int read_memory_region_limits(int fd, unsigned long long *start,
+ 		return -1;
+ 	}
+ 
+-	p = (unsigned long*)buf;
++	p = (unsigned long long*)buf;
+ 	if (dt_address_cells == sizeof(unsigned long)) {
+ 		*start = p[0];
+ 		p++;
+-- 
+cgit 1.3-korg
+
Signature · 6 lines
2.47.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot