Open
Description
Ask pkg-config how to build a program for brcmegl:
PKG_CONFIG_LIBDIR=/opt/vc/lib/pkgconfig pkg-config --libs-only-l brcmegl
Result:
-lbrcmEGL -lbrcmGLESv2 -lbcm_host -lvchostif -lbcm_host -lvcos -lvchiq_arm
There are two problems with the above output. The first is that brcmEGL and brcmGLESv2 don't need to link bcm_host, vchostif, bcm_host, vcos, or vchiq_arm. The second problem is that if you do link vcoshostif then you must also link pthreads, and this .pc does not. As a result, any build using it will fail:
> /home/al/Source/rpi-ramdisk/packages/sysroot/opt/vc/lib/libvchostif.a(vc_vchi_dispmanx.c.o):vc_vchi_dispmanx.c:function dispmanx_notify_func: error: undefined reference to 'sem_wait'
> /home/al/Source/rpi-ramdisk/packages/sysroot/opt/vc/lib/libvchostif.a(vc_vchi_dispmanx.c.o):vc_vchi_dispmanx.c:function dispmanx_client_callback: error: undefined reference to 'sem_getvalue'
> /home/al/Source/rpi-ramdisk/packages/sysroot/opt/vc/lib/libvchostif.a(vc_vchi_dispmanx.c.o):vc_vchi_dispmanx.c:function dispmanx_client_callback: error: undefined reference to 'sem_post'
> /home/al/Source/rpi-ramdisk/packages/sysroot/opt/vc/lib/libvchostif.a(vc_vchi_dispmanx.c.o):vc_vchi_dispmanx.c:function dispmanx_notify_callback: error: undefined reference to 'sem_getvalue'
> /home/al/Source/rpi-ramdisk/packages/sysroot/opt/vc/lib/libvchostif.a(vc_vchi_dispmanx.c.o):vc_vchi_dispmanx.c:function dispmanx_notify_callback: error: undefined reference to 'sem_post'
> /home/al/Source/rpi-ramdisk/packages/sysroot/opt/vc/lib/libvchostif.a(vc_vchi_dispmanx.c.o):vc_vchi_dispmanx.c:function dispmanx_send_command: error: undefined reference to 'sem_wait'
> /home/al/Source/rpi-ramdisk/packages/sysroot/opt/vc/lib/libvchostif.a(vc_vchi_dispmanx.c.o):vc_vchi_dispmanx.c:function dispmanx_get_handle: error: undefined reference to 'sem_wait'
> /home/al/Source/rpi-ramdisk/packages/sysroot/opt/vc/lib/libvchostif.a(vc_vchi_dispmanx.c.o):vc_vchi_dispmanx.c:function vc_vchi_dispmanx_init: error: undefined reference to 'sem_init'
> /home/al/Source/rpi-ramdisk/packages/sysroot/opt/vc/lib/libvchostif.a(vc_vchi_dispmanx.c.o):vc_vchi_dispmanx.c:function vc_vchi_dispmanx_init: error: undefined reference to 'sem_init'
> /home/al/Source/rpi-ramdisk/packages/sysroot/opt/vc/lib/libvchostif.a(vc_vchi_dispmanx.c.o):vc_vchi_dispmanx.c:function vc_vchi_dispmanx_init: error: undefined reference to 'sem_destroy'
> /home/al/Source/rpi-ramdisk/packages/sysroot/opt/vc/lib/libvchostif.a(vc_vchi_dispmanx.c.o):vc_vchi_dispmanx.c:function vc_vchi_dispmanx_init: error: undefined reference to 'sem_destroy'
> /home/al/Source/rpi-ramdisk/packages/sysroot/opt/vc/lib/libvchostif.a(vc_vchi_dispmanx.c.o):vc_vchi_dispmanx.c:function vc_dispmanx_stop: error: undefined reference to 'sem_getvalue'
> /home/al/Source/rpi-ramdisk/packages/sysroot/opt/vc/lib/libvchostif.a(vc_vchi_dispmanx.c.o):vc_vchi_dispmanx.c:function vc_dispmanx_stop: error: undefined reference to 'sem_post'
> /home/al/Source/rpi-ramdisk/packages/sysroot/opt/vc/lib/libvchostif.a(vc_vchi_dispmanx.c.o):vc_vchi_dispmanx.c:function vc_dispmanx_stop: error: undefined reference to 'sem_destroy'
> /home/al/Source/rpi-ramdisk/packages/sysroot/opt/vc/lib/libvchostif.a(vc_vchi_dispmanx.c.o):vc_vchi_dispmanx.c:function vc_dispmanx_stop: error: undefined reference to 'sem_destroy'
> /home/al/Source/rpi-ramdisk/packages/sysroot/opt/vc/lib/libvchostif.a(vc_vchi_dispmanx.c.o):vc_vchi_dispmanx.c:function vc_dispmanx_query_image_formats: error: undefined reference to 'sem_wait'
> collect2: error: ld returned 1 exit status
> Makefile:67: recipe for target 'egl' failed
> make[2]: *** [egl] Error 1
> make[2]: Leaving directory '/home/al/Source/rpi-ramdisk/packages/qt/qtbase/config.tests/egl'