Skip to contentSkip to conversation

package/makedumpfile: fix build with musl libc

PATCH In review Alexander Egorenkov 2 participants 2 messages Jul 31, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/makedumpfile: fix build with musl libc

http://autobuild.buildroot.net/results/7a0ef4f3f3d3ecc6b84a573409302eae5ec90e39/

Fixes 6a1c376492d6 ("package/makedumpfile: enable build with musl libc")
---
 .../0003-Fix-build-with-musl-libc.patch       | 27 +++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 package/makedumpfile/0003-Fix-build-with-musl-libc.patch
package/makedumpfile/0003-Fix-build-with-musl-libc.patch new file +27 -0
new file mode 100644
index 000000000000..26718fb7f6b9
@@ -0,0 +1,27 @@
+From 3ae383c5dfdbd4dc5cfb888b3cc187819658068b Mon Sep 17 00:00:00 2001
+From: Alexander Egorenkov <[email protected]>
+Date: Wed, 31 Jul 2024 07:43:50 +0200
+Subject: [PATCH 1/1] Fix build with musl libc
+
+musl libc defines PAGESIZE in its limits.h header file.
+
+Signed-off-by: Alexander Egorenkov <[email protected]>
+---
+ makedumpfile.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/makedumpfile.h b/makedumpfile.h
+index 6b43a8b44f93..54e894bfee2b 100644
+--- a/makedumpfile.h
++++ b/makedumpfile.h
+@@ -169,6 +169,7 @@ test_bit(int nr, unsigned long addr)
+ #define PTOB(X)			(((unsigned long long)(X)) << PAGESHIFT())
+ #define BTOP(X)			(((unsigned long long)(X)) >> PAGESHIFT())
+ 
++#undef PAGESIZE /* musl's limits.h defines PAGESIZE */
+ #define PAGESIZE()		(info->page_size)
+ #define PAGESHIFT()		(info->page_shift)
+ #define PAGEOFFSET(X)		(((unsigned long long)(X)) & (PAGESIZE() - 1))
+-- 
+2.46.0
+
Signature · 6 lines
2.46.0

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

Hello Alexander,

Quoted 6 lines · On Wed, 31 Jul 2024 06:12:35 +0000 Alexander Egorenkov…
package/makedumpfile/0003-Fix-build-with-musl-libc.patch new file +0 -0
new file mode 100644
index 000000000000..26718fb7f6b9

package/makedumpfile/0003-Fix-build-with-musl-libc.patch line 8

Quoted 8 lines
package/makedumpfile/0003-Fix-build-with-musl-libc.patch new file +8 -0
@@ -0,0 +1,27 @@
+From 3ae383c5dfdbd4dc5cfb888b3cc187819658068b Mon Sep 17 00:00:00 2001
+From: Alexander Egorenkov <[email protected]>
+Date: Wed, 31 Jul 2024 07:43:50 +0200
+Subject: [PATCH 1/1] Fix build with musl libc
+
+musl libc defines PAGESIZE in its limits.h header file.
+
+Signed-off-by: Alexander Egorenkov <[email protected]>

Thanks for your patch. However, we now require all patches to carry an
Upstream: tag that points either to the upstream commit being backported, or the submission of the patch made to the upstream project (link to the mailing list archive, link to the pull request, etc.).

This is pointed out by "make check-package".

Could you have a look at submitting this patch upstream, and add the
Upstream: tag?

package/makedumpfile/0003-Fix-build-with-musl-libc.patch line 21

Quoted 9 lines
package/makedumpfile/0003-Fix-build-with-musl-libc.patch new file +9 -0
+diff --git a/makedumpfile.h b/makedumpfile.h
+index 6b43a8b44f93..54e894bfee2b 100644
+--- a/makedumpfile.h
++++ b/makedumpfile.h
+@@ -169,6 +169,7 @@ test_bit(int nr, unsigned long addr)
+ #define PTOB(X)			(((unsigned long long)(X)) << PAGESHIFT())
+ #define BTOP(X)			(((unsigned long long)(X)) >> PAGESHIFT())
+ 
++#undef PAGESIZE /* musl's limits.h defines PAGESIZE */

Is this the right thing to do?

package/makedumpfile/0003-Fix-build-with-musl-libc.patch line 23

Quoted 2 lines
package/makedumpfile/0003-Fix-build-with-musl-libc.patch new file +2 -0
+ #define PAGESIZE()		(info->page_size)
+ #define PAGESHIFT()		(info->page_shift)

These macros that assume "info" is an available variable are anyway really atrocious :-/

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot