Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Borislav Petkov <bp@alien8.de>
Cc: x86-ml <x86@kernel.org>, lkml <linux-kernel@vger.kernel.org>,
	llvm@lists.linux.dev
Subject: Re: clang 15 build error
Date: Wed, 15 Oct 2025 09:50:31 -0700	[thread overview]
Message-ID: <20251015165031.GA1465138@ax162> (raw)
In-Reply-To: <20251015143312.GBaO-wqLdOtyEQkd1U@fat_crate.local>

Hey Boris,

On Wed, Oct 15, 2025 at 04:33:12PM +0200, Borislav Petkov wrote:
> before I go dig into this, any ideas? The likelyhood that you know what the
> issue is, is high: :-P
> 
> That's 32-bit allnoconfig of latest Linus master with Ubuntu clang version
> 15.0.7:
> 
> mm/maccess.c:41:3: error: invalid output size for constraint '=a'
>                 copy_from_kernel_nofault_loop(dst, src, size, u64, Efault);
>                 ^
> mm/maccess.c:22:3: note: expanded from macro 'copy_from_kernel_nofault_loop'
>                 __get_kernel_nofault(dst, src, type, err_label);        \
>                 ^
> ./arch/x86/include/asm/uaccess.h:629:18: note: expanded from macro '__get_kernel_nofault'
>         __get_user_size(*((type *)(dst)), (__force type __user *)(src), \
>                         ^
> mm/maccess.c:41:3: error: invalid output size for constraint '=a'
> mm/maccess.c:22:3: note: expanded from macro 'copy_from_kernel_nofault_loop'
>                 __get_kernel_nofault(dst, src, type, err_label);        \
>                 ^
> ./arch/x86/include/asm/uaccess.h:629:18: note: expanded from macro '__get_kernel_nofault'
>         __get_user_size(*((type *)(dst)), (__force type __user *)(src), \
>                         ^
> 2 errors generated.

Heh, I am aware of it but I have not had a chance to actually dig into
see what is going wrong here :/

https://github.com/ClangBuiltLinux/linux/issues/2121

I guess that LLVM is unhappy about a 64-bit variable being passed into
the constraint for eax on 32-bit?

https://github.com/llvm/llvm-project/blob/ce60a03573a4d9f28dd6de42f61f0a3c4b0f2be9/clang/test/CodeGen/X86/x86_32-inline-asm.c#L50
https://github.com/llvm/llvm-project/commit/974131ea8825041673a8c8dda7c42f9a9376eb17

Cheers,
Nathan

           reply	other threads:[~2025-10-15 16:50 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20251015143312.GBaO-wqLdOtyEQkd1U@fat_crate.local>]

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=20251015165031.GA1465138@ax162 \
    --to=nathan@kernel.org \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --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