日前在移植LSDK2108的时候,发现在启动weston服务的时候会报以下的错误
root@forlinx:~# weston --tty=1
Date: 2022-04-09 CST
[16:30:47.231] weston 9.0.0
https://wayland.freedesktop.org
Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
Build: lf-5.10.35-2.0.0-rc2-1-gbf611255
[16:30:47.232] Command line: weston --tty=1
[16:30:47.232] OS: Linux, 5.10.35-g46e1a09b0512, #1 SMP PREEMPT Sat Apr 9 13:20:41 CST 2022, aarch64
[16:30:47.233] Using config file '/etc/xdg/weston/weston.ini'
[16:30:47.234] Output repaint window is 7 ms maximum.
[16:30:47.235] Loading module '/usr/lib/libweston-9/drm-backend.so'
[16:30:47.239] initializing drm backend
[16:30:47.244] using /dev/dri/card0
[16:30:47.245] DRM: supports atomic modesetting
[16:30:47.245] DRM: supports GBM modifiers
[16:30:47.245] DRM: supports picture aspect ratio
[16:30:47.245] Loading module '/usr/lib/libweston-9/gl-renderer.so'
[16:30:47.268] Failed to load module: /lib/libEGL.so.1: undefined symbol: gbm_surface_set_in_fence_fd
[16:30:47.268] failed to initialize egl
[16:30:47.269] fatal: failed to create compositor backend
Internal warning: debug scope 'drm-backend' has not been destroyed.
从错误上来看,就是加载/lib/libEGL.so.1模块的时候找不到gbm_surface_set_in_fence_fd符号
我们可以使用ldd -r /lib/libEGL.so.1命令来验证这一问题
root@forlinx:~# ldd -r /lib/libEGL.so.1
linux-vdso.so.1 (0x0000ffff9ae6f000)
libGAL.so => /lib/libGAL.so (0x0000ffff9ac04000)
libwayland-server.so.0 => /lib/aarch64-linux-gnu/libwayland-server.so.0 (0x0000ffff9abe0000)
libwayland-client.so.0 => /lib/aarch64-linux-gnu/libwayland-client.so.0 (0x0000ffff9abc1000)
libdrm.so.2 => /lib/aarch64-linux-gnu/libdrm.so.2 (0x0000ffff9ab9f000)
libgbm.so.1 => /lib/aarch64-linux-gnu/libgbm.so.1 (0x0000ffff9ab81000)
libgbm_viv.so => /lib/libgbm_viv.so (0x0000ffff9ab6c000)
libpthread.so.0 => /lib/aarch64-linux-gnu/libpthread.so.0 (0x0000ffff9ab3c000)
libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000ffff9a9c9000)
/lib/ld-linux-aarch64.so.1 (0x0000ffff9ae3f000)
libm.so.6 => /lib/aarch64-linux-gnu/libm.so.6 (0x0000ffff9a91c000)
libdl.so.2 => /lib/aarch64-linux-gnu/libdl.so.2 (0x0000ffff9a908000)
libffi.so.7 => /lib/aarch64-linux-gnu/libffi.so.7 (0x0000ffff9a8ef000)
libexpat.so.1 => /lib/aarch64-linux-gnu/libexpat.so.1 (0x0000ffff9a8b8000)
undefined symbol: gbm_surface_set_in_fence_fd (/lib/libEGL.so.1)
在上面的打印信息中,我们也看到了/lib/libEGL.so.1所链接的其他动态库