linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org,  mm-commits@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [GIT PULL] MM updates for 6.14-rc1
Date: Sun, 26 Jan 2025 18:21:47 +0100	[thread overview]
Message-ID: <CAFULd4a-2F_zKMeR0Yjo2WhRLmyoOQ1VdR2qdV34BrM-b_cQCQ@mail.gmail.com> (raw)
In-Reply-To: <CAFULd4ZWS4Cxv0CELosQHJh9vTqOJFdr+Fk9NMgSREr_dFG05A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1596 bytes --]

On Sun, Jan 26, 2025 at 10:57 AM Uros Bizjak <ubizjak@gmail.com> wrote:
>
> On Sat, Jan 25, 2025 at 11:09 PM Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> >
> > On Fri, 24 Jan 2025 at 16:22, Andrew Morton <akpm@linux-foundation.org> wrote:
> > >
> > > Linus, please merge the MM updates for the 6.14 development cycle,
> >
> > This does not build at all for me.
> >
> > I get
> >
> >     ./arch/x86/include/asm/current.h:49:9: error: call to undeclared
> > function '__typeof_unqual__'; ISO C99 and later do not support
> > implicit function declarations [-Wimplicit-function-declaration]
> >
> > when running the Rust 'bindgen', and what seems to be going on is that
> > my version of *gcc* does support __typeof_unqual__, so I end up with
> >
> >     CONFIG_CC_HAS_TYPEOF_UNQUAL=y
> >
> > in my kernel config, but I think that 'bindgen' that generates the
> > Rust bindings is based on LLVM, and clearly does not understand
>
> __typeof_unqual__ is available in Clang 19.1.0 in all C modes as an
> extension [1] and as reported in [2], bindgen 0,70.1 seems to parse
> __typeof_unqual__ okay.
>
> [1] https://releases.llvm.org/19.1.0/tools/clang/docs/ReleaseNotes.html
> [2] https://lore.kernel.org/lkml/9fa81826-8fa6-47e4-a0a2-4916e5d042a7@stanley.mountain/
>
> Maybe configure could detect bindgen version and disable
> CC_HAS_TYPEOF_UNQUAL [3] if it is too old?

bindgen ChangeLog does not mention __typeof_unqual__, so I assume that
the support depends on RUSTC_LLVM_VERSION.

Does the attached incremental patch work for you?

Uros.

[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 604 bytes --]

diff --git a/init/Kconfig b/init/Kconfig
index a1507b8714e4..d342371dd15d 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -898,7 +898,9 @@ config CC_HAS_INT128
 	def_bool !$(cc-option,$(m64-flag) -D__SIZEOF_INT128__=0) && 64BIT
 
 config CC_HAS_TYPEOF_UNQUAL
-	def_bool $(success,echo 'int foo (int a) { __typeof_unqual__(a) b = a; return b; }' | $(CC) -x c - -S -o /dev/null)
+	def_bool y
+	depends on $(success,echo 'int foo (int a) { __typeof_unqual__(a) b = a; return b; }' | $(CC) -x c - -S -o /dev/null)
+	depends on !RUST || RUSTC_LLVM_VERSION >= 190000
 
 config CC_IMPLICIT_FALLTHROUGH
 	string

  reply	other threads:[~2025-01-26 17:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-25  0:22 Andrew Morton
2025-01-25 22:09 ` Linus Torvalds
2025-01-26  5:00   ` Andrew Morton
2025-01-26  7:34     ` Linus Torvalds
2025-01-26  8:27     ` Stephen Rothwell
2025-01-26 12:10     ` Uros Bizjak
2025-01-26  9:57   ` Uros Bizjak
2025-01-26 17:21     ` Uros Bizjak [this message]
2025-01-26 18:29       ` Linus Torvalds
2025-01-26 19:46         ` Uros Bizjak
2025-01-26 20:06           ` Uros Bizjak
2025-01-26 21:59           ` Linus Torvalds
2025-01-26 23:27             ` Uros Bizjak
2025-01-27  0:08               ` Linus Torvalds
2025-01-27  7:29                 ` Uros Bizjak
2025-01-26 20:28         ` Miguel Ojeda
2025-01-26 21:19           ` Matthew Wilcox
2025-01-26 21:35             ` Miguel Ojeda
2025-01-26 20:58         ` Miguel Ojeda
2025-01-29 20:10           ` John Hubbard

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=CAFULd4a-2F_zKMeR0Yjo2WhRLmyoOQ1VdR2qdV34BrM-b_cQCQ@mail.gmail.com \
    --to=ubizjak@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=torvalds@linux-foundation.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