raspberrypi/userland — pull request #179 by ajlennon (2014-06-02 09:12:54+00:00)
Title: #178 CMakelists.txt: Add '--no-as-needed' linker flag to ensure all specified...

... shared libraries are linked against applications (e.g. raspivid)

libmmal_vc_client.so makes use of __attribute__(constructor) to ensure that supplier components (e.g. camera) are loaded when the static library is loaded.

raspivid, and possibly other applications, link against libmmal_vc_client.so, causing the ctor to execute, but there is no needed dependency.

Some build environments (e.g. Yocto/OpenEmbedded) pass the '--no-as-needed' linker flag which removes the dependency on libmmal_vc_client and thus components are not registered.

In this situation raspivid then gives an error of the form

root@raspberrypi:~# raspivid -o test
mmal: mmal_component_create_core: could not find component 'vc.ril.camera'
mmal: Failed to create camera component
mmal: main: Failed to create camera component
mmal: Failed to run camera app. Please check for firmware updates

For further details see: https://lists.yoctoproject.org/pipermail/yocto/2014-June/019933.html

Signed-off-by: Alex J Lennon