All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hisam Mehboob <hisamshar@gmail.com>
To: acme@kernel.org
Cc: shuah@kernel.org, seanjc@google.com,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	Hisam Mehboob <hisamshar@gmail.com>,
	Aqib Faruqui <aqibaf@amazon.com>
Subject: [PATCH] tools/include/linux/bitops.h: undef PAGE_SIZE after including limits.h
Date: Fri,  8 May 2026 04:48:55 +0500	[thread overview]
Message-ID: <20260507234854.273536-2-hisamshar@gmail.com> (raw)

musl libc defines PAGE_SIZE as a signed int in <limits.h>
under _GNU_SOURCE, conflicting with kernel headers that
require an unsigned 64-bit definition:

  include/x86/processor.h:372:9: warning: 'PAGE_SIZE' redefined
  /usr/include/x86_64-linux-musl/limits.h:97:9: note: this is the
  location of the previous definition

Undefine PAGE_SIZE immediately after the #include <limits.h> to
prevent musl's definition from leaking into kernel headers. This
is a no-op on glibc, which does not define PAGE_SIZE in <limits.h>.

Reported-by: Aqib Faruqui <aqibaf@amazon.com>
Link: https://lore.kernel.org/kvm/aL8e0MMa4U2-nstQ@google.com/
Signed-off-by: Hisam Mehboob <hisamshar@gmail.com>
---
 tools/include/linux/bitops.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/include/linux/bitops.h b/tools/include/linux/bitops.h
index b4e4cd071f8c..62117a77ceb5 100644
--- a/tools/include/linux/bitops.h
+++ b/tools/include/linux/bitops.h
@@ -4,6 +4,7 @@
 
 #include <asm/types.h>
 #include <limits.h>
+#undef PAGE_SIZE
 #ifndef __WORDSIZE
 #define __WORDSIZE (__SIZEOF_LONG__ * 8)
 #endif
-- 
2.51.0


             reply	other threads:[~2026-05-07 23:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-07 23:48 Hisam Mehboob [this message]
2026-09-29 13:49 ` [PATCH] tools/include/linux/bitops.h: undef PAGE_SIZE after including limits.h Sean Christopherson

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=20260507234854.273536-2-hisamshar@gmail.com \
    --to=hisamshar@gmail.com \
    --cc=acme@kernel.org \
    --cc=aqibaf@amazon.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=seanjc@google.com \
    --cc=shuah@kernel.org \
    /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 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.