Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Rosen Penev" <rosenp@gmail.com>
Cc: linux-mm@kvack.org,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"David Hildenbrand (Red Hat)" <david@kernel.org>,
	"Lorenzo Stoakes" <ljs@kernel.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	"Vlastimil Babka (SUSE)" <vbabka@kernel.org>,
	"Mike Rapoport" <rppt@kernel.org>,
	"Suren Baghdasaryan" <surenb@google.com>,
	"Michal Hocko" <mhocko@suse.com>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Nick Desaulniers" <nick.desaulniers+lkml@gmail.com>,
	"Bill Wendling" <morbo@google.com>,
	"Justin Stitt" <justinstitt@google.com>,
	"open list" <linux-kernel@vger.kernel.org>,
	"open list:CLANG/LLVM BUILD SUPPORT:Keyword:b(?i:clang|llvm)b"
	<llvm@lists.linux.dev>
Subject: Re: [PATCH] mm: move phys_mem_access_prot_allowed to header
Date: Tue, 05 May 2026 10:29:28 +0200	[thread overview]
Message-ID: <df3e889d-ac8c-4d11-a5fe-8ed2769953f0@app.fastmail.com> (raw)
In-Reply-To: <CAKxU2N92s06-L0+e=KZ7EbtU50tCpaCk2MYJD2xTFEHEsAhXUg@mail.gmail.com>

On Tue, May 5, 2026, at 09:47, Rosen Penev wrote:
> On Mon, May 4, 2026 at 10:54 PM Arnd Bergmann <arnd@arndb.de> wrote:
>>
>> On Tue, May 5, 2026, at 03:01, Rosen Penev wrote:
>> > phys_mem_access_prot_allowed is only implemented for X86. For others, it
>> > returns 1. Move it to header to avoid using __weak.
>> >
>> > Fixes compilation with make LLVM=1 ARCH=mips
>>
>> Can you describe what exactly goes wrong here on mips?
> Cannot find symbol for section 4: .text.phys_mem_access_prot_allowed.
> drivers/char/mem.o: failed
>
> It's full of similar errors in drivers/pci/ as well. clang on MIPS
> doesn't seem to like __weak.

This certainly feels like a toolchain bug. I would not mind having
the PCI code converted away from the __weak functions, but it should
not just fail with a linker error like this.

Does this happen with both ld.bfd and ld.lld? Which version of clang
and lld are you using? 

      Arnd

  reply	other threads:[~2026-05-05  8:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-05  1:01 [PATCH] mm: move phys_mem_access_prot_allowed to header Rosen Penev
2026-05-05  5:54 ` Arnd Bergmann
2026-05-05  7:47   ` Rosen Penev
2026-05-05  8:29     ` Arnd Bergmann [this message]
2026-05-05  8:54       ` Rosen Penev
2026-05-05  9:22         ` Arnd Bergmann
2026-05-05 22:36           ` Rosen Penev
2026-05-06  5:48           ` Nathan Chancellor
2026-05-06  6:02             ` Rosen Penev

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=df3e889d-ac8c-4d11-a5fe-8ed2769953f0@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=justinstitt@google.com \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=mhocko@suse.com \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=nick.desaulniers+lkml@gmail.com \
    --cc=rosenp@gmail.com \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@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