hardkernel / linux

Linux kernel source tree
Other
427 stars 408 forks source link

C2 fails to boot when kernel built with -O3, -finline-functions, or branch prediction hints #261

Open konradsa opened 7 years ago

konradsa commented 7 years ago

Hi,

I was experimenting how to speed up the kernel. When I build the kernel with either -O3 (instead of -O2), -O2 with -finline-functions, or -O2 with branch prediction hints (the likely/unlikely macros) using gcc 4.9 on the C2 itself, the C2 fails to boot, the red light starts flashing twice fast after a short period. I was really surprised by that, didn't expect that these options (especially the branch prediction hints by themselves, since that is a kernel feature) would result in a broken kernel.

I am running headless and I have not connected a display yet to see what is happening, but just wanted to check if that is a known issue or not. Is there some sort of size limit or something like that on the kernel image after which the kernel fails to boot? What else could be causing this surprising behavior?