Compile qemu with virglrenderer support
In order to improve qemu video performance (see https://github.com/postmarketOS/pmbootstrap/issues/453), I'm trying to compile Alpine's qemu with virglrenderer enabled (which is necessary for OpenGL support).
Eventually we could use this version from the chroot and the developer would not need to have qemu in their host machine, which is good because we keep the system clean and also because this is a very recent feature and distros like Ubuntu 16.04 don't have support for it in their shipped version qemu.
The good news is that virglrenderer
is already packaged in Alpine. But when I enable virglrenderer support in ./configure, the build system fails because of the new -lvirglrenderer
flag.
This is the full error when running pmbootstrap build qemu
:
/usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lvirglrenderer
collect2: error: ld returned 1 exit status
Pkgconfig works fine and the library and includes are in their correct places.
$ pkg-config --libs virglrenderer
-lvirglrenderer
$ pkg-config --cflags virglrenderer
-I/usr/include/virgl
$ ls -l /usr/lib/libvirglrenderer.so* -l
lrwxrwxrwx 1 root root 25 Sep 9 12:26 /usr/lib/libvirglrenderer.so -> libvirglrenderer.so.0.2.0
lrwxrwxrwx 1 root root 25 Sep 9 12:26 /usr/lib/libvirglrenderer.so.0 -> libvirglrenderer.so.0.2.0
-rwxr-xr-x 1 root root 309656 Jun 6 00:35 /usr/lib/libvirglrenderer.so.0.2.0
$ ls -l /usr/include/virgl* -l
total 8
-rw-r--r-- 1 root root 6968 Jun 6 00:35 virglrenderer.h
I've asked in #alpine-devel and they told me that having virglrenderer-dev
as a build dependency should be enough
Same happens when I try to build qemu with sdl2 support. sdl2 has the tslib dependency and when building, it fails because of the unknown -lts
flag.
You can see the current work in the qemu-virglrenderer-support branch.
See the changes I did to APKBUILD here: https://github.com/postmarketOS/pmbootstrap/commit/57734406c7b8a18dda120681cc29ebbd9d1b5f44