diff mbox series

[1/1] package/makedumpfile: fix build with musl libc

Message ID 20240731061235.18090-1-egorenar-dev@posteo.net
State Changes Requested
Headers show
Series [1/1] package/makedumpfile: fix build with musl libc | expand

Commit Message

Alexander Egorenkov July 31, 2024, 6:12 a.m. UTC
http://autobuild.buildroot.net/results/7a0ef4f3f3d3ecc6b84a573409302eae5ec90e39/

Fixes: 6a1c376492d6 ("package/makedumpfile: enable build with musl libc")
Signed-off-by: Alexander Egorenkov <egorenar-dev@posteo.net>
---
 .../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

Comments

Thomas Petazzoni July 31, 2024, 10:24 a.m. UTC | #1
Hello Alexander,

On Wed, 31 Jul 2024 06:12:35 +0000
Alexander Egorenkov <egorenar-dev@posteo.net> wrote:


> diff --git a/package/makedumpfile/0003-Fix-build-with-musl-libc.patch b/package/makedumpfile/0003-Fix-build-with-musl-libc.patch
> new file mode 100644
> index 000000000000..26718fb7f6b9
> --- /dev/null
> +++ b/package/makedumpfile/0003-Fix-build-with-musl-libc.patch
> @@ -0,0 +1,27 @@
> +From 3ae383c5dfdbd4dc5cfb888b3cc187819658068b Mon Sep 17 00:00:00 2001
> +From: Alexander Egorenkov <egorenar-dev@posteo.net>
> +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 <egorenar-dev@posteo.net>

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?

> +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?

> + #define PAGESIZE()		(info->page_size)
> + #define PAGESHIFT()		(info->page_shift)

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

Thomas
diff mbox series

Patch

diff --git a/package/makedumpfile/0003-Fix-build-with-musl-libc.patch b/package/makedumpfile/0003-Fix-build-with-musl-libc.patch
new file mode 100644
index 000000000000..26718fb7f6b9
--- /dev/null
+++ b/package/makedumpfile/0003-Fix-build-with-musl-libc.patch
@@ -0,0 +1,27 @@ 
+From 3ae383c5dfdbd4dc5cfb888b3cc187819658068b Mon Sep 17 00:00:00 2001
+From: Alexander Egorenkov <egorenar-dev@posteo.net>
+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 <egorenar-dev@posteo.net>
+---
+ 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
+