- July 9, 2013 at 7:25 am #31340
I have difficulties cross-compiling SDK examples for TI OMAP5 running Ubuntu Precise (12.04LTS). Toolchain and SDK are set up and work just fine.
I can generate raw executable examples but don’t know how to run them. Can you provide some information on that. (In this case I am running program from console without X11.)
When I try to cross-compile for X11 environment, linker fails because of missing X11 libs while native compile for x86_64 and X11 works fine and program runs.July 9, 2013 at 8:56 am #37654
Before running null window system (raw) application, you need to ensure X11 has been stopped (if it was running). Once X11 has been killed, you should be able to launch the application from the console.
If you want to instead build an X11 version of our Examples, you need to set an X11ROOT environment variable that points to your target’s X11 libraries & add X11BUILD=1 to your command-line arguments for make. Our SDK User Guide also details these steps.
Let us know if you hit any other issues.
JoeJuly 9, 2013 at 11:38 am #37655
When building X11, I provide both X11BUILD and X11ROOT so everything is supposed to run.
Compiler passes but I cannot link with X11 libs. This is what I get.
/home/doking-dev/gcc-linaro-arm-linux-gnueabihf-4.8-2013.06_linux/bin/arm-linux-gnueabihf-g++ -o ../Linux_armv7/ReleaseX11/OGLES2Water ../Linux_armv7/ReleaseX11/OGLES2Water.o ../Linux_armv7/ReleaseX11/NewNormalMap.o ../Linux_armv7/ReleaseX11/Mountain.o ../Linux_armv7/ReleaseX11/wood.o ../Linux_armv7/ReleaseX11/sail.o ../Linux_armv7/ReleaseX11/MountainFloor.o ../Linux_armv7/ReleaseX11/FragShader.o ../Linux_armv7/ReleaseX11/VertShader.o ../Linux_armv7/ReleaseX11/SkyboxFShader.o ../Linux_armv7/ReleaseX11/SkyboxVShader.o ../Linux_armv7/ReleaseX11/ModelFShader.o ../Linux_armv7/ReleaseX11/ModelVShader.o ../Linux_armv7/ReleaseX11/Tex2DFShader.o ../Linux_armv7/ReleaseX11/Tex2DVShader.o ../Linux_armv7/ReleaseX11/PlaneTexFShader.o ../Linux_armv7/ReleaseX11/PlaneTexVShader.o ../Linux_armv7/ReleaseX11/Scene.o ../Linux_armv7/ReleaseX11/PVRShell.o ../Linux_armv7/ReleaseX11/PVRShellAPI.o ../Linux_armv7/ReleaseX11/PVRShellOS.o -L/usr/include/X11//lib -Wl,--rpath-link,/usr/include/X11//lib -lX11 -lXau -lGLESv2 -lEGL -L/opt/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Tools/OGLES2/Build/LinuxGeneric/../Linux_armv7/ReleaseX11 -logles2tools -L"/opt/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Builds/Linux/armv7/Lib" -Wl,--rpath-link,"/opt/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Builds/Linux/armv7/Lib"
/home/doking-dev/gcc-linaro-arm-linux-gnueabihf-4.8-2013.06_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.8.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lX11
/home/doking-dev/gcc-linaro-arm-linux-gnueabihf-4.8-2013.06_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.8.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lXau
collect2: error: ld returned 1 exit status
make: *** [../Linux_armv7/ReleaseX11/OGLES2Water] Error 1July 9, 2013 at 11:59 am #37656
You should be linking to your target’s X11 libs. Have you accidentally linked to your host machine’s libs while cross-compiling?
JoeJuly 9, 2013 at 12:03 pm #37657
Yes, I have.
So I have to copy libs from my host system and use their path as argument of X11ROOT? Cross-compiling X11 doesn’t look appealing to me.July 9, 2013 at 1:04 pm #37658
If you want to cross-compile for X11, you either have to either copy the libraries from your target to a directory on your host, or mount the target’s X11 directory so you can link against it remotely.
JoeJuly 9, 2013 at 1:29 pm #37659
I have tried both options and both have failed with the same result as before -lX11 and -lXau not found.
I am calling make like this
make PLATFORM=Linux_armv7 X11BUILD=1 X11ROOT=/media/rootfs/usr/include/X11
Error message is same as few posts before.July 9, 2013 at 1:52 pm #37660
The X11ROOT variable is designed to point at the location that has the include and lib folders that contain your X11 libs and headers. Based on what you’ve set your X11ROOT to, could you try
If that doesn’t work, could you let us know where your libX11.so is located on your system.
ScottJuly 9, 2013 at 2:40 pm #37661
libX11.so is in
/media/rootfs/usr/lib/arm-linux-gnueabihf/libXau is in same directory as well.
I have tried make with /media/rootfs/usr. Again with the same error.July 9, 2013 at 2:47 pm #37662
Just to avoid problems, after each unsuccessful make I do make clean for that build.
Also, what might interest you is contains of .bashrc which is
$CROSS_COMPILE is not set and I am using latest Linaro toolchain for armhfJuly 9, 2013 at 2:48 pm #37663
libX11.so is in
libXau is in same directory as well.
I have tried make with /media/rootfs/usr. Again with the same error.
Ok, looks like you’ll need to modify the ws.mak in /Builds/Linux/armv7 so all the references to
are changed to
Hopefully that’ll get things linking.July 9, 2013 at 2:57 pm #37664
OK. We have that working. BUT agony is not over yet 🙂
Linking now stops with this error:
/home/doking-dev/gcc-linaro-arm-linux-gnueabihf-4.8-2013.06_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.8.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find /lib/arm-linux-gnueabihf/libc.so.6
/home/doking-dev/gcc-linaro-arm-linux-gnueabihf-4.8-2013.06_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.8.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find /usr/lib/arm-linux-gnueabihf/libc_nonshared.a
/home/doking-dev/gcc-linaro-arm-linux-gnueabihf-4.8-2013.06_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.8.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find /lib/arm-linux-gnueabihf/ld-linux-armhf.so.3
collect2: error: ld returned 1 exit status
make: *** [../Linux_armv7/ReleaseX11/OGLES2Water] Error 1
July 10, 2013 at 7:54 am #37665
My idea why make fails is because cross-compiler supports multiarch. libc.so.6 and other files might have been moved to different location and therefore make fails to locate and use them.
Any solution for that?July 10, 2013 at 9:06 am #37666
Had to copy contents from /libc/lib to system /lib and /libc/usr/lib to system /usr/lib. Make searches for those files inside of the system libraries instead of the toolchain libs. Maybe this can be fixed more easily by using LD_LIBRARY_PATH?
Thank you guys, helped me a lot.