3

While compiling rt kernel following this http://www.frank-durr.de/?p=203 I got that error enter image description here

2

By the looks of it, you're running the make bzimage command on your rasberrypi. The link http://www.frank-durr.de/?p=203 is for instructions as to how to cross-compile the rpi kernel (which is to say, compile the kernel on another platform, such as a PC running linux). In the instructions given, I suspect, commands beginning user@host are intended to be run on said host, whereas the only command beginning pi@raspberry$ is to be run on the raspberrypi. The only instruction to be run on the pi, is sudo modprobe configs, then from your host, scp pi@raspberry:/proc/config.gz ./ to get the config.gz file from your raspberrypi (that config file will tell make what config settings to use when building the kernel, rather than asking you to set them all manually, starting from the defaults).

However, if you do want to compile on the Pi, the error message above, is telling you that gcc failed to compile due to a syntax error. You need to look at the file it was trying to compile and figure out what's causing the error. Normally, if you're compiling from a path often followed (by others) the code won't contain bugs, so you've probably broken something. A good way is through unresolved merges, or other upstream scripts that failed.
The error message is saying there was an unexpected "(" on line 1. Now I'd not expect a C file to begin with a "(" unless it's been minified to be all on 1 line (unlikely for the kernel source), so I suggest you inspect the files it's created and check they look right.

It's probably worth pointing out, the instructions you're following are not intended to explain how to compile the kernel on the pi. You should be able to do that, just like re-compiling a normal linux kernel. However I seem to remember reading that on the Pi 1, a full kernel compile could take days (compared to hours on a PC), so these are probably not the droids you're looking for.

  • thanks, I have pi 2 and i think the problem is with rt patch! – I.Omar Jan 13 '16 at 18:06
  • I'm not sure the Pi 2 is that different. Sure it's faster, but the instructions you're following are for cross compiling, and you're compiling on a Pi, so it's not a cross compile. Certainly the "(" error, is the sort of thing a bad patch would create, but still, you needn't tell the Pi to cross compile for a Pi. You can skip half of those steps and just compile. You've no need for cross compile tools for example. It'll still take ages though :-) – sibaz Jan 14 '16 at 12:56
  • That's what I did just used make (after unset options) and it compiled right, but the new kernel didn't boot, so I am stuck with the non rt one. – I.Omar Jan 14 '16 at 17:04
  • If you have a linux PC (virtual or not) I suggest you try cross compiling the kernel, using the same version and config of a downloaded Pi image first, to get familiar with the compilation/grub process, then try changing things. – sibaz Jan 15 '16 at 9:20
  • Nice idea, I will try it. – I.Omar Jan 15 '16 at 12:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.