userland: Add '--no-as-needed' linker flag to ensure all specified shared libraries are linked against applications (e.g. raspivid)
cover userland: Add '--no-as-needed' linker flag to ensure all specified shared libraries are linked against applications (e.g. raspivid)
Please see following patch for details
Alex J Lennon (1):
userland: Add '--no-as-needed' linker flag to ensure all specified
shared libraries are linked against applications (e.g. raspivid)
recipes-graphics/userland/userland_git.bb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
Signature · 1 line
2.0.0
PATCH 1/1 userland: 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 r
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
--- recipes-graphics/userland/userland_git.bb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
recipes-graphics/userland/userland_git.bb +7 -3
@@ -11,14 +11,18 @@ PROVIDES = "virtual/libgles2 \ virtual/egl" COMPATIBLE_MACHINE = "raspberrypi" +SRCBRANCH = "master" +SRCFORK = "raspberrypi" SRCREV = "eccb81050afd177da1923404b366c6226f29bfe0" -SRC_URI = "git://github.com/raspberrypi/userland.git;protocol=git;branch=master \ + +SRC_URI = "git://github.com/${SRCFORK}/userland.git;protocol=git;branch=${SRCBRANCH} \ " + S = "${WORKDIR}/git" inherit cmake -EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release" +EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS='-Wl,--no-as-needed'" # The compiled binaries don't provide sonames. SOLIBS = "${SOLIBSDEV}"
@@ -29,10 +33,10 @@ do_install_append() { rm -rf ${D}/opt } + FILES_${PN} += "${libdir}/*${SOLIBS}" FILES_${PN}-dev = "${includedir} \ ${prefix}/src" FILES_${PN}-doc += "${datadir}/install" PACKAGE_ARCH = "${MACHINE_ARCH}" -
Signature · 1 line
2.0.0
It looks ok to me.
Waiting for a push on remote.
I like the suggestion regarding SRC_URI format but I would have suggested it to be another patch.
The reason would be that when someone wants to do a revert to the change the suggestion would still remain,
but this is only a personal preference.
Good work once again, you really did me a service.
Thank you,
Alex
On Mon, Jun 2, 2014 at 1:04 PM, Alex J Lennon <[email protected]
Quoted 77 lines
wrote:
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_clientand thus components are not rIn 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 updatesFor further details see:
https://lists.yoctoproject.org/pipermail/yocto/2014-June/019933.htmlChange-Id I7d6b3751d043f2d79ea06f2d1205e7430f6e926dSigned-off-by Alex J Lennon <[email protected]>--- recipes-graphics/userland/userland_git.bb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)recipes-graphics/userland/userland_git.bb +7
-5@@ -11,14 +11,18 @@ PROVIDES = "virtual/libgles2 \ virtual/egl" COMPATIBLE_MACHINE = "raspberrypi" +SRCBRANCH = "master" +SRCFORK = "raspberrypi" SRCREV = "eccb81050afd177da1923404b366c6226f29bfe0" -SRC_URI = "git:// github.com/raspberrypi/userland.git;protocol=git;branch=master \ + +SRC_URI = "git:// github.com/${SRCFORK}/userland.git;protocol=git;branch=${SRCBRANCH} \ " + S = "${WORKDIR}/git" inherit cmake -EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release" +EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS='-Wl,--no-as-needed'" # The compiled binaries don't provide sonames. SOLIBS = "${SOLIBSDEV}"@@ -29,10 +33,10 @@ do_install_append() { rm -rf ${D}/opt } + FILES_${PN} += "${libdir}/*${SOLIBS}" FILES_${PN}-dev = "${includedir} \ ${prefix}/src" FILES_${PN}-doc += "${datadir}/install" PACKAGE_ARCH = "${MACHINE_ARCH}" - --2.0.0
Quoted 3 lines · Alexandru Vaduva
It looks ok to me.
Waiting for a push on remote.
Thanks Alex. Interesting issue. Next time I get a chance I need to turn back to getting gstreamer-1.0 working with it.
I've pushed the commit up to gherzan. Is there anything else I should be doing?
Quoted 6 lines
I like the suggestion regarding
SRC_URIformat but I would have suggested it to be another patch.
The reason would be that when someone wants to do a revert to the change the suggestion would still remain,
but this is only a personal preference.
OK, I could do that if it was needed. (I'm pleased you like it. I pushed a similar change upstream to my fork of
raspiberrypi/userland to try to make sure nobody else sinks time on this. Breaking out the fork and branch
that way helps me to manage the upstream commits and github pull request).
Quoted 3 lines
Good work once again, you really did me a service.
Cheers,
Alex
I am not sure, let`s wait and see what the maintainers(Andrei and John) have to say, if you pushed the
commit as recommended into the README file (
https://github.com/djwillis/meta-raspberrypi/blob/master/README).
I will try to contact them on Trello tonight if nothings happens until them.
Alex
On Mon, Jun 2, 2014 at 1:41 PM, Alex J Lennon <[email protected]
Quoted 36 lines
wrote:
Quoted 3 lines · Alexandru Vaduva
It looks ok to me.
Waiting for a push on remote.Thanks Alex. Interesting issue. Next time I get a chance I need to turn back to getting gstreamer-1.0 working with it.
I've pushed the commit up to gherzan. Is there anything else I should be doing?
Quoted 6 lines
I like the suggestion regarding
SRC_URIformat but I would have suggested it to be another patch.
The reason would be that when someone wants to do a revert to the change the suggestion would still remain,
but this is only a personal preference.OK, I could do that if it was needed. (I'm pleased you like it. I pushed a similar change upstream to my fork of
raspiberrypi/userland to try to make sure nobody else sinks time on this. Breaking out the fork and branch
that way helps me to manage the upstream commits and github pull request).Quoted 3 lines
Good work once again, you really did me a service.
Cheers,
Alex
Quoted 6 lines · Alexandru Vaduva
I am not sure, let`s wait and see what the maintainers(Andrei and John) have to say, if you pushed the
commit as recommended into the README file
(https://github.com/djwillis/meta-raspberrypi/blob/master/README).
I will try to contact them on Trello tonight if nothings happens until them.
I did (I believe). Given your comment is echoed by Paul I will break the commit into two separate ones, add the cut-off word and generate another patch-set.
Alex
Just jumping in to make a couple of minor comments, hope you don't mind.
Quoted 5 lines · Alex J Lennon
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_clientand thus components are not r
It looks like this line got cut off.
Quoted 22 lines
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 updatesFor further details see: https://lists.yoctoproject.org/pipermail/yocto/2014-June/019933.html
Change-Id I7d6b3751d043f2d79ea06f2d1205e7430f6e926dSigned-off-by Alex J Lennon <[email protected]>--- recipes-graphics/userland/userland_git.bb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)recipes-graphics/userland/userland_git.bb +0
-0
recipes-graphics/userland/userland_git.bb PROVIDES = "virtual/libgles2 \ · line 15
Quoted 5 lines
recipes-graphics/userland/userland_git.bb +2
-0@@ -11,14 +11,18 @@ PROVIDES = "virtual/libgles2 \ virtual/egl" COMPATIBLE_MACHINE = "raspberrypi" +SRCBRANCH = "master" +SRCFORK = "raspberrypi"
It looks like there are some changes here which are unrelated to the commit message, including the SRC_URI and whitespace changes below.
Quoted 30 lines
recipes-graphics/userland/userland_git.bb +5
-4SRCREV = "eccb81050afd177da1923404b366c6226f29bfe0" -SRC_URI = "git://github.com/raspberrypi/userland.git;protocol=git;branch=master \ + +SRC_URI = "git://github.com/${SRCFORK}/userland.git;protocol=git;branch=${SRCBRANCH} \ " + S = "${WORKDIR}/git" inherit cmake -EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release" +EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS='-Wl,--no-as-needed'" # The compiled binaries don't provide sonames. SOLIBS = "${SOLIBSDEV}"@@ -29,10 +33,10 @@ do_install_append() { rm -rf ${D}/opt } + FILES_${PN} += "${libdir}/*${SOLIBS}" FILES_${PN}-dev = "${includedir} \ ${prefix}/src" FILES_${PN}-doc += "${datadir}/install" PACKAGE_ARCH = "${MACHINE_ARCH}" - --2.0.0
Quoted 5 lines
--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto
Thanks,
Signature · 4 lines
Paul Barker Email: [email protected] http://www.paulbarker.me.uk