linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Uros Bizjak <ubizjak@gmail.com>, Miguel Ojeda <ojeda@kernel.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 10:29:45 -0800	[thread overview]
Message-ID: <CAHk-=whgufZwjAuL1PBs1gjSMK95TEhGj1SiMbNvkysWBcEPMw@mail.gmail.com> (raw)
In-Reply-To: <CAFULd4a-2F_zKMeR0Yjo2WhRLmyoOQ1VdR2qdV34BrM-b_cQCQ@mail.gmail.com>

On Sun, 26 Jan 2025 at 09:22, Uros Bizjak <ubizjak@gmail.com> wrote:
>
> bindgen ChangeLog does not mention __typeof_unqual__, so I assume that
> the support depends on RUSTC_LLVM_VERSION.

That seems to be a reasonable assumption. I guess some crazy setup
*could* install a bindgen that uses a different llvm version than
rustc itself, but that sounds pretty damn broken.

Let's add Miguel to the participants. Miguel, see

   https://lore.kernel.org/all/CAHk-=whddBhfi5DUi370W3pYs+z3r2E7KYuHjwR=a1eRig5Gxg@mail.gmail.com/

for my "this doesn't work" report, and then Uros' suggested fix in

   https://lore.kernel.org/all/CAFULd4a-2F_zKMeR0Yjo2WhRLmyoOQ1VdR2qdV34BrM-b_cQCQ@mail.gmail.com/

> Does the attached incremental patch work for you?

That does seem to work, but I'd admittedly be happier if we could just
find some way to dynamically disable/enable __typeof_unqual__ based on
which compiler is used, rather than make it a config option. So that
bindgen would not see it, but a recent enough C compiler would.

We already use '__has_attribute()' for some of these things. There's a
'__has_extension()' thing that comes from clang but that gcc also
supports.

But I can't find the list of extensions that that model supports, and
I guess typeof_unqual isn't on that list if I find it.

In the absence of something _clean_ like that, can we just do it in
<linux/compiler-xyz.h> instead? IOW, not use the CONFIG_xyz tests for
this at all, but do something like

  /*
   * bindgen uses LLVM even if our C compiler is gcc, so we cannot
   * rely on CONFIG_CC_HAS_TYPEOF_UNQUAL
   */
  #if __clang_major__ >= 19
  # define CC_HAS_TYPEOF_UNQUAL 1
  #endif

in <linux/compiler-clang.h> and the gcc version check for gcc (I don't
know when __typeof_unqual__ made it)?

This does show that our whole "CC_HAS_XYZ" is kind of broken for the
Rust integration in general.

                 Linus


  reply	other threads:[~2025-01-26 18:30 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
2025-01-26 18:29       ` Linus Torvalds [this message]
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='CAHk-=whgufZwjAuL1PBs1gjSMK95TEhGj1SiMbNvkysWBcEPMw@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=ubizjak@gmail.com \
    /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