Re: page_alloc.c:(.init.text+0xa7c): undefined reference to `vmalloc_huge'

From: Linus Torvalds
Date: Mon Apr 25 2022 - 04:28:55 EST


On Mon, Apr 25, 2022 at 1:10 AM Naresh Kamboju
<naresh.kamboju@xxxxxxxxxx> wrote:
>
> # CONFIG_MMU is not set

I just sent the stupid and straightforward patch in

https://lore.kernel.org/all/CAHk-=wi5DYKbFE4j-jC2HGsKVuf1RpZbEiYt4tSXuxGKiN9oJg@xxxxxxxxxxxxxx/

but then I thought maybe the alias patch is as simple as the attached.

So does either (or both) of these patches work?

Linus
mm/nommu.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/mm/nommu.c b/mm/nommu.c
index 55a9e48a7a02..9d7afc2d959e 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -226,6 +226,8 @@ void *vmalloc(unsigned long size)
}
EXPORT_SYMBOL(vmalloc);

+void *vmalloc_huge(unsigned long size, gfp_t gfp_mask) __weak __alias(__vmalloc);
+
/*
* vzalloc - allocate virtually contiguous memory with zero fill
*