简体   繁体   English

不使用X11构建Mali驱动程序

[英]Building Mali Driver without X11

I try to build an image for bananaPro without X11 and Wayland support. 我尝试为没有X11和Wayland支持的bananaPro构建图像。 But I got following error during Mali test binary compilation: 但是在Mali测试二进制编译过程中出现以下错误:

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 当我查看0001-fix-test-build.patch文件时,看到以下几行

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. 由于该图像不支持X11,因此我假定不应包含X11库。 Isn't that true? 那不是真的吗? How can I solve this problem? 我怎么解决这个问题?

In Yocto, to build image without X11 and Wayland all you have to do is: 在Yocto中,要构建没有X11和Wayland的图像,您要做的就是:

DISTRO_FEATURES_remove = " x11 wayland "

This will ignore all the x11 and wayland components. 这将忽略所有x11和Wayland组件。


Edit: The Sunxi Mali Recipe you are using required X11 to compile 编辑:您使用的Sunxi Mali食谱需要X11进行编译

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. 解决这个问题的一种方法是使用X11和Wayland编译mali,然后将所有组件移动到帧缓冲系统。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM