Quote:
Originally Posted by kiri87
I had some issues compiling this on my Kindle 3.
First, the files einkfb.h & mxcfb.h were missing. The I read I should find them in the Amazon Source codes; to compile, I needed the files from Kindle_src_5.1.0.
Second, I received a
Code:
undefined symbol '__invalid_size_argument_for_IOC'
error, which I fixed by adding
Code:
unsigned int __invalid_size_argument_for_IOC;
I hope this may help someone, especially any other Linux noob like me.
|
This is listed as a bug in the linux ioctl.h header file, which gets optimized out in ALL CASES by the gcc compiler so you never see this with gcc. It can be a problem with other compilers (including tcc), where it causes a linker error. See here:
https://bugzilla.redhat.com/show_bug.cgi?id=473947
This was fixed in that header file for newer linux versions, but the kindles use the old header file with that known bug.
Thanks for the quick fix. It works. Now that I am using ioctl() in my eink functions, I need to add that to my eink global vars.
EDIT: This bug is one reason why many developers (including myself) do not like to include any files from subfolders inside the include folder. What I should do is go back to copying the structures I need from the include files into my program source file, instead of using those include files. Including the "standard" C header files if fine, but the deeper ones can be buggy (and slow down the compiler to parse all the header crap you are not using).
EDIT 2: Now that I have compiled this with tcc, I see that it still runs many times slower than compiled with "arm-linux-gcc -O3". I can only imagine how much slower it would be without the hand-optimizations. Well, at least tcc is convenient for development and testing, even if it produces only sub-optimal results. Graphics and animation are NOT areas where you want to use non-optimizing compilers. For example, the "goodbye" demo runs with fluid animation when compiled with gcc, but has a much lower framerate when compiled with tcc.