Recently, gstreamer is used on the arm platform, so cross-Compilation of gstreamer is started. There are two ways to implement cross-Compilation: 1. compile on the pc platform and use the arm-linux-series tools on the Ubuntu platform for compilation. This method is fast, but the cross configuration item settings of configure are troublesome. compile on the target platform and use the target gcc tool directly on the target board. This method is slow, but the configure configuration is very simple.
Recently, gstreamer is used on the arm platform, so cross-Compilation of gstreamer is started. There are two ways to implement cross-Compilation:
1. Compile on the pc platform and use the arm-linux-series tools on the Ubuntu platform for compilation. This method is fast, but it is troublesome to set configure cross-configuration items.
2. Compile on the target platform and use the target gcc tool directly on the target board. The compilation speed is slow, but the configure configuration is very simple, which is basically the same as the configure configuration on the PC.
The following is the compilation of the pc platform, and there are still errors
$ GLIB_CFLAGS = "-I/home/soeasy/nfsroot/target/usr/include/glib-2.0-I/home/soeasy/nfsroot/target/usr/lib/glib-2.0 /include "GLIB_LIBS ="-L/home/soeasy/nfsroot/target/usr/lib/"XML_CFLAGS ="-I/home/soeasy/nfsroot/target/usr/include/ libxml2 "GLIB_ONLY_CFLAGS ="-I/home/soeasy/nfsroot/target/usr/include/glib-2.0-I/home/soeasy/nfsroot/target/usr/lib/glib- 2.0/include ". /configure -- host = arm-linux -- disable-nls -- disable-static -- disable-loadsave -- with-html-dir =/tmp/dump -- prefix =/home/soeasy/nfsroot /gstreamer/install LDFLAGS = "-Wl, -rpath-link, /home/soeasy/nfsroot/target-lglib-2.0-lgobject-2.0-lgthread-2.0-lgmodule-2.0-lxml2 "CFLAGS ="-I/home/soeasy/nfsroot/target/usr/include-I/home /soeasy/nfsroot/target/usr/include/glib-2.0-I/home/soeasy/nfsroot/target/usr/lib/glib-2.0/include"
The link prompts the following errors:
Arm-linux-gcc-sharing. libs/libgstreamer_0.10_la-glib-compat.o \
. Libs/libgstreamer_0.10_la-gst.o. libs/libgstreamer_0.10_la-gstobject.o. libs/libgstreamer_0.10_la-gstbin.o \
. Libs/libgstreamer_0.10_la-gstbuffer.o. libs/libgstreamer_0.10_la-gstbus.o. libs/libgstreamer_0.10_la-gstcaps.o \
. Libs/libgstreamer_0.10_la-gstchildproxy.o. libs/libgstreamer_0.10_la-gstclock.o. libs/libgstreamer_0.10_la-gstelement.o \
. Libs/libgstreamer_0.10_la-gstelementfactory.o. libs/libgstreamer_0.10_la-gsterror.o. libs/libgstreamer_0.10_la-gstevent.o \
. Libs/libgstreamer_0.10_la-gstfilter.o. libs/libgstreamer_0.10_la-gstformat.o. libs/libgstreamer_0.10_la-gstghostpad.o \
. Libs/libgstreamer_0.10_la-gstindex.o. libs/libgstreamer_0.10_la-gstindexfactory.o. libs/libgstreamer_0.10_la-gstinfo.o \
. Libs/libgstreamer_0.10_la-gstinterface.o. libs/libgstreamer_0.10_la-gstiterator.o. libs/libgstreamer_0.10_la-gstmessage.o \
. Libs/libgstreamer_0.10_la-gstminiobject.o. libs/libgstreamer_0.10_la-gstpad.o. libs/libgstreamer_0.10_la-gstpadtemplate.o \
. Libs/libgstreamer_0.10_la-gstpipeline.o. libs/libgstreamer_0.10_la-gstplugin.o. libs/libgstreamer_0.10_la-gstpluginfeature.o \
. Libs/libgstreamer_0.10_la-gstquery.o. libs/libgstreamer_0.10_la-gstregistry.o. libs/libgstreamer_0.10_la-gstsegment.o \
. Libs/libgstreamer_0.10_la-gststructure.o. libs/libgstreamer_0.10_la-gstsystemclock.o. libs/libgstreamer_0.10_la-gsttaglist.o \
. Libs/libgstreamer_0.10_la-gsttagsetter.o. libs/libgstreamer_0.10_la-gsttask.o. libs/libgstreamer_0.10_la-gsttrace.o \
. Libs/libgstreamer_0.10_la-gsttypefind.o. libs/libgstreamer_0.10_la-gsttypefindfactory.o. libs/libgstreamer_0.10_la-gsturi.o \
. Libs/libgstreamer_0.10_la-gstutils.o. libs/libgstreamer_0.10_la-gstvalue.o. libs/libgstreamer_0.10_la-gstparse.o \
. Libs/libgstreamer_0.10_la-gstregistryxml.o. libs/libgstreamer_0.10_la-gstenumtypes.o. libs/libgstreamer_0.10_la-gstmarshal.o \
-Wl, -- whole-archive parse/. libs/libststparse. a-Wl, -- no-whole-archive-lm-lz-lpthread-ldl \
/Usr/lib/libgobject-2.0.so/usr/lib/libgthread-2.0.so-lrt/usr/lib/libgmodule-2.0.so/usr/lib/libglib-2.0.so/usr/lib/libxml2.so \
-Wl,-rpath-link-Wl,/home/soeasy/nfsroot/target-pthread-Wl, -- export-dynamic-Wl,-soname-Wl, libgstreamer-0.10.so.0 \
-Wl,-version-script-Wl,. libs/libgstreamer-0.10.ver-o. libs/libgstreamer-0.10.so.0.7.0
/Usr/lib/libgobject-2.0.so: cocould not read symbols: File in wrong format
Apparently need to link the library libgobject-2.0.so not located to the directory of the Cross library, but located the PC itself i686 library, the link is not successful.
According to the gcc parameter description, I specified
LDFLAGS = "-Wl,-rpath-link,/home/soeasy/nfsroot/target-lglib-2.0-lgobject-2.0-lgthread-2.0-lgmodule-2.0-lxml2"
But still error, depressed
Certificate ----------------------------------------------------------------------------------------------------------------------------------
Continue the cross-compilation work.
$ LDFLAGS = "-- sysroot =/home/soeasy/nfsroot/target-lglib-2.0-lgobject-2.0-lgthread-2.0-lgmodule-2.0-lxml2" CPPFLAGS = "-I/home/soeasy/nfsroot/target/ usr/include-I/home/soeasy/nfsroot/target/usr/include/glib-2.0-I/home/soeasy/nfsroot/target/usr/lib/glib-2.0/ include-I/home/soeasy/nfsroot/target/usr/include/libxml2 "GLIB_CFLAGS ="-I/home/soeasy/nfsroot/target/usr/include/glib-2.0- i/home/soeasy/nfsroot/target/usr/lib/glib-2.0/include "GLIB_LIBS ="-L/home/soeasy/nfsroot/target/usr/lib -- sysroot = /home/soeasy/nfsroot/target-lglib-2.0-lgobject-2.0-lgthread-2.0-lgmodule-2.0-lxml2 "GLIB_ONLY_CFLAGS ="-I/home/soeasy/nfsroot/target/usr/include/glib-2.0 -I/home/soeasy/nfsroot/target/usr/lib/glib-2.0/include "GLIB_ONLY_LIBS ="-L/home/soeasy/nfsroot/target/usr/lib /-- sysroot =/home/soeasy/nfsroot/target-lglib-2.0-lgobject-2.0-lgthread-2.0-lgmodule-2.0-lxml2 ". /configure -- prefix =/install -- disable-debug -- disable-valgrind -- host = arm-linux XML_CFLAGS = "-I/home/soeasy/nfsroot/target/usr/include/libxml2 "Maid ="-I/home/soeasy/nfsroot/target/usr/include/glib-2.0-I/home /soeasy/nfsroot/target/usr/lib/glib-2.0/include-I/home/soeasy/nfsroot/target/usr/include/libxml2"
This time it seems that the libgobject-2.0.so is successfully linked, but the following error occurs:
Libtool: link: arm-linux-gcc-shared. libs/libgstreamer_0.10_la-gst.o. libs/libgstreamer_0.10_la-gstobject.o. libs/libgstreamer_0.10_la-gstbin.o. libs/libgstreamer_0.10_la-gstbuffer.o. libs/libgstreamer_0.10_la-gstbufferlist.o. libs/libgstreamer_0.10_la-gstbus.o. libs/libgstreamer_0.10_la-gstcaps.o. libs/libgstreamer_0.10_la-gstchildproxy.o. libs/libgstreamer_0.10_la-gstclock.o. libs/libgstreamer_0.10_la-gstdebugutils.o. libs/libgstreamer_0.10_la-gstelement.o. libs/libgstreamer_0.10_la-gstelementfactory.o. libs/libgstreamer_0.10_la-gsterror.o. libs/libgstreamer_0.10_la-gstevent.o. libs/libgstreamer_0.10_la-gstfilter.o. libs/libgstreamer_0.10_la-gstformat.o. libs/libgstreamer_0.10_la-gstghostpad.o. libs/libgstreamer_0.10_la-gstindex.o. libs/libgstreamer_0.10_la-gstindexfactory.o. libs/libgstreamer_0.10_la-gstinfo.o. libs/libgstreamer_0.10_la-gstinterface.o. libs/libgstreamer_0.10_la-gstiterator.o. libs/libgstreamer_0.10_la-gstmessage.o. libs/libgstreamer_0.10_la-gstminiobject.o. libs/libgstreamer_0.10_la-gstpad.o. libs/libgstreamer_0.10_la-gstpadtemplate.o. libs/libgstreamer_0.10_la-gstparamspecs.o. libs/libgstreamer_0.10_la-gstpipeline.o. libs/libgstreamer_0.10_la-gstplugin.o. libs/libgstreamer_0.10_la-gstpluginfeature.o. libs/libgstreamer_0.10_la-gstpoll.o. libs/libgstreamer_0.10_la-gstpreset.o. libs/libgstreamer_0.10_la-gstquark.o. libs/libgstreamer_0.10_la-gstquery.o. libs/libgstreamer_0.10_la-gstregistry.o. libs/libgstreamer_0.10_la-gstsegment.o. libs/libgstreamer_0.10_la-gststructure.o. libs/libgstreamer_0.10_la-gstsystemclock.o. libs/libgstreamer_0.10_la-gsttaglist.o. libs/libgstreamer_0.10_la-gsttagsetter.o. libs/libgstreamer_0.10_la-gsttask.o. libs/libgstreamer_0.10_la-gsttaskpool.o. libs/libgstreamer_0.10_la-gsttrace.o. libs/libgstreamer_0.10_la-gsttypefind.o. libs/libgstreamer_0.10_la-gsttypefindfactory.o. libs/libgstreamer_0.10_la-gsturi.o. libs/libgstreamer_0.10_la-gstutils.o. libs/libgstreamer_0.10_la-gstvalue.o. libs/libgstreamer_0.10_la-gstparse.o. libs/libgstreamer_0.10_la-gstregistrybinary.o. libs/libgstreamer_0.10_la-gstxml.o. libs/libgstreamer_0.10_la-gstenumtypes.o. libs/libgstreamer_0.10_la-gstmarshal.o-Wl, -- whole-archive parse /. libs/libststparse. a-Wl, -- no-whole-archive-Wl,-rpath-Wl,/home/soeasy/nfsroot/target/usr/lib-Wl,-rpath-Wl, /home/soeasy/nfsroot/target/usr/lib-L/home/soeasy/nfsroot/target/usr/lib/libgobject-2.0.so /home/soeasy/nfsroot/target/usr/lib/libgthread-2.0.so-lpthread-lrt/home/soeasy/nfsroot/target/usr/lib/libgmodule-2.0.so/home/soeasy/nfsroot/target /usr/lib/libglib-2.0.so/home/soeasy/nfsroot/target/usr/lib/libxml2.so-lm-lz-ldl-Wl, -soname-Wl, libgstreamer-0.10.so.0-Wl,-version-script-Wl ,. libs/libgstreamer-0.10.ver-o. libs/libgstreamer-0.10.so.0.21.0
/Opt/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/bin /.. /lib/gcc/armv5tl-montavista-linux-gnueabi/4.2.0 /.. /.. /.. /.. /armv5tl-montavista-linux-gnueabi/bin/ld: skipping incompatible/lib/libpthread. so.0 when searching for/lib/libpthread. so.0
/Opt/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/bin /.. /lib/gcc/armv5tl-montavista-linux-gnueabi/4.2.0 /.. /.. /.. /.. /armv5tl-montavista-linux-gnueabi/bin/ld: cannot find/lib/libpthread. so.0
Collect2: ld returned 1 exit status
It seems that the library directory of the local system is found again.
Carefully analyze the final link command, which was originally carried out using libtool. Since all Makefile files are generated through config. status, think about the link command.
In this file, edit config. status, find shared, and view related scripts. Search for the following:
Archive_cmds = '$ CC-shared $ libobjs $ deplibs $ compiler_flags $ {wl}-soname $ wl $ soname-o $ lib'
Archive_expsym_cmds = 'echo "{global:"> $ output_objdir/$ libname. ver ~
Cat $ export_symbols | sed-e "s/\ (. * \)/\ 1;/"> $ output_objdir/$ libname. ver ~
Echo "local: * ;};" >>$ output_objdir/$ libname. ver ~
$ CC-shared $ libobjs $ deplibs $ compiler_flags $ {wl}-soname $ wl $ soname $ {wl}-version-script $ {wl} $ output_objdir/$ libname. ver-o $ lib'