-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
host_apps: Add --no-as-needed to stop libmmal_vc_client being dropped
Some versions of GCC have --as-needed turned on by default. The binding of libmmal_vc_client is such that the constructor registers the supported components with the MMAL core, and nothing calls into it directly. The linker can't tell this, decides it is unused, and promptly drops it as a dependency - cue no VideoCore components. Adding --no-as-needed means that the linker leaves it alone. It's not nice, but there doesn't appear to be a better solution. See #178.
- Loading branch information
1 parent
4228b6c
commit d491937
Showing
3 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
host_applications/linux/apps/hello_pi/hello_mmal_encode/Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
OBJS=mmal_encode.o | ||
BIN=hello_mmal_encode.bin | ||
LDFLAGS+=-lmmal -lmmal_core -lmmal_components -lmmal_util -lmmal_vc_client | ||
# Set --no-as-needed to stop the linker discarding mmal_vc_client | ||
# as it can't see that the constructor registers a load of functionality | ||
# with the MMAL core. | ||
LDFLAGS+=-Wl,--no-as-needed | ||
|
||
include ../Makefile.include | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters