Latest working kernel version: 2.6.22.1 Earliest failing kernel version: 2.6.24 Problem Description: Kernel compile finish with error: GEN .version CHK include/linux/compile.h UPD include/linux/compile.h CC init/version.o LD init/built-in.o LD .tmp_vmlinux1 drivers/built-in.o: In function `hiddev_ioctl': hiddev.c:(.text+0xfcc43): undefined reference to `__you_cannot_kmalloc_that_much' make: *** [.tmp_vmlinux1] Error 1 Steps to reproduce: gcc (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7) USB_HID=y in .config
Please attach your .config
Created attachment 15050 [details] .config
Created attachment 15099 [details] Proposed fix The trick is to move the handling of ioctls which need to allocate memory to separate functions. This fixes the problem for me, but needs some testing.
Right. We know that gcc 3.2 will fold constants again if the functions are smaller. That has also addressed the issue in other cases. That also means that the issue will resurface if the function is bloated by further updates.
The alternative would be to move the minimum supported compiler version from 3.2 to 3.3 if this reoccuring issue (see e.g. #9669) convinces Linus of accepting a patch doing so.
I don't think that we want to make gcc 3.3 the minimum supported compiler version. gcc 3.2 still has a significant pool of users. On top of that, overly large functions are bad anyway for many reasons, so I doubt that you will convince Linus: he might see this gcc 3.2 property as a feature not bug ;)
fixed by commit cf2a299e48cbeb6c942e1f765b92ca6058355f68