Re: [PATCH] mm: move phys_mem_access_prot_allowed to header

From: Rosen Penev

Date: Tue May 05 2026 - 04:59:17 EST


On Tue, May 5, 2026 at 1:29 AM Arnd Bergmann <arnd@xxxxxxxx> wrote:
>
> On Tue, May 5, 2026, at 09:47, Rosen Penev wrote:
> > On Mon, May 4, 2026 at 10:54 PM Arnd Bergmann <arnd@xxxxxxxx> 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.
FWIW I just tested

make LLVM=1 ARCH=powerpc -j 31

which results in no such errors. So probably.
>
> Does this happen with both ld.bfd and ld.lld? Which version of clang
> and lld are you using?
clang version 22.1.3
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

lld the same.

I don't specify lld explicitly. I assume LLVM=1 does that.
>
> Arnd