Re: include/linux/slab.h:663:78: error: subscripted value is neither array nor pointer nor vector

From: Arnd Bergmann
Date: Mon Jul 22 2024 - 05:23:11 EST


On Mon, Jul 22, 2024, at 09:48, Geert Uytterhoeven wrote:
> On Mon, Jul 22, 2024 at 9:15 AM Vlastimil Babka <vbabka@xxxxxxx> wrote:
>> On 7/19/24 10:02 PM, kernel test robot wrote:
>>
>> Hm the new error ettributed to slab seems just a consequence of the broken
>> PAGE_SHIFT? Although it's not listed here in the errors for some reason, I
>> assume without PAGE_SHIFT we don't have KMALLOC_SHIFT_HIGH thus we don't
>> have kmem_buckets typedef and thus kmalloc_caches is who knows what and thus
>> doesn't look like an array? And the broken PAGE_SHIFT has to be cause by
>> something else.
>>
>> > arch/m68k/include/asm/page.h:10:25: error: 'CONFIG_PAGE_SHIFT' undeclared here (not in a function); did you mean 'CONFIG_LOG_BUF_SHIFT'?
>> > 10 | #define PAGE_SHIFT CONFIG_PAGE_SHIFT
>> > | ^~~~~~~~~~~~~~~~~
>
> It's a known issue since commit 5394f1e9b687bcf2 ("arch: define
> CONFIG_PAGE_SIZE_*KB on all architectures"): m68k-alldefconfig does
> not select any CPU types, hence no MMU type, and as a consequence no
> page size is selected.
>
> Arnd and I couldn't come up with a good solution to enforce a valid config,
> so this is still broken...

I've tried again as this keeps coming up. Not sure if this
is a variant we have discussed before, but this way should
fix the issue. There are still two unrelated build failures
with 'alldefconfig' though:

arch/m68k/kernel/setup_mm.c:54:2: error: #warning No CPU/platform type selected, your kernel will not work! [-Werror=cpp]
54 | #warning No CPU/platform type selected, your kernel will not work!
arm-soc/kernel/irq/irqdesc.c:592:3: error: array index in initializer exceeds array bounds
592 | [0 ... NR_IRQS-1] = {

Arnd

8<---