GNOME Bugzilla – Bug 794621
Library path switch in gst-libs/ext/Makefile.am causes cross compilation errors
Last modified: 2018-11-03 12:58:37 UTC
In gst-libs/ext/akefile.am , there is this line: echo "dependency_libs=' -L$(libdir) $(if $2,$(foreach dep,$2,$(abs_builddir)/$(dep).la)) $(call find_library_la,$3 $(LIBM),$(LDFLAGS)) '" && \ When trying to cross compile gst-libav 1.14.0 with Yocto rocko, this causes a problem. libdir is set to /usr/lib, so -L/usr/lib is passed to the compiler. Yocto detects this switch, and considers it a hard error. It is possible that GCC indeed is translating the path properly, but Yocto sees this path, and assumes that it is specifying an unsafe path to the host's libraries. Either way, this makes it impossible to build gst-libav 1.14.0 with Yocto. Possible solutions are to either (a) stick with a Yocto patch against gst-libav that removes the -L switch, (b) manually append the sysroot to this -L switch path, or (c) silence the Yocto error (not recommended). Note that other cross compilation environments that check the -I and -L paths are also likely to encounter this problem.
Note that, as a workaround, you can build ffmpeg in yocto instead, then Yocto will take care of all the linking. It's also likely the way we'll build it in the future. In this specific case, the -L is required if the .la is not resolved, otherwise -lbz2 will not be resolved properly if you are using a non-standard prefix. So if the .la is resolved on Yocto, removing is is harmless. Now, question is, how do we fix this libdir path ? I've never been clear what happen if you have gcc --systroot=/my/root -L /usr/lib ...
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-libav/issues/35.