View Single Post
thp's Avatar
Posts: 1,391 | Thanked: 4,272 times | Joined on Sep 2007 @ Vienna, Austria
#600
Originally Posted by javispedro View Post
For now, just binary edit the library file ELF header, replace 0x05 with 0x04 at offset 0x27 iirc. Ugly, but works.
Thanks, that indeed let me compile and link the test app The only problem now is that on my device, I don't get the chance to start anything (although it did work some days ago). The kernel modules load, I can create the new device nodes and set permissions and even start mbxdaemon, but "glinfo" and friends just hang with no output after starting them. dmesg tells me (this might or might not be related to the hanging):

Code:
[  131.757812] request OMAPLCD IRQ failedrequest OMAPLCD IRQ failed<1>Unhandled fault: external abort on non-linefetch (0x808) at 0x4002b024
In case anyone wants to try and compile some GLES code, here's a kludgy Python script that helps you patch the version byte in the ELF header, so you can link your ABI version 4 code against the libraries:

Code:
import sys

for filename in sys.argv[1:]:
    d = open(filename, 'rb').read()
    nd = d[:0x27] + chr(4) + d[0x28:]
    open(filename, 'wb').write(nd)
(Usage example: "python patch.py *.so")

The GL-specific libraries I needed to pass to the linker were:

Code:
-lGLES_CM -lIMGegl -lsrv_um_1.1.35.630 -lEGL
 

The Following 5 Users Say Thank You to thp For This Useful Post: