2

I try to build an image for bananaPro without X11 and Wayland support. But I got following error during Mali test binary compilation:

make: Leaving directory '/home/yusuf/yocto/poky/bananaProHf/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/sunxi-mali/git-r0/git/include'
make -C test test
make[1]: Entering directory '/home/yusuf/yocto/poky/bananaProHf/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/sunxi-mali/git-r0/git/test'
arm-poky-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=hard -mfpu=neon-vfpv4 -mtune=cortex-a7 --sysroot=/home/yusuf/yocto/poky/bananaProHf/tmp/sysroots/bananapro -O2 -pipe -g -feliminate-unused-debug-types -I../include -L../../image/usr/lib -o test test.c -lEGL -lGLESv2 -lX11
In file included from ../include/EGL/egl.h:36:0,
from test.c:32:
../include/EGL/eglplatform.h:89:22: fatal error: X11/Xlib.h: No such file or directory
compilation terminated.
Makefile:8: recipe for target 'test' failed

When I view 0001-fix-test-build.patch file, I see following lines

test: ../config.mk test.c

    -$(CC) $(CFLAGS) -o $@ test.c -lEGL -lGLESv2
    +$(CC) $(CFLAGS) -I../include -L../../image/usr/lib -o $@ test.c -lEGL -lGLESv2 -lX11

Since the image doesn't support X11, I assumed the X11 libraries shouldn't be included. Isn't that true? How can I solve this problem?

NG_
  • 6,895
  • 7
  • 45
  • 67
overlord
  • 489
  • 1
  • 7
  • 20

1 Answers1

0

In Yocto, to build image without X11 and Wayland all you have to do is:

DISTRO_FEATURES_remove = " x11 wayland "

This will ignore all the x11 and wayland components.


Edit: The Sunxi Mali Recipe you are using required X11 to compile

PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
                  ${@base_contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)}"
PACKAGECONFIG[wayland] = "EGL_TYPE=framebuffer,,,"
PACKAGECONFIG[x11] = "EGL_TYPE=x11,,virtual/libx11 libxau libxdmcp libdri2,"

One way to work around this is to compile mali with X11 and Wayland, then move all the components to the framebuffer system.

The components that need to move include:

${S}/include/EGL/*.h ${D}${includedir}/EGL/
#In the recipe, this is in do_install, 
#what it does it move the file from ${S}/include/EGL/*.h to ${D}${incluedir}/EGL/

${S}/include/GLES/*.h ${D}${includedir}/GLES/
${S}/include/GLES2/*.h ${D}${includedir}/GLES2/
${S}/include/KHR/*.h ${D}${includedir}/KHR/
${S}/egl.pc ${D}${libdir}/pkgconfig/
${S}/gles_cm.pc ${D}${libdir}/pkgconfig/
${S}/glesv2.pc ${D}${libdir}/pkgconfig/

mv ${D}${libdir}/libMali.so ${D}${libdir}/libMali.so.3
    ln -sf libMali.so.3 ${D}${libdir}/libMali.so
for flib in libEGL.so.1.4 libGLESv1_CM.so.1.1 libGLESv2.so.2.0 ; do
        rm ${D}${libdir}/$flib
        ln -sf libMali.so.3 ${D}${libdir}/$flib
    done

${S}/test/test ${D}${bindir}/sunximali-test
Charles C.
  • 3,725
  • 4
  • 28
  • 50
  • I have already added this option to local.conf file,but I am still getting this error. – overlord Mar 14 '16 at 16:01
  • You could try the way I did with other recipe. Just a note that I have not done it with mali recipe. – Charles C. Mar 14 '16 at 16:36
  • I don't fully understand,What should I do?I should compile with X11 and wayland support and change mali recipe's do_install section.Isn't that true? – overlord Mar 15 '16 at 06:42
  • The way I did this to some of the program in X11 before is: compile the program with X11 and wayland. So you will discard the `DISTRO_FEATURES_remove = "x11 wayland"` line. Bitbake the program. Then move the stuff of the program to the framebuffer system. How to know which item to move, you have to look at the recipe do_install and so on...Just to note that I have not done it in Mali and it might not work. – Charles C. Mar 15 '16 at 15:48