Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: Alexander Lobakin <aleksander.lobakin@intel.com>
To: Uros Bizjak <ubizjak@gmail.com>
Cc: kernel test robot <lkp@intel.com>, <llvm@lists.linux.dev>,
	<oe-kbuild-all@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
	<x86@kernel.org>, Ingo Molnar <mingo@kernel.org>
Subject: Re: [tip:x86/asm 3/7] lib/test_bitmap.c:1269:2: error: call to '__compiletime_assert_279' declared with 'error' attribute: BUILD_BUG_ON failed: !__builtin_constant_p(res)
Date: Mon, 17 Mar 2025 16:35:24 +0100	[thread overview]
Message-ID: <bc4a1940-9932-4d96-aac6-4dd11169c4a3@intel.com> (raw)
In-Reply-To: <CAFULd4ZX5NvpmvrtSQzz=iBQ20AGZqR2PSMZP4p7PrzE4qNJyA@mail.gmail.com>

From: Uros Bizjak <ubizjak@gmail.com>
Date: Sun, 16 Mar 2025 09:28:51 +0100

> On Sun, Mar 16, 2025 at 3:52 AM kernel test robot <lkp@intel.com> wrote:
>>
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/asm
>> head:   9628d19e91f1ef9e7b1321e74a88bfa646d2a8d3
>> commit: 01ba23bf1b3f9a4035faedc2aa450e251bcc2c7c [3/7] x86/hweight: Use ASM_CALL_CONSTRAINT in inline asm()
>> config: x86_64-buildonly-randconfig-003-20250316 (https://download.01.org/0day-ci/archive/20250316/202503161004.ZmMcxxeB-lkp@intel.com/config)
>> compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
>> rustc: rustc 1.78.0 (9b00956e5 2024-04-29)
>> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250316/202503161004.ZmMcxxeB-lkp@intel.com/reproduce)
>>
>> If you fix the issue in a separate patch/commit (i.e. not just a new version of
>> the same patch/commit), kindly add following tags
>> | Reported-by: kernel test robot <lkp@intel.com>
>> | Closes: https://lore.kernel.org/oe-kbuild-all/202503161004.ZmMcxxeB-lkp@intel.com/
>>
>> All errors (new ones prefixed by >>):
>>
>>>> lib/test_bitmap.c:1269:2: error: call to '__compiletime_assert_279' declared with 'error' attribute: BUILD_BUG_ON failed: !__builtin_constant_p(res)
>>     1269 |         BUILD_BUG_ON(!__builtin_constant_p(res));
> 
> I fail to see how the referred patch can cause an error in:
> 
> /* !(BIT(31) & BIT(18)) == 1 */
> res = !test_bit(18, &bitopvar);
> BUILD_BUG_ON(!__builtin_constant_p(res));
> BUILD_BUG_ON(!res);

Kbuild bot sometimes fails on randconfigs and random commits blaming
these commits even though they're unrelated.
Esp this function, I dunno why, but time to time on different arches
(um is the winner here) it fails to expand obvious stuff. This for sure
depends on debug stuff configuration, let's say in the attached config I
see KASAN enabled, but not always and it's unclear how to catch and
reproduce stuff (and then how to fix) reliably.

Re Clang and KASAN, there's this in lib/Makefile:

obj-$(CONFIG_TEST_BITMAP) += test_bitmap.o
ifeq ($(CONFIG_CC_IS_CLANG)$(CONFIG_KASAN),yy)
# FIXME: Clang breaks test_bitmap_const_eval when KASAN and GCOV are enabled
GCOV_PROFILE_test_bitmap.o := n
endif

This was added a while ago not by me as I'm no instrumentation expert
and have no idea about those GCOV_PROFILE etc. Does 19.1.7 want more
than that to evaluate obvious things?

> 
> Otherwise, the patch fixes a correctness issue, so there is nothing to
> do with the patch anyway.
> 
> Uros.

Thanks,
Olek

      reply	other threads:[~2025-03-17 15:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-16  2:51 [tip:x86/asm 3/7] lib/test_bitmap.c:1269:2: error: call to '__compiletime_assert_279' declared with 'error' attribute: BUILD_BUG_ON failed: !__builtin_constant_p(res) kernel test robot
2025-03-16  8:28 ` Uros Bizjak
2025-03-17 15:35   ` Alexander Lobakin [this message]

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=bc4a1940-9932-4d96-aac6-4dd11169c4a3@intel.com \
    --to=aleksander.lobakin@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=mingo@kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=ubizjak@gmail.com \
    --cc=x86@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox