GStreamer SDK - link error since upgrading to latest version (2012.11Brahmaputra)
philippe renon
philippe_renon at yahoo.fr
Fri Sep 20 14:14:18 PDT 2013
Hi,
I am reviving this thread as things have moved a bit since the last post.
To resume the issue at hand : I was happily developing with Qt and GStreamer SDK.
Then I upgraded to a more recent version of the GStreamer SDK and started hitting a link issue (on Windows...).
With the help of the community I came to understand that the issue was caused by a MinGW toolchain incompatibility concerning exceptions.
- the upgraded GStreamer SDK was compiled with SJLJ exceptions (prior version was using DWARF)
- Qt was compiled with DWARF exceptions
- It is not possible to mix the two models in the same compilation unit.
At the time my hopes to solve this issue were boosted when I was pointed to a new release of Qt (5.0.1) that was compiled with SJLJ exceptions.
Since then, the open source project I contribute to has switched to Qt 5.1.0, so I revisited the link issue.
But, unfortunately, that version of Qt switched back to DWARF...
The trigger for the switch was performance issues with SJLJ.
The switch was announced and motivated here : http://lists.qt-project.org/pipermail/development/2013-April/010667.html
Additionaly, this page compares the exception models and arguments the choice made by Qt : http://qt-project.org/wiki/MinGW-64-bit
Here is the failing link command:
g++ -shared -mthreads -Wl,--out-implib,D:/Projects/OP5/build/openpilotgcs_debug/lib/openpilotgcs/libGST_libd.a -o ../../../lib/openpilotgcs/GST_libd.dll
debug/gst_global.o debug/videowidget.o debug/moc_videowidget.o
-lglu32 -lopengl32 -lgdi32 -luser32
-LD:/Projects/OP5/build/openpilotgcs_debug/lib/openpilotgcs -Ld:/gstreamer/1.0/x86/lib -lgobject-2.0 -lglib-2.0 -lgstreamer-1.0
-Ld:/Projects/OpenPilotTools/qt-5.1.0/5.1.0/mingw48_32/lib -lQt5Testd -lQt5Guid -lQt5Cored
debug/gst_global.o:gst_global.cpp:(.eh_frame$_ZN6QDebug6StreamD1Ev+0x13): undefined reference to `__gxx_personality_v0'
debug/gst_global.o:gst_global.cpp:(.eh_frame$_ZN6QDebugD1Ev+0x13): undefined reference to `__gxx_personality_v0'
debug/gst_global.o:gst_global.cpp:(.eh_frame$_ZN6QDebuglsEPKc+0x13): undefined reference to `__gxx_personality_v0'
debug/gst_global.o:gst_global.cpp:(.eh_frame+0x13): undefined reference to `__gxx_personality_v0'
debug/gst_global.o:gst_global.cpp:(.eh_frame$_ZN5QListI7QStringE6appendERKS0_+0x13): undefined reference to `__gxx_personality_v0'
debug/gst_global.o:gst_global.cpp:(.eh_frame$_ZN5QListI7QStringE9node_copyEPNS1_4NodeES3_S3_+0x13): more undefined references to `__gxx_personality_v0' follow
debug/videowidget.o: In function `ZN11VideoWidgetC2EP7QWidget':
d:\Projects\OP5\build\openpilotgcs_debug\src\libs\gst_lib/../../../../../ground/openpilotgcs/src/libs/gst_lib/videowidget.cpp:72: undefined reference to `_imp___ZN7QWidgetC2EPS_6QFlagsIN2Qt10WindowTypeEE'
<snip>
I don't understand that, while compiling with the Qt toolchain, the errors seem to target Qt code and not GStreamer code.
I also don't understand why I get these errors since I am only using "gst_ pure C" methods (mixed with Qt methods obviously...).
Are the the GStreamer libraries "shadowing" something?
I tried to use more recent versions of the GStreamer SDK from www.gstreamer.com and also with the SDKs recently made available on www.gstreamer.org to no avail.
A solution would be to recompile Qt or GStreamer with the appropriate toolchain.
Unfortunately, the open source project I contribute to does not have the man power or hardware resources to maintain a custom build of such big SDKs.
My hope is that there is possible workaround.
Or, and I know that this is a long shot, that alternative GStreamer SDK build for Windows would be made available.
This would allow developpers to choose the Windows SDK that works for them.
Regards,
Philippe.
For reference this is the g++ that comes with Qt 5.1.0:
$ /d/Projects/OpenPilotTools/qt-5.1.0/Tools/mingw48_32/bin/g++ -v
Using built-in specs.
COLLECT_GCC=d:\Projects\OpenPilotTools\qt-5.1.0\Tools\mingw48_32\bin\g++.exe
COLLECT_LTO_WRAPPER=d:/projects/openpilottools/qt-5.1.0/tools/mingw48_32/bin/../libexec/gcc/i686-w64-mingw32/4.8.0/lto-w
rapper.exe
Target: i686-w64-mingw32
Configured with: ../../../src/gcc-4.8.0/configure --host=i686-w64-mingw32 --build=i686-w64-mingw32 --target=i686-w64-min
gw32 --prefix=/mingw32 --with-sysroot=/temp/x32-480-posix-dwarf-r2/mingw32 --enable-shared --enable-static --disable-mul
tilib --enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-
lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --d
isable-sjlj-exceptions --with-dwarf2 --disable-isl-version-check --disable-cloog-version-check --disable-libstdcxx-pch -
-disable-libstdcxx-debug --disable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --d
isable-symvers --with-gnu-as --with-gnu-ld --with-arch=i686 --with-tune=generic --with-host-libstdcxx='-static -lstdc++'
--with-libiconv --with-system-zlib --with-gmp=/temp/mingw-prereq/i686-w64-mingw32-static --with-mpfr=/temp/mingw-prereq
/i686-w64-mingw32-static --with-mpc=/temp/mingw-prereq/i686-w64-mingw32-static --with-isl=/temp/mingw-prereq/i686-w64-mi
ngw32-static --with-cloog=/temp/mingw-prereq/i686-w64-mingw32-static --enable-cloog-backend=isl --with-pkgversion='rev2,
Built by MinGW-builds project' --with-bugurl=http://sourceforge.net/projects/mingwbuilds/ CFLAGS='-O2 -pipe -I/temp/x32
-480-posix-dwarf-r2/libs/include -I/temp/mingw-prereq/x32-zlib/include -I/temp/mingw-prereq/i686-w64-mingw32-static/incl
ude' CXXFLAGS='-O2 -pipe -I/temp/x32-480-posix-dwarf-r2/libs/include -I/temp/mingw-prereq/x32-zlib/include -I/temp/mingw
-prereq/i686-w64-mingw32-static/include' CPPFLAGS= LDFLAGS='-pipe -L/temp/x32-480-posix-dwarf-r2/libs/lib -L/temp/mingw-
prereq/x32-zlib/lib -L/temp/mingw-prereq/i686-w64-mingw32-static/lib -L/temp/x32-480-posix-dwarf-r2/mingw32/opt/lib'
Thread model: posix
gcc version 4.8.0 (rev2, Built by MinGW-builds project)
>________________________________
> De : Andoni Morales <ylatuya at gmail.com>
>À : Discussion of the development of and with GStreamer <gstreamer-devel at lists.freedesktop.org>
>Cc : philippe renon <philippe_renon at yahoo.fr>
>Envoyé le : Mercredi 6 février 2013 15h07
>Objet : Re: GStreamer SDK - link error since upgrading to latest version (2012.11Brahmaputra)
>
>
>2013/2/5 Alexey Chernov <4ernov at gmail.com>:
>> В письме от 05 фев 2013 18:46:15 пользователь Andoni Morales написал:
>>> 2013/2/5 Andoni Morales <ylatuya at gmail.com>:
>>> > 2013/2/4 philippe renon <philippe_renon at yahoo.fr>:
>>> >> Hi Kyrylo,
>>> >>
>>> >> Thanks for helping.
>>> >>
>>> >> I don't yet have the answer to which C++ runtimes are used.
>>> >>
>>> >> But I can provide the details about the project's g++ :
>>> >>
>>> >> $ which g++
>>> >> /d/OPENPI~2/QtSDK/mingw/bin/g++
>>> >>
>>> >> $ g++ -v
>>> >> Using built-in specs.
>>> >> Target: mingw32
>>> >> Configured with: ../gcc-4.4.0/configure
>>> >> --enable-languages=c,ada,c++,fortran,java,objc,obj-c++
>>> >> --disable-sjlj-exceptions
>>> >>
>>> >> --enable-shared --enable-libgcj --enable-libgomp --with-dwarf2
>>> >>
>>> >> --disable-win32-registry --enable-libstdcxx-debug --enab
>>> >> le-version-specific-runtime-libs --prefix=/mingw
>>> >> --with-gmp=/mingw/src/gmp/root --with-mpfr=/mingw/src/mpfr/root --build
>>> >> =mingw32
>>> >> Thread model: win32
>>> >> gcc version 4.4.0 (GCC)
>>> >>
>>> >> At this point, I would like to know if the only solution is too make sure
>>> >> both projects are using the same toolchain.
>>> >> I hope not as this is a bit out of my league.
>>> >> Would it possible to "tweak" the project's toolchain or build process to
>>> >> become compatible with the SDK?
>>> >> If not, are there other alternatives? Is it in the SDK roadmap to support
>>> >> alternate toolchains ?
>>>
>>> I am not familiar with QT's SDK, but from the download area notes I
>>> see that they provide a toolchain that's built using the sljl
>>> exception handling model:
>>> "The MinGW binary package includes a 32 bit MinGW-builds (gcc 4.7.2,
>>> sjlj exception handing, posix threading) toolchain."
>>>
>>> So you should use this toolchain instead of MinGW default's one.
>>
>>> This is an issue with the different exception handling used in GCC.
>>> Our toolchain uses the old sljj exceptions while the one you are using
>>> uses dwarf. But this shouldn't be an issue unless you are mixing c++
>>> libraries. Are you using QtGStreamer? How are you building it?
>>> Can you please describe the steps to reproduce the issue such as which
>>> project should we checkout and which branch, configure options, etc...
>>
>> Yes, we have discussed this issue some time ago.
>>
>> Andoni is right, there's a problem with exception handling. Another problem is
>> that at least as of 2012.11 version, some GStreamer dependency requires _any_
>> GStreamer-based program (I experimented on 'hello world' example) be linked
>> with libstdc++6, which in turn leads to conflict in exception handling method.
>> Even if you workaround this link error, you'll have a good chance to get an
>> exception right after the program start in some strange place like strcpy()
>> call.
>
>This should be fixed ASAP as we shouldn't be pulling this dependency
>at all to link against GStreamer.
>
>Andoni
>
>
>>
>> What's more, as I've read in several places during my experiments, there're
>> some binary incompartibility in gcc-4.7.2 and previous versions, so I actually
>> haven't managed to get it work 2012.11 SDK 32-bit and Qt4 build with MinGW
>> 4.7.2.
>>
>> What solved the problem for me is using MinGW package downloaded by cerbero
>> during GStreamer SDK build process. I built Qt-4.8.4 with it and then built my
>> application against GStreamer SDK 2012.11 and this custom Qt build. Everything
>> worked fine after that.
>>
>> Also, David Hoyt suggested me to use OSSBuild package which also seems to help
>> but I still haven't tried it but it can fix the problem, too, I think.
>>
>> Alexey Chernov
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
>
>--
>Andoni Morales Alastruey
>
>LongoMatch:The Digital Coach
>http://www.longomatch.ylatuya.es
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130920/bdb135e6/attachment.html>
More information about the gstreamer-devel
mailing list